oneforall运行出现问题解决方法

1. 输入python oneforall.py
在这里插入图片描述
显示模块没有找到错误;解决方法:运行一下命令,可以加快下载的速度,也可以使用别的

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

安装完成后继续运行python oneforall.py即可

2. 从github上拉取oneforall代码,想要配合Python3.11.1版本使用报错如下:

D:\Users\陈\Desktop\tool\OneForAll-master>python oneforall.py
Traceback (most recent call last):
  File "D:\Users\陈\Desktop\tool\OneForAll-master\oneforall.py", line 16, in <module>
    from brute import Brute
  File "D:\Users\陈\Desktop\tool\OneForAll-master\brute.py", line 14, in <module>
    import exrex
  File "D:\Python\Python311\Lib\site-packages\exrex.py", line 25, in <module>
    from re import sre_parse, U
ImportError: cannot import name 'sre_parse' from 're' (D:\Python\Python311\Lib\re\__init__.py)

在 D:\Python\Python311\Lib\re_init_.py不到对应的 ‘sre_parse’,只有对相近的 ‘_parser’ 存在引用。

import enum
from . import _compiler, _parser
import functools

这时添加依赖如下:

import enum
from . import _compiler, _parser
import functools
import sre_parse

从新运行python oneforall.py 命令,完美执行。
在这里插入图片描述

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
国际大赛的第一名为Better所夺得 三个月结束时他的EA(自动交易系统) 把本金从$10000增加成$130 475.45 他采用的就是神经网络原理的EA 这使得用神经网络方法做EA成为不少人关注的焦点 这里翻译一篇采用神经网络做EA的不错的示例文章当然附有源码是吸引人的地方 不过也许作者提出了研究神经网络EA的一些思考更为值得注意 作者提出了∶ 1。“如果有飞机,为什么还要教人类去飞?” 意思是研究是经网络不必从零起步。MT4里已有了不错的“遗传算法” 文中介绍了如何利用MT4已有的“遗传算法” 2。大家都说做单子最重要的是“顺势而为”,但更需要解决的是∶ “一个基于趋势的交易系统是不能成功交易在盘整(sideways trends), 也不能识别市场的回调(setbacks)和逆转(reversals.,反向走势)!” 这可是抓到不少人心中的“痒处” ,有多少人不是到了该逆势时没转向而产生亏损呢? 3。训练神经网络需要用多长的历史数据,提出了并不是用的历史数据越长越好,另外也不是训练的间隔越短越好,文中提出了什么情况下有需再训练它。 4。示例当然仅是示例 等等。。 一个朋友看了就觉得不错拿去发表了 这里发表以飨这里的朋友 下面是译文和作者的原文 The problem is stated for this automated trading system (ATS) as follows: (ATS)自动的(智能的,采用神经网络的)交易系统的问题表述如下 Let's consider we have a basic trading system - BTS. It is necessary to create and teach a neural network in order it to do things that cannot be done with the BTS. This must result in creation of a trading system consisting of two combined and mutually complementary BTS and NN (neural network). 如果我们有一个(BTS, basic trading system),同时需要用创建一个神经网络系统并教会它做BTS所不能做的事,按这个思路就是要创建这样一个交易系统∶它由互相补充(配合)的两部分组成,BTS和NN(神经网络)。 Or, the English of this is: There is no need to discover the continents again, they were all discovered. Why to teach somebody to run fast, if we have a car, or to fly, if we have a plane? 呃,英语说,我们不需要再去发现“新大陆”,它们是已经存在的东西!进一步说,如果我们已经有了汽车,那为什么还要教人如何跑得快?如果有飞机,为什么还要教人类去飞? Once we have a trend-following ATS, we just have to teach the neural network in countertrend strategy. This is necessary, because a system intended for trend-based trading cannot trade on sideways trends or recognize market setbacks or reversals. You can, of course, take two ATSes - a trend-following one and a countertrend one - and attach them to the same chart. On the other hand, you can teach a neural network to complement your existing trading system. 一旦有一个趋势交易系统的ATS,我们仅需要教会这个神经网络如何逆势(反趋势)交易的策略。这一点是非常必要的,因为一个基于趋势的交易系统是不能成功交易在盘整(sideways trends),也不能识别市场的回调(setbacks)和逆转(reversals.,反向走势)!当然,你可以采用两个ATS,一个基于“趋势”,一个基于“反趋势”(逆向),然后把它们挂到同一图表上。另一个办法是,你能教会神经网络如何与你现有的系统“互补地”协调工作! For this purpose, we designed a two-layer neural network consisting of two perceptrons in the lower layer and one perceptron in the upper layer. 为实现这个目标,我们设计了一个两层的神经网络,下层有两个感知机(perceptrons)上层有一个感知机。 The output of the neural network can be in one of these three states: 这个神经网络的能输出下列三种状态之一 Entering the market with a long position (Entering)市场是处在多向仓 Entering the market with a short position (Entering)市场是处在空向仓 Indeterminate state 不确定的, (不明确的, 模糊的)状态 Actually, the third state is the state of passing control over to the BTS, whereas in the first two states the trade signals are given by the neural network. 实际上,第三种状态是就把控制权交给BTS,反之前两种状态是交易信号由神经网络给出。 The teaching of the neural network is divided into three stages, each stage for teaching one perceptron. At any stage, the optimized BTS must be present for perceptrons to know what it can do. 神经网络的“教育”分成三步骤,每一步骤“教育”一个感知机,在任何一步骤,这个优化了的BTS必须存在为的是“感知机们”知道它自己能做什么。 The sep***te teaching of perceptrons by a genetic algorithm is determined by the lack of this algorithm, namely: The amount of inputs searched in with the help of such algorithm is limited. However, each teaching stage is coherent and the neural network is not too large, so the whole optimization does not take too much time. 感知机们分别的“教育”由遗传算法来承担,由于这样的算法的缺乏,换句话说,搜索到的这样的算法有限,限制了“输入”(参数变量)的数量(借助这样算法得到的参数变量的值),然而,每一步骤的“教育”是密切配合补充的。(因此效果还是不错),这样这个神经网络不会太大,整个的优化也不会耗费太多的时间。 The very first stage, preceding the teaching of an NN, consists in optimization of the BTS. 在“教育”NN之前的一步是对BTS进行优化。 In order not to lose ourselves, we will record the stage number in the input of the ATS identified as "pass". Identifiers of inputs corresponding with the stage number will and in the number equal to this stage number. 为了不使我们自己也被搞糊涂了,我们将已经测试通过的ATS的输入(参数变量)记录上(”通过”("pass")的步骤号(stage number).,输入s(参数变量)的标识符将和stage number(步骤号)一致(等同)。 Thus, let's start prep***tions for optimization and teaching the NN. Let's set the initial deposit as $1000000 (in order not to create an artificial margin call during optimization) and the input to be optimized as "Balance" in Expert Advisor properties on the tab of "Testing" in the Strategy Tester, and start genetic algorithm. 这样,我们开始对这个NN进行优化和“教育”的准备。存入初始保证金为$100万(以便于在优化期间不产生人为的补充保证金的通知)。Input(参数变量)是按“余额”进行优化,设置EA的Strategy Tester的测试的属性tab为"Testing" 。开始运行遗传算法。 Let's go to the "Inputs" tab of the EA's properties and specify the volume of positions to be opened by assigning the value 1 to the identifier "lots". 在这个EA的开仓量 "lots".的值设为1 lot。 Optimization will be performed according to the model: "Open prices only (fastest method to analyze the bar just completed, only for EAs that explicitly control bar opening)", since this method is available in the ATS algorithm. 从这个ATS算法明确地有效开始,实施优化,所采用复盘模型是∶“仅用开盘价(以最快速的方法分析刚形成的柱线)”。 Stage 1 of optimization. Optimization of the BTS: 优化步骤1,BTS的优化 Set the value 1 for the input "pass". 设置为 1 为这input(参数变量)“为通过”(the input "pass")。 We will optimize only inputs that correspond with the first stage, i.e., that end in 1. Thus, we check only these inputs for optimization, and uncheck all others. 我们仅仅优化步骤1相关的那些inputs(参数变量),即,尾标为 1 的参数变量,于是,我们仅仅测试优化有关的inputs而不测试其他的变量参数 tp1 - TakeProfit of the BTS. It is optimized with the values within the range of 10 to 100, step 1 tp1,BTS的所取的止盈值(TakeProfit)。在step 1,优化的值的范围在10到100, sl1 - StopLoss of the BTS. It is optimized with the values within the range of 10 to 100, step 1 sl1,BTS的所取的止损值(StopLoss)。在step 1,优化的值的范围在10到100 。 p1 - period of CCI used in the BTS. It is optimized with the values within the range of 3 to 100, step 1 pl, 用于BTS的CCI的周期值。在step 1 ,优化的值的范围在 3到100 Stage 2. Teaching the perceptron responsible for short positions: 步骤 2 ,“教育负责管“开空仓”(short positions)的感知机 Set the value 2 (according to the stage number) for the input "pass". 根据步骤的步骤号,设置(input,参数变量) 的"pass"的值为 2。 Uncheck the inputs checked for optimization in the previous stage. Just in case, save in a file the inputs obtained at the previous stage. 不测试那些已经测试过的优化了的以前步骤的inputs.(变量参数)。以防万一,保存以前步骤获得的inputs(变量参数值)到一个文件中去 Check the inputs for optimization according to our rule: their identifiers must end in 2: 根据我们的规则,必须是测试那些是在尾标为 2的inputs(变量参数)。 x12, x22, x32, x42 - weight numbers of the perceptron that recognizes short positions. It is optimized with the values within the range of 0 to 200, step 1 x12, x22, x32, x42 是识别并开空仓的感知机的权重,它们的值在step 1时被优化在范围0 to 200 tp2 - TakeProfit of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1 tp2 (TakeProfit) 是感知机所开的仓的止盈值,它们的值在step 1时被优化在范围10 to 100。 sl2 - StopLoss of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1 sl2 (StopLos) 在 step 1它是感知机所开的仓的止损值,被优化值的范围在 10 to 100 p2 - the period of the values of price difference to be analyzed by the perceptron. It is optimized with the values within the range of 3 to 100, step 1. p2 感知机所分析的价格差的周期值 (iiCCI()函数的一个参数∶period - Averaging period for calculation),在step 1 它的值所优化的范围在3 to 100 Let's start teaching it using optimization with a genetic algorithm. The obtained results are given below: 现在,开始用遗传算法来优化“教育”NN(让它“学习”市场),获得的结果如下∶ Stage 3. Teaching the perceptron responsible for long positions: 步骤 3 “教育”负责开多仓的感知机(“学习”市场)。 Set the value 3 (according to the stage number) for the input "pass". 设置值 3 (根据步骤的步骤号)说明这些input(变量参数)已经“通过”(the input "pass") Uncheck the inputs checked for optimization in the previous stage. Just in case, save in a file the inputs obtained at the previous stage. 同样,不测试,那些已经测试过的优化了的,以前步骤的inputs.(变量参数值),以防万一,保存以前步骤获得的inputs.(变量参数值) 到一个文件中去 Check the inputs for optimization according to our rule: their identifiers must end in 3: 根据我们的规则,优化测试的inputs(变量参数值)必须是尾标为3的那些变量参数。 x13, x23, x33, x43 - weight numbers of the perceptron that recognizes long positions. It is optimized with the values within the range of 0 to 200, step 1. x13, x23, x33, x43是识别多仓的感知机的权重,它们的值在step 1时被优化时得到的范围在0 to 200 tp3 - TakeProfit of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1 tp 3 (TakeProfit) 是感知机所开的仓的“止盈值”,它的值在step 1时被优化时的范围是在10 to 100。 sl3 - StopLoss of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1 sl3 (StopLoss) 是感知机所开的仓的“止盈值”,它们的值在step 1时被优化为范围是10 to 100。 p3 - the period of the values of price difference to be analyzed by the perceptron . It is optimized with the values within the range of 3 to 100, step 1. p3 --感知机所分析的价差的周期值。它在步骤 1 优化时得到的值的范围是 3 to 100 。 Let's start teaching it using optimization with a genetic algorithm. The obtained results are given below: 启动采用遗传算法的优化来“教育”NN,所获得的结果如下∶ Stage 4 (final). Teaching the first layer, i.e., teaching the perceptron that is in the upper layer: 步骤 4 (最终步骤) “教育”第一层,即“教育”在上层的感知机。 Set the value 4 (according to the stage number) for the input "pass". 根据步骤的步骤号,设置值4 为输入通过(for the input "pass") Uncheck the inputs checked for optimization in the previous stage. Just in case, save in a file the inputs obtained at the previous stage. 不测试那些在之前步骤已经测试过的优化了的“输入” (inputs) (意思是∶已经在之前步骤优化过的变量的参数值就不再优化它们了)。以防万一,将之前步骤获得的这些变量的参数值存到一个文件中去。 Check the inputs for optimization according to our rule: their identifiers must end in 4: 根据我们的规则,只测试优化标识符最后位是4的那些inputs(变量的参数值) x14, x24, x34, x44 - weight numbers of the perceptron of the first layer. It is optimized with the values within the range of 0 to 200, step 1. x14, x24, x34, x44 是第一层感知机参数的权重值。在步骤 1 时它们被优化的值的范围在0 io 200 。 p4 - the period of the values of price difference to be analyzed by the perceptron. It is optimized with the values within the range of 3 to 100, step 1. p4 被感知机分析的价差的值的周期。在步骤 1 它的值的范围被优化在 3 to 100 。 Let's start teaching it using optimization with a genetic algorithm. The obtained results are given below: 采用遗传算法来优化,启动“教育”来教它“学习”。所获得结果如下∶ That's all, the neural network has been taught. 这就是全部,神经网络已经被“教育”了。 The ATS has one more non-optimizable input, mn - Magic Number. It is the identifier of positions for a trading system not to mix its orders with the orders opened manually or by other ATSes. The value of the magic number must be unique and not coincide with the magic numbers of positions that have not been opened by this specific Expert Advisor. 这个ATS有一个不能被优化的input(参数) mn-- Magic Number.(魔法号)它是一个交易系统它所开的仓位的识别符,为的是不和手动开仓或其他ATSes开的仓位混淆。这个Magic Number的值必须是唯一的并且和这个特别的ea尚未开仓的magic numbers不一致。 P.S. The size of the initial deposit is found as the doubled absolute drawdown, i.e., we consider some safety resources for it. 出于保证有一些安全保险的考虑,初始保证金的金额设置是考虑为绝对最大回落的两倍 The EA given in the source codes is not optimized. 这个ea的源代码没有优化。 If you need to replace the built-in BTS with the algorithm of another trading system, you must modify the contents of the function basicTradingSystem(). 如果你需要置换嵌入另一个交易系统算法的BTS,你必须修改BTS功能的内部。 In order not to enter the initial and the final values and the values of steps for optimization, you can take the ready file combo.set, place it in the folder tester MT4, and upload to the EA's properties in Tester. 以便于不输入优化时的初值,终值和步长,你可采用已备好的combo.set文件,把它放置到MT4的 tester 目录并加载这个ea的属性(properties)到Strategy Tester。 Re-optimization of the EA is to be performed at a weekend, i.e., on Saturday or on Sunday, but only if the results of the preceding week were unprofitable. The presence of losses means that the market has changed, and the re-optimization is necessary. The presence of profits means that the ATS does not need any re-optimization and recognizes market patterns quite well. 这个ea的再优化可在周末进行,即周六和周日,但仅在前面一周的结果是不盈利的。亏损的出现意味着市场已经改变,于是需要重新优化,若是仍然获利意味着这个ATS不需要重新优化,它对市场目前的模型的识别继续有效! 5 comments Subscribe to discussion sstef wrote: backtests seems ok, how about forward tests ? Try independet without me. You all have for original forward and other tests: open source, tester, head and hands. reply 08.03.2008 08:57 Reshetov thanks a lot Reshetov, very simple but very powerful, i have never think about this idea, backtests seems ok, how about forward tests ? reply 07.03.2008 23:42 sstef tws0124 wrote: What is the number of pass? Try test for pass value of 1, 2, 3 and 4 What is best of the best, that use (right solution: pass = 4) reply 07.03.2008 10:45 Reshetov All the optimization is completed, now I use it by live account, What is the number of pass? Sorry,bad English...
DirectX修复工具(DirectX Repair)是一款系统级工具软件, 简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复。 程序主要针对0xc000007b问题设计,可以完美修复该问题。本程序中包含了最新版 的DirectX redist(Jun2010),并且全部DX文件都有Microsoft的数字签名,安全放心。 本程序为了应对一般电脑用户的使用,采用了傻瓜式一键设计,只要点击 主界面上的“检测并修复”按钮,程序就会自动完成校验、检测、下载、修复以及注册 的全部功能,无需用户的介入,大大降低了使用难度。 本程序适用于多个操作系统,如Windows XP(需先安装.NET 2.0,详情 请参阅“致Windows XP用户.txt”文件)、Windows Vista、Windows 7、Windows 8、 Windows 8.1、Windows 8.1 Update、Windows 10,同时兼容32位操作系统和64位操作系统。 本程序会根据系统的不同,自动调整任务模式,无需用户进行设置。 本程序的V3.8版分为标准版、增强版以及在线修复版。所有版本都支持修复DirectX的功能, 而增强版则额外支持修复c++的功能。在线修复版功能与标准版相同,但其所需的数据包需要在 修复时自动下载。各个版本之间,主程序完全相同,只是其配套使用的数据包不同。因此,标准版 和在线修复版可以通过补全扩展包的形式成为增强版。本程序自V3.5版起,自带扩展功能。只要在 主界面的“工具”菜单下打开“选项”对话框,找到“扩展”标签,点击其中的“开始扩展” 按钮即可。扩展过程需要Internet连接,扩展成功后新的数据包可自动生效。 扩展用时根据网络速度不同而不同,最快仅需数秒,最慢需要数分钟,烦请耐心等待。 本程序自V2.0版起采用全新的底层程序架构,使用了异步多线程编程技术,使得检测、 下载、修复单独进行,互不干扰,快速如飞。新程序更改了自我校验方式,因此使用新版本 的程序时不会再出现自我校验失败的错误;但并非取消自我校验,因此程序安全性与之前 版本相同,并未降低。 程序有自动更新c++功能。由于绝大多数软件运行时需要c++的支持,并且 c++的异常也会导致0xc000007b错误,因此程序在检测修复的同时,也会根据需要 更新系统中的c++组件。自V3.2版本开始使用了全新的c++扩展包,可以大幅提高工业 软件修复成功的概率。修复c++的功能仅限于增强版,标准版及在线修复版在系统c++ 异常时(非丢失时)会提示用户使用增强版进行修复。除常规修复外,新版程序还支持 C++强力修复功能。当常规修复无效时,可以到本程序的选项界面内开启强力修复功能, 可大幅提高修复成功率。请注意,此功能为试验性功能,请仅在常规修复无效时再使用。 程序有两种窗口样式。正常模式即默认样式,适合绝大多数用户使用。另有一种 简约模式,此时窗口将只显示最基本的内容,修复会自动进行,修复完成10秒钟后会自动退出。 该窗口样式可以使修复工作变得更加简单快速,同时方便其他软件、游戏将本程序内嵌, 即可进行无需人工参与的快速修复。开启简约模式的方法是:打开程序所在目录下的 “Settings.ini”文件(如果没有可以自己创建),将其中的“FormStyle”一项的值改 为“Simple”并保存即可。 新版程序支持命令行运行模式。在命令行中调用本程序,可以在路径后直接添加命令 进行相应的设置。常见的命令有7类,分别是设置语言的命令、设置窗口模式的命令,设置 安全级别的命令、开启强力修复的命令、设置c++修复模式的命令、控制DirectDraw的命令、 显示版权信息的命令。具体命令名称可以通过“/help”或“/?”进行查询。 程序有高级筛选功能,开启该功能后用户可以自主选择要修复的文件,避免了其他不 必要的修复工作。同时,也支持通过文件进行辅助筛选,只要在程序目录下建立“Filter.dat” 文件,其中的每一行写一个需要修复文件的序号即可。该功能仅针对高级用户使用,并且必须 在正常窗口模式下才有效(简约模式时无效)。 本程序有自动记录日志功能,可以记录每一次检测修复结果,方便在出现问题时, 及时分析和查找原因,以便找到解决办法。 程序的“选项”对话框中包含了6项高级功能。点击其中的“注册系统文件夹中所有dll文件” 按钮可以自动注册系统文件夹下的所有dll文件。该项功能不仅能修复DirectX的问题, 还可以修复系统中很多其他由于dll未注册而产生的问题,颇为实用。点击该按钮旁边的小箭头, 还可以注册任意指定文件夹下的dll文件,方便用户对绿色版、硬盘版的程序组件进行注册。 点击第二个按钮可以为dll文件的右键菜单添加“注册”和“卸载”项,方便对单独的dll文件 进行注册。请注意,并不是所有的dll文件都可以通过这种方式注册。点击“扩展”选项可以 将任意版本的程序扩展成增强版。点击“DirectX版本”选项,可以自行修改系统中DirectX的 版本信息。点击“DirectX加速”选项可以控制系统中DirectX加速的开启与关闭。点击“实验室” 选项可以开启实验功能:C++强力修复功能,通过全新的代码设计,彻底改善对于顽固异常文件的处理, 极大提高修复成功率。API Sets强力修复功能,参照了DirectX文件的精细修复方式,极大地改善了 修复失败的情况。修复失败时启用调试模式功能,可以在出现问题时分析错误原因。 新版程序集成了用户反馈程序,可以在用户允许的前提下发送检测修复结果。 用户也可以在出现问题时通过反馈程序和软件作者进行交流,共同查找问题。 反馈是完全自愿和匿名(如果不填写E-mail地址)的。 本程序的通用版基于Microsoft .NET Framework 2.0开发,对于Windows 2000、 Windows XP、Windows 2003的用户需要首先安装.NET Framework 2.0或更高版本 方可运行本程序。有关下载和安装的详细信息请参阅“致Windows XP用户.txt”文件。 对于Windows Vista、Windows 7及后续用户,可以直接运行本程序。 同时鉴于Windows 8(Windows 8.1、Windows 8.1 Update)、Windows 10系统中默认未包含 .NET Framework 2.0,因此新版的程序文件夹内将包含一个DirectX_Repair_win8_win10的特别版程序, 该程序功能与通用版相同,基于.NET Framework 4.0开发,可以在Windows8(Windows 8.1、Windows 8.1 Update)、 Windows 10系统中直接运行(其他系统如果安装了.NET Framework 4.0也可以运行这个特别版的程序)。 本程序的官方博客地址为:http://blog.csdn.net/vbcom/article/details/6962388 所有的更新以及技术支持都可以到该博客上找到。 此次发布的程序虽经多次测试,但仍难免存在不足以及BUG,希望大家见谅并指正。 如果您对本程序有任何疑问或建议,欢迎发送电子邮件到: zhangyue667#263.net (把#换成@) 本人期待与您的交流。 最后,再次感谢大家的支持! zhangyue667#263.net 2018-12-12 DirectX Repair is the system-level tool software which is designed for addressing the problems in DirectX. This programme is installation free and can run directly under Windows OS. The main function of this programme is to check the possible errors under the DirectX, especially the 0xc000007b problems, and then fix them. This programme consists of the latest version of DirectX Redist (Jun2010), and all the DX files have the digital signatures from Microsoft. In this case, the security of this programme can be guaranteed. To be friendlier to the less experienced users, this programme is designed to repair all the underlying issues by just clicking one button. Once the users click the button “Check and Repair” on the main form, the programme will finish verification, checking, downloading, repairing and registering automatically, without any further participation from the users, which reduces the difficulty of operating this software. This programme is suitable for multiple Windows OS, such as Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 8.1 Update and Windows 10, and both 32-bit and 64-bit systems are supported. The programme can detect the version of the system and the bit of system automatically, and repair the necessary files accordingly. No manual settings are required. DirectX Repair V3.8 provides three different editions of programmes; for example, Standard Edition, Enhanced Edition and Online Edition. All editions can repair DirectX, while the Enhanced Edition can extra repair c++ components. The Online Edition is similar to the Standard Edition, but the files for repairing are not included in Online Edition. Consequently, Internet connection is required when it is repairing the files. The exe applications are exactly the same between each edition. What makes their differences is the data package that they include. In this context, the Standard and Online Edition could be extended to Enhance Edition if new data packages are added. From V3.5 on, DirectX Repair supports a new feature called Extending. The Extending page can be found from the sub-menu “Option” under the menu “Tool”. The extending process requires Internet connection. The new data packages will be activated automatically after the successful extending. The time for extending varies from a few seconds to a few minutes according to the Internet speed. From V2.0 on, DirectX Repair has updated the base of the programme with multithread programming technologies. The new design provides separated tasks for checking, downloading and repairing, which means that each task can perform individually without interfering between each other. The programme also improves the verification mechanism, so there will not be any errors during the verification process; however, this does not mean that the programme cancels the verification, so the security level remains the same as previous versions. The programme supports updating c++ components. Since most software requires the assistance of c++ while running and the exceptions in c++ might also lead to 0xc000007b errors, the programme will examine c++ during the checking process. From V3.2 on, DirectX Repair starts to employ new c++ packages, and it can significantly increase the rate of successful repairing, especially for the industrial software. Such c++ repairing is only available for Enhanced Edition. The Standard and Online Edition will inform the users to switch to Enhanced Edition if the programme finds that there might be possible errors from the exceptional c++ components (not from missed c++ components). Besides the normal repairing, the programme now supports c++ enhanced repairing. You can enable "C++ enhanced repairing" from "Tool" -> "Option" -> "Lab" if normal repairing is invalid. Please be aware that this function is experimental and should only be used when normal repairing is not successful. There are two types of form styles, which are normal style and simple style respectively. Normal style is the default style, and it is suitable for most users. Simple style is a simplified form, and only the most basic elements will be shown. In this style, checking and repairing will be implemented automatically, and the programme will quit in 10 seconds after completing all the processes. This design is to provide an easy operation for some labour sensitive users, and this style is easy to be integrated in other games or software to achieve the goal of human-involved free repairing. The simple style can be enabled by following steps: open the file “Settings.ini” under the programme folder (this file can be created manually if there is no such file under the folder); change the value of “FormStyle” to “Simple”; save the file and this feature is then enabled. The programme can be called from command line, and it can accept commands from command line. The commands can be added just after the path. There are 7 types of commands, which are language commands, form style commands, security level commands, enhanced repairing commands, c++ repairing configuration commands, DirectDraw configuration commands, and copyright commands respectively. The detailed commands can be acquired by adding "/help" or "/?" after the normal path. This programme also provides a feature called Advanced Filter. With this feature, the users can select which files are needed to be repaired, so the unnecessary repairing could be avoided. Meanwhile, the programme can also realize Advanced Filter by creating an auxiliary file called “Filter.dat” under the programme folder. In this auxiliary file, the indexes of the selected files can be written individually in each line. This feature might be only suitable for the experienced users, and it is only available in the normal style. This programme can record the logs automatically while repairing. Each result is recorded separately with context information. This feature is quite useful especially when the repairing is failed, since the author can analyse the possible reasons from the recorded logs. There are six advanced features in the dialog form of “Option”. By clicking the button of “Register all ‘dll’ files in your system folder”, the programme will register all the dll files under your system folder automatically. This feature is not only suitable for the issues caused by DirectX, but also useful for the problems generated by the unregistered dll files. There is a small arrow beside this button, and it is designed to register the dll files under the specified folder. By clicking the button of “Add items ‘Register’ and ‘Unregister’ to dll-file right-click menu”, new items will appear under the right-click menu of the dll files. Please note that, not all the dll files can be registered by this method. In the “Extending” Tab, the programme can be extended to Enhanced Edition from Standard or Online Edition. In the “DX Version” Tab, the DirectX information can be amended by the users. In the “DX Acceleration” Tab, the DirectX accelerations can be enabled or disabled. In the "Lab" Tab, the following functions can be activated: C++ enhanced repairing, which is newly designed, aims to improve the handling of some abnormal files and to increase the success rate; API Sets enhanced repairing, referencing the careful repairing from DirectX files, promotes the results of repairing API Sets files; "Enable debug mode when failed" tries to provide extra debugging information when some files are failed to be repaired. The new version of programme has embedded the feedback programme, and the repairing results can be sent back to the author with the permit of the end users. The end users can also communicate with the author by the feedback function to address the issues together. The feedback is voluntary and anonymous (if you do not fill in your E-mail address). The general version of this programme (DirectX Repair.exe) is developed by Microsoft .NET Framework 2.0. To the users who are still using Windows 2000, Windows XP and Windows 2003, you need to install Microsoft .NET Framework 2.0 or higher versions before you can run this programme. The detailed steps for installing .NET can be found in the file “To Windows XP users.txt”. The ones who use Windows Vista, Windows 7 or Windows beyond can run this programme directly on your systems. Besides, since Windows 8 (Windows 8.1, Windows 8.1 Update) and Windows 10 do not include .NET Framework 2.0 directly, a new special file (DirectX_Repair_win8_win10.exe) is included under the programme folder. This file has exactly the same functions as the general version. The difference is that this file is developed by .NET Framework 4.0, so it can run directly under Windows 8 and Windows 10. Other Windows systems can also run this programme if they install .NET Framework 4.0. The official blog for DirectX Repair can be found by the following link: http://blog.csdn.net/vbcom/article/details/6962388 All the updates and technical supports can be obtained from this web page. Although this programme has been tested many times before publishing, there still could be some bugs within this programme. I will appreciate if you can point out the errors and report them to me. If you have any questions, suggestions or comments of this software, please do not hesitate to contact with me by E-mail: zhangyue667#263.net (Please swap # with @) I am looking forward to your E-mails. Finally, thanks for all of your cooperation! zhangyue667#263.net 2018-12-12
arcgis工具总结 1. 要素的剪切与延伸 实用工具 TASK 任务栏 Extend/Trim feature 剪切所得内容与你画线的方向有关。 2. 自动捕捉跟踪工具 点击Editor工具栏中Snapping来打开Snapping Environment对话框 捕捉设置中有3个选项, vertex edge end 分别是节点、终点、和边,选择end应该会捕捉端点 3. 图斑面积计算及长度计算 应用工具CALCULATE AREA 或者使用VBA代码实现 新建字段并开启Advanced 写入代码,面积计算: Dim Output as double Dim pArea as Iarea Set pArea = [shape] 在最后的一个空格里面写入代码(即:字段名)pArea.area 长度计算: Dim Output as double Dim pCurve as ICurve Set pCurve = [shape] Output = pCurve.Length 4. 剪切图斑 Task任务栏 cut polygon feature工具,需要sketch工具画线辅助完成 5. 配准工具 Spatial Adjustment 工具 需要注意先要 set adjustment data 然后配准 6. 影像校正 Georeferncing工具 7. 要素变形 Task 工具条中的reshape feature 配合sketch工具 8. 添加节点 Modify feature 在需要加点的地方右键单击insert vertex 也可单击右键选择properties 打开edit sketch properties对话框,在坐标点位置右键插入节点 9. 共享多边形生成 Auto-complete polygon 工具生成共享边的多边形,配合snapping environment更好。 10. 画岛图 1).使用任务栏中的sketch工具,当画完外面的一圈时,右键 选择finish part 然后画中间的部分 再右键finish sketch 2).分别画连个图斑然后应用Editor 工具栏中的工具先intersect(图斑重叠的地方创建一个新的图斑)然后Clip(剪切)即可。(补充其他工具:Union,把多个图斑联合起来并形成一个新的连接在一起的图斑,原图斑无变化,联合后的图斑不继承原任何图斑的属性;Merge,把多个图斑合并到其中一个图斑上并继承它的属性,原图斑变化;Split用于间断线段,但得知道具体的长度,如果不知道那么长度或者没必要那么精确就直接用Eeitor工具栏的Split tool工具 ) 11. 连接外界属性数据(如:.xsl文件等) 利用JOIN 工具可以方便的实现与外界属性数据的关联,但这种关联是依赖于外界数据库本身的,需经过重新导出之后即完全保存在相应图层属性页。在做外联如EXCEL等的时候对数据有一些要求,确保第一行包含字段名,这些字段名不能超过十个字母,不能出现特殊字符。最好把EXCEL保存为.csv文件去除一些不兼容的内容再连接。 转载ESRI论坛Lucy1114帖子说明: 12. 导出Shape格式为其他软件识别的打印格式如JEPG等格式 FILE/EXPORT MAP 然后选择相应的图片格式,此时也可设置答应的分辨率 pdi 13. 建立注记层 方法一.carvert to Ananotation ,方法二.Draw工具条 方法三.从其他地方转换注记图层 14. 查看特定区域范围内的某种地物分布情况 Selection / select by location 15. 如何用面生成中线 先把数据转成coverage格式,workstion里有Centerline命令。 另外ArcToolBox->Data Management Tools->Generalization->Collapse Dual Lines To Centerline也行。不过以上做法要求边界是双线。你必须先把面转成线,特别是参数的设置。也可以尝试下sketch工具条中的midpoint tool 后面有详细的讲解过程。 16. 根据坐标数据生成点 方法一. :[工具] >>[添加XY 数据],在“添加XY 数据”窗口中,选择已添加的 XY 数据表,指定X 坐标字段(东经)和Y 坐标字段(北纬),按“编辑”按钮,选择坐标系统。一般GPS系统采用的坐标系统为WGS_1984。 方法二.直接用TOOL工具下的ADD XY 可以单个加点 17. 用任意多边形剪切栅格数据(矢量数据转换为栅格数据) 在ArcCatalog下新建一个要素类(要素类型为:多边形),命名为:ClipPoly.shp 在ArcMap中,加载栅格数据:Landuse、和ClipPoly.shp 打开 编辑器工具栏,开始编辑ClipPoly ,根据要剪切的区域,绘制一个任意形状的多 边形。打开属性表,修改多边形的字段“ID”的值为1,保存修改,停止编辑。 打开 空间分析工具栏 GIS软件应用-ArcGIS 执行命令:--- 指定栅格大小:查询要剪切的栅格图 层Landuse 的栅格大小,这里指定为25 指定输出栅格的名称为路径 执行命令: - 构造表达式:[Landuse]*[polyClip4-polyclip4] ,执行栅格图层:Landuse 和 用以剪切 的栅格polyClip4 之间的相乘运算 GIS软件应用-ArcGIS 得到的结果即是以任意多边形剪切的Landuse数据 18. 栅格重分类(Raster Reclassify) 通过栅格重分类操作可以将连续栅格数据转换为离散栅格数据 19. Eliminate合并破碎多边形 以下的操作将会把面积小于10000 平方米的多边形合并到周围与之有最长公共 边的多边形中: 执行菜单命令[选择]>>[通过属性选择],查询”Area”Masking Tools->Intersecting Layer Masks,为注记创建模版,模版的大小用参数Margin来决定 3).右键点击数据框,在环境菜单中选择高级绘制选项(Advanced Drawing Options),用注记的模版图层去遮盖线图层,确定 23.同一图层使用Clip实现图斑的无缝拼接 当一个图斑的边界确定,需要实现两个图斑的无缝拼接时,可以把图斑拉伸覆盖确定边界的图斑的一部分,然后用下面的图斑剪区上面的图斑。 方法二:图斑之间有小的缝隙,可以先在缝隙上任意补画一个图斑,然后合并(merge)图斑,最后再剪切(Clip)即可得到无缝的图斑。 如下图所示: 24.利用两个相交图斑创建新图斑。 两个图斑都选中然后 Eidtor 工具条intersect,此方法原图斑不会被接切。 25.属性表中选择集与非选择集的切换 Options/switch selection 26.快速把选择的要素另存为一个图层并加载进来。 先选责需要另存图层的要素(直接选择或者属性表),然后在图层上右键Selection/create Layer From Selected Features。 (以前都是直接export竟然没有发现) 27.利用Hyperlinks丰富数据库,为其添加超链接。 单击rowse工具栏中Identify按钮。 单击地图中一个要素,在Identify Results窗口右击需要设置超链接的要素,然后点击Add Hyperlink菜单。若要将一个Web页加为超链接,单击项,并输入URL。要链接到一个文档,单击Link to a Document,并输入文档路径名。 单击Tools工具栏中的Hyperlink工具,并单击图上某一个要素即可实现。 使用一个属性字段作为超链 在内容表中右击包含一个超链接字段的图层,然后点击properties ,单击Display选项。选中Supprt Hyper3. Hyperlinks using field选项,单击下拉箭头并点击一个字段。 单击Document or URL。单击OK,单击Tools中的Hyperlink按钮,将鼠标指移到一要素上并单击以显示其超链接。 28.Arcmap中的SQL语言 当查询ArcInfo coverages, shape文件, INFO表以及dBASE表时,SQL表达式中的字段名必须用双引号扩起。如:“AREA”,如果查询的是个人地理数据库数据,则需要将字段名包含在方括号内,如:[AREA],如果查询的是ArcSDE地理数据库数据或是ArcIMS要素类或ArcIMS影象服务子层中的数据,则不需要将字段名括起,如:AREA 有些运算符和关键字也可能有所变化。 在查询表达式中,字符串必须加单引号,例如: [STATE_NAME]=‘California’ 除个人地理数据库要素类和表之外,查询表达式中的字符串是区分字母大小写的。如果搜索不需要区分大小写,可以使用SQL函数将所有的值都转换成大写或者小写。对于基于文件的数据源,例如shape文件或coverages,既可以使用UPPER函数,也可以使用LOWER函数。 例如下面这个查询将选出那些姓名的最后为Jones或JONES的顾客。 UPPER("LAST_NAME") = 'JONES' 可以用LIKE运算符(不是 = 运算符)与通配符一起构建部分字符串查询。 例如,表达式 [STATE_NAME] LIKE 'Miss*'将在美国州名中选择Mississippi和Missouri。 *表示多个字符。 还比如,查询表达式 [OWNER_NAME] LIKE '?atherine smith' 将找出Catherine Smith和Katherine Smith。 ?表示单个字符。通配符的使用依赖于不同的数据库。例子中使用的通配符只适用于个人地理数据库。 可以使用NULL关键字来选择那些在指定字段中值为NULL的要素和记录。通常,NULL关键字的前面总有IS或IS NOT。 29.Select by location小结 按位置查找要素的方法 使用按位置选择(Select By Location) 对话框,可以根据要素间的相对空间位置进行查找。可以使用多种方法,查找在同一图层中或不同图层间相互邻近或叠置的点、线、多边形等要素。 被…跨越边界(Are crossed by the outline of) 利用这种方法,选择被另一图层要素覆盖的某个图层上的要素。例如,搜索道路跨越的荒地,得到的结果是道路跨越其边界的所有荒地。 相交(Intersect) 与Are crossed by the outline of类似,但是该方法可以选择与参照要素接连的要素。例如,选择与道路相交的荒地,选择的结果将包括该道路在其边界范围之内或在其边界之上的所有荒地。 在…距离范围内(Are within a distance of) 这一方法将选择同一图层或不同图层上相邻或邻近的要素。例如,现有一个包括清洁井和污染井的图层,使用该方法可以找出距离污染井500米范围内的所有清洁井。同样,也可以找出距离污染井500米范围内其他图层上的水库和农田。还可以用该选项选择与其他要素相毗邻的要素。例如,假如用户已选定了公司可能购买的地块,现在想获取邻近地块的信息。这种情况下,利用该选项选择选中地块零距离范围内的所有地块即可。 中心在…里(Have their center in) 这种方法选择某一图层上的要素,其中心点落在另一图层要素中。 完全在…内(Are completely within) 这种方法选择完全落在另一图层多边形内部的某一图层上的要素,例如,选择林区里面的湖泊。通过指定一个缓冲距离,可以选择落于多边形内部并距离多边形边界一定范围内的所有要素。例如,选择林区内部500米范围内的湖泊。 完全包含(Completely contain) 这种方法选择某一图层上完全包含另一图层上的要素的多边形。例如,选择内部包含湖泊的林区。通过指定一个缓冲距离,可以选择在其内部一定范围内包含要素的多边形。例如,对湖泊做缓冲区,可以选择距离湖泊500米范围内的林区。 与…有公共线段(Share a line segment with) 这种方法选择那些与其他要素具有公共线段、顶点或节点的要素。 与…等同(Are identical to) 这种方法选择与另一图层中某一要素具有同样几何形状的所有要素。这时,要素类型必须相同。举个例子:必须用多边形选择多边形,用线段选择线段,用点选择点。 包含(Contain) 这种方法选择某一图层中包含另一图层中要素的要素。这种方法与完全包含(Completely contain)方法的区别在于:要素间的边界可以接触。例如,使用包含(Contain)方法,即使湖泊的边界和包含该湖泊的森林的边界接触,森林也会被选中。但是在用完全包含(Completely contain)方法时,森林是不会选中的。 包含于(Are Contained by) 这种方法选择某一图层中被另一图层中要素包含的要素。例如,选择被乡村包围的城市。这种方法和完全包含于(Are completely within)方法的区别在于,要素的边界可以接触。 与…接触(Touch the boundary of) 如果使用包含线的图层来选择要素,则该方法将选择那些与此图层里的线有公共线段,顶点或端点(节点)的线和多边形要素。如果跨越了线,则这些线和多边形将不会被选中。 如果使用包含多边形的图层来选择要素,则该方法将选择那些与此图层里的多边形边界有公共线段或顶点的线和多边形要素。如果跨越了多边形边界,则这些线和多边形将不会被选中。 31. 将选中的要素放大至整个窗口 在内容表中右击包含选中要素的图层,单击Selection菜单,并单击Zoom To Selected Features子菜单。 选中要素将放大至整个ArcMap窗口。 32.显示选中要素的属性 在内容表中右击选中要素所在图层,单击Open Attribute Table,单击Show Selected records。 窗口中显示出选中要素的属性记录。也可以打开属性表在select和all之间切换。 33. 通过单击要素添加文本 1). 在内容表中,右击需要添加标注的图层,单击Properties。 2). 单击Labels选项。 3). 单击Label Field下拉箭头,单击作为标注的字段。 4). 单击OK。 5). 单击Draw工具条上的Label按钮。 应该是只需单击下拉箭头选择Label按钮。 6). 单击Place label at position clicked。 如果选择了Automatically find best placement,ArcMap会自动的为标注寻找合适的位置。 7). 单击Choose a style,然后单击需要的标注样式。 8). 在需要标注的要素上单击鼠标,标注就添加上去了。 (先在Draw工具条下新建标注组方便管理,New Annotation Group) 34. 标注工具条和标注管理器 如果图层中有一些要素需要指定特殊的标注属性,需要在标注管理器中生成其它的标注类。 点击左侧面板上的一个图层,在右侧面板上为其添加一个新的标注类。 个人认为此方法虽然没有转为注记后的标注灵活,但却可以方便的实现自动相对智能化的标注,相比之下更省心,提高效率。 35. 在进行地图查询或编辑的时候为什么会总是选中所有的图层 诀窍在这里(虽然是一点点小问题,但当我第一次遇到这个问题时却花费了我不少时间,甚至于怀疑自己的数据有问题) 36.建立拓扑关系检查图斑 先根据需要在Catalog中建立相应的拓扑关系规则,然后在Arcmap中进行拓扑处理,辅助工具条Topolygon,下图所示为重叠图斑检查。(也可以在Arctoolbox下的Data Management tools/topology来做) 有关geodatabase的topology规则 多边形topology 1).must not overlay:单要素类,多边形要素相互不能重叠 2).must not have gaps:单要素类,连续连接的多边形区域中间不能有空白区(非数据区) 3).contains point:多边形+点,多边形要素类的每个要素的边界以内必须包含点层中至少一个点 4).boundary must be covered by:多边形+线,多边形层的边界与线层重叠(线层可以有非重叠的更多要素) 5).must be covered by feature class of:多边形+多边形,第一个多边形层必须被第二个完全覆盖(省与全国的关系) 6).must be covered by:多边形+多边形,第一个多边形层必须把第二个完全覆盖(全国与省的关系) 7).must not overlay with:多边形+多边形,两个多边形层的多边形不能存在一对相互覆盖的要素 8).must cover each other:多边形+多边形,两个多边形的要素必须完全重叠 9).area boundary must be covered by boundary of:多边形+多边形,第一个多边形的各要素必须为第二个的一个或几个多边形完全覆盖 10).must be properly inside polygons:点+多边形,点层的要素必须全部在多边形内 11).must be covered by boundary of:点+多边形,点必须在多边形的边界上 线topology 1).must not have dangle:线,不能有悬挂节点 2).must not have pseudo-node:线,不能有伪节点 3).must not overlay:线,不能有线重合(不同要素间) 4).must not self overlay:线,一个要素不能自覆盖 5).must not intersect:线,不能有线交叉(不同要素间) 6).must not self intersect:线,不能有线自交叉 7).must not intersect or touch interrior:线,不能有相交和重叠 8).must be single part:线,一个线要素只能由一个path组成 9).must not covered with:线+线,两层线不能重叠 10).must be covered by feature class of:线+线,两层线完全重叠 11).endpoint must be covered by:线+点,线层中的终点必须和点层的部分(或全部)点重合 12).must be covered by boundary of:线+多边形,线被多边形边界重叠 13).must be covered by endpoint of:点+线,点被线终点完全重合 14).point must be covered by line:点+线,点都在线上 Topology工具条及功能介绍: 37.给多个要素同一赋值 选中你需要同一赋值的是所有图斑,然后点击Atrributes,此时出现属性修改对话框,点击根目录是对所有要素同一赋值,点击下面的支目录则可以分别赋值。(也可以用字段计算器实现) 38.如何根据确定的点画出以他相应的点 例如:我在地图上已经指导了一个一直点,而其他的点在地图上都是以他为中心画出来的。学校  SE60度,140米  意思是学校在中心点南偏东60度,距离是140米,这样的点在arcmap中怎么加呢?我的方法有二分别如下。 1). 确定已有一个点图层,其中有学校,然后: 对该图层开始编辑 选择工具栏editor---direction-distance tool 以中心点为中心,先画角度线(arcmap左下角会有角度提示),再画距离/半径(注:画的过程中点击A键可以输入角度值,点击D键可以输入距离值) 确定,即可 如果找不到direction-distance tool 的同志请看下面 Direction-distance tool is here 第二种方法就是直接编写代码实现 下面是一段示例的VBA代码(本段代码作者:GIS空间站 knight_sl) Option Explicit Dim dPoint(2, 1) As Double Sub aaa() Call bbb Dim aa As IMxDocument Set aa = ThisDocument Dim pFLyr As IFeatureLayer Set pFLyr = aa.FocusMap.Layer(0) Dim pFCsr As IFeatureCursor Dim pFt As IFeature Set pFCsr = pFLyr.FeatureClass.Update(Nothing, False) Set pFt = pFCsr.NextFeature Dim pPoint As IPoint Set pPoint = pFt.ShapeCopy Dim pNewPoint As IPoint Dim X0 As Double, Y0 As Double Dim X As Double, Y As Double Dim dAngle As Double Dim i As Long For i = 0 To UBound(dPoint, 1) Set pFt = pFLyr.FeatureClass.CreateFeature Set pNewPoint = New Point dAngle = dPoint(i, 0) * 3.14159263579893 / 180 pNewPoint.X = dPoint(i, 1) * Cos(dAngle) + pPoint.X pNewPoint.Y = dPoint(i, 1) * Sin(dAngle) + pPoint.Y Set pFt.Shape = pNewPoint pFt.Store Next Set pFLyr = Nothing Set pFCsr = Nothing Set pFt = Nothing Set pPoint = Nothing Set pNewPoint = Nothing End Sub Sub bbb() '定义新加三个点的角度和距离 dPoint(0, 0) = 10 dPoint(0, 1) = 150 dPoint(1, 0) = 30 dPoint(1, 1) = 170 dPoint(2, 0) = 120 dPoint(2, 1) = 200 End Sub 这中方法做起来需要一点编程经验,但是比上面那中一个一个的画的方法要先进多了,可以把所有的点录入同时画出来。 如果你不会VBA编程,请看下面: 这是ArcGIS VBA的程序,运行方法: 1),运行ArcMap,加载所需图层; 2),Tools菜单/Macros(宏)/Visual Basic Editor(VB编辑器),这样打开VB编辑器 3),双击打开VB编辑器左上工程资源管理器中的Project/ArcMap对象/ThisDocument,把上面的代码粘进去。注意看首行 Option Explicit如果有两行,就删除一行。 4),点击VB编辑器工具栏的运行按钮运行(或菜单 运行/运行子过程),就可以了,再激活ArcMap可以看到发生了什么! 或者还有一种创建宏的方法(不过建议对ArcGIS VBA不大熟的同志不要用这种方法): 1),运行ArcMap,加载所需图层; 2),Tools菜单/Macros(宏)/Macros,这样打开宏编辑器 3),在宏名称中输入aaa,确定后,会打开VB编辑器,将看到有一个aaa的过程,没有实体。你把上面的aaa过程中的代码粘进去,然后在前面加上 Option Explicit(这个别重复了哈) Dim dPoint(2, 1) As Double 就可以。 4),点击VB编辑器工具栏的运行按钮运行(或菜单 运行/运行子过程),就可以了,再激活ArcMap可以看到发生了什么! 39.这里说道了工具的使用,那么就简单的再介绍下Sketch中的几个工具吧 Sketch construction tools的使用: Sketch tool:主要是用来创造线和面特征的节点,在你完成了草图之后,ArcMAP就会增加最后的线段,形成矢量图。 Arc tool:这个主要是帮你创造一个弧段的,选中这个工具后,先在弧段起点点一下,然后在弧段高度方向大致位置点一下(这个点是不可见的,只是给你确定弧段的高度),最后在弧段的终点点一下,就形成一条弧段了。 Direction-distance tool:这个主要是从已知某一个方向和某一个距离来确定一个点。首先点一个已知方向的点,这是会有一条线出来,你确定好方向后,再点已知距离的点,这是出来一个圆,确定距离后,直线和圆有交点,这就是你要的点,再上面点一下就ok! Distance-distance tool:这个和上面的一样的道理,只是它都用距离来确定一个点,也就是两个圆确定你要的点。 Endpoint arc tool:这也是创造弧段用的,与Arc tool 工具不同的是,它是先在弧段的起点点一下,然后在弧段的终点点一下,再点一个点确定弧段的半径。个人认为这个工具要比Arc tool工具更精确些。 Intersection tool:就是利用两条直线确定一个点。很简单一用就会! Midpoint tool:确定中点的工具,比如马路的中点,你可以先点一边,再点马路另一边,这时马路的中点自动出现了。 (画道路中线太可以试试,不过得是直线道路咯,^_^) Tangent tool:相切弧段工具,它能够在一条线段上画出一条切线,只有你用其他工具画了线段出来时你才可以用这个工具。 Trace tool: 主要是用来在跟踪已存在的特征,比如一栋房子,你要沿房子外围画一条线(比如围墙),那么你使用这个工具就非常方便,首先开始时你必须按O键,设置下跟踪的间距,如100,其中还有三个角点的方式:mitered是直角 bevelled 是钝角rounded是圆角。(感觉那效果有点像CAD的偏移咯) 40.如何标注多个字段的属性及分子式标注 Propertis/label field /expression 实例:""& [单位名称] &"" & VbCrLf & " " & [PARCEL_NO] 输出分数线 VbCrLf 换行 效果图: 引用GIS空间站 兔八哥文章详解 以前用ArcGIS Label一般也就在图层的Properties里面定义一下Label字体大小和粗细。这两天遇到一个问题,需要在Label中显示多个字段的内容,比如BlockName和CompanyName。其实这个本来不是很难的问题,因为Label中支持VBScript,使用[BlockName] & VbNewLine & [CompanyName]。就可以实现标注中第一行显示BlockName,第二行显示CompanyName. 现在问题出来了,出图时候希望突出BlockName效果,希望加粗显示,而CompanyName使用一般字体。考虑了很长时间终于从ArcGIS帮助中找到了相关的内容,原来Label的VBScript里面支持类似于Html的VBScript标签,比如加粗就是用,上面问题就可以使用下面语句解决: "" & [BlockName] & "" & VbNewLine & [CompanyName] 除了加粗,ArcGIS中还支持下面的文本格式标签: Font: "" & [LABELFIELD] & "" Color: "" & [LABELFIELD] & "" "" & [LABELFIELD] & "" Bold: "" & [LABELFIELD] & "" Italic: "" & [LABELFIELD] & "" Underline: "" & [LABELFIELD] & "" All caps: "" & [LABELFIELD] & "" Small caps: "" & [LABELFIELD] & "" Superscript "" & [LABELFIELD] & "" Subscript: "" & [LABELFIELD] & "" Character spacing (%): "" & [LABELFIELD] & "" Word spacing (%): "" & [LABELFIELD] & "" Leading (pts): "" & [LABELFIELD] & " nFZLength Then For i=0 To (nFMLength-nFZLength)/2 strLeftSpace =strLeftSpace +chr(32) strRightSpace =strRightSpace + chr(32) Next End If FindLabel = "" &strLeftSpace; & [OBJECTID]&strRightSpace;& ""&chr;(13)&chr;(10)& [SHAPE_Area] End Function 41.用点构面 ArcToolBox->Samples->Data Management->Features->Create Features From Text File 点组成面,最重要的是点序的排列,因此对数据的组织有一定的要求。 42.几个常用的VBA代码 在ARCGIS属性表中增加需要的字段,并自动赋值 使用方法 1打开属性表,选择计算的字段,右点选择Calculate Values;2.选择“是”,进入Field Calculator; 2选择Advance选项; 3 在Pre-Logic VBA Script Code编辑框中输入VBA代码; 4在下面编辑框中输入赋值部分. 1--点坐标X VBA部分: Dim pGeo As IGeometry Set pGeo = [Shape] Dim pPoint As IPoint Set pPoint = pGeo 赋值部分: pPoint.X 2--点坐标Y VBA部分: 同上 赋值部分: pPoint.Y 坐标值为文件存储的固有值,和是否使用On the Fly坐标表示无关。返回当前显示的坐标值参看8,9 3--多边形周长 VBA部分: Dim pGeo As IGeometry Set pGeo = [Shape] Dim pPolygon As IPolygon Set pPolygon = pGeo 赋值部分: pPolygon.Length 4--多边形面积 VBA部分: Dim pGeo As IGeometry Set pGeo = [Shape] Dim pPolygon As IPolygon Set pPolygon = pGeo Dim pArea As IArea Set pArea = pPolygon 赋值部分: pArea.Area 5--多边形重心X VBA部分: Dim pGeo As IGeometry Set pGeo = [Shape] Dim pPolygon As IPolygon Set pPolygon = pGeo Dim pArea As IArea Set pArea = pPolygon Dim pPoint As IPoint Set pPoint = pArea.Centroid 赋值部分: pPoint.X 6--多边形重心Y VBA部分: 同上 赋值部分: pPoint.Y 7--Polyline长度 VBA部分: Dim pGeo As IGeometry Set pGeo = [Shape] Dim pPolyline As IPolyline Set pPolyline = pGeo Dim pCurve As IPolycurve Set pCurve = pPolyline 赋值部分: pCurve.Length 8--表示点坐标X VBA部分: Dim pDoc As IMxDocument Set pDoc = ThisDocument Dim pSpRef As ISpatialReference Set pSpRef = pDoc.FocusMap.SpatialReference Dim pClone As IClone Set pClone = [Shape] Dim pGeo As IGeometry Set pGeo = pClone.Clone Dim pPoint as IPoint Set pPoint = pGeo pGeo.Project pSpRef 赋值部分: pPoint.X 9--表示点坐标Y VBA部分: 同上 赋值部分: pPoint.Y 坐标值为On the Fly显示的坐标,不是文件存储的固有坐标 10--连续编号 VBA部分: Static lCount as long lCount=lCount+1 赋值部分: lCount (从1开始) lCount-1 (从0开始) 计算面的中点 Dim Output As Double Dim pArea As IArea Set pArea = [Shape] Output = pArea.Centroid.X(或y) 当然这是很老的方法了,现在arcgis9.2以后都不需要用VBA啦,右键属性表字段然后直接选择 Caculate Geometry就可以实现比如面积计算,X,Y坐标等的属性赋值了咯。 43. 在同一图层如何对同一要素的不同部分以不同的符号表示 (注:要实现这种渲染需要两段具有不同的属性) 44.自己做arcMAP的图例 在Symbol property Editor中进行制作了 1)、先在Style Manager中的左侧列表中,选择相应的Style文件,ArcGIS默认的符号库文件是ESRI.Style文件,当然也给出了C:\Documents and Settings\........................................目录下用于用户自定义的Style文件 2)、展开Style文件,选择要创建Symbol的类型,如:Fill Symbol(面填充)、Line Symbol(线)、Marker Symbol(点) 然后在右侧的列表中鼠标右键->New 3)、在弹出的Symbol Property Editor窗体中,进一步选择Marker Symbol的类型,如:Simple Marker Symbol、Picture Marker Symbol等等 4)、这个时候就要根据需要开始设计符号的各种属性了,由于不同种类的Marker Symbol有不同的属性,因此,属性也会不尽相同。 5)、另外介绍一个经常需要或比较使用的步骤,我们需要设计的符号可以由ESRI提供的现有符号组合而成,那么我们则需要添加2个Symbol Layer,然后进行2个Symbol Layer的叠加 6)、分别设置上述2个Symbol Layer的中的Symbol的属性,之后确认保存,这样会在Style Manager中看到我们新制作的符号 如图: (注:以上内容转载自ESRI社区 gis27) 45.计算属性中相同的字段个数 选择要计算的字段然后右键选择Summarize根据相应的要求设置参数即可实现。功能示意如下图: 46.自动提取面的中点并加点 Arctoolbox->Feature-> Feature to Point 47.合并属性相同的相邻图斑 使用Dissolve 当选择了create multipart feature时,所有具有相同属性的图斑将链接在一起做为一个图斑。 48.提取图斑转折点坐标 如果没有伪节点那么,选中一个线或者面,打开sketch Properties,就可以看到节点坐标。 还有一种方法就是:通过toolbox-datamanagement-feature-FeatureVerticesToPoints得到转折点的图层然后Add XY Coordinates,该点图层的属性表中就包含了X,Y字段,将其导出,就得到转折点坐标了。 ArcMap中设置.mxd相对路径 复制拷贝地图文档后再次打开会遇到图层前一个!的标识符号,是因为加载图层的相对路径变化了,需要重新指定图层位置。对此将.mxd文档设置为相对路径起到作用,具体做法如下: (1)File-->Document Properties-->打开对话框中,点击Data Source Options...按钮; (2)选中store relative path names to data sources单选框,并勾选Make relative paths the defalut of...前的复选框。 以上两步操作即可。 在dissolve时,出现 ERROR 000354: The name contains invalid characters Failed to execute (Dissolve). End Time: Thu Mar 24 09:32:47 2011 (Elapsed Time: 0.00 seconds) output文件包括无效字符如中划线等 Geometry First [Editor's note: I was having trouble last week dissolving a shapefile based on a common attribute. I kept getting the following error: "Invalid Topology [INCOMPLETE_VOID_POLY]“. Not entirely helpful! A little Google searching turned up the following tip from ESRI.] Republished from ESRI. Problem: Some Overlay Tools, such as Intersect, return unexpected results or fail Description Results do not look correct or operations fail with strange errors such as: “Invalid Topology [INCOMPLETE_VOID_POLY]“. If this type of error has occurred, it is most likely to occur when using one of the following: Clip, Erase, Identity, Intersect, Symmetrical Difference, Union, Update, Split Featureclass to Coverage, Dissolve, Feature to Line, Feature To Polygon, Integrate, or ValidateTopology. Cause It is possible that tool outputs may be strange or incorrect because one or more features in the input feature class have geometry problems. Some examples of geometry problems are: • short segments • null geometry • incorrect ring ordering • incorrect segment orientation • unclosed rings • self-intersections or empty parts Solution or Workaround If such errors occur or the output looks incorrect, the first step in assessing the situation is to run the ArcToolbox tool Data Management Tools > Features > Check Geometry. -show me This tool provides a list of the invalid features in the feature class and a short description of the problem. Features with problems can be fixed in one of two ways: Editing the feature class with the geometry problem, and fixing each individual problem identified. Some of these problems, like non-simple geometry, can be fixed by double-clicking the feature in the editor and saving the edits. Running the ArcToolBox tool Data Management Tools > Features > Repair Geometry on the feature class containing the problem features 昨天检查一区属性发现一区图层的面积属性shape_area竟然出现了负值,想必是数据转换的时候出现问题。今天在论坛求证了一下,感谢各位的解答。 ArcGIS默认顺时针图形为正,手工画polygon的时候不管怎么画结果都是顺时针的。所以一般负值的出现是转换过程出现问题,polygon是由ring组成的,ring则是有更小的segement(line,circularArc,ellipticalArc,beziercurve)构成,所具有方向性。 解决方法是用ArcTool中的check geometry和 repair geometry工具,上述的检查结果是Incorrect ring ordering。repair后会自动修复错误,已解决。 此外,repair工具只能修复以下五种错误: Null geometry—The feature will be deleted from the feature class. Short segment—The geometry's short segment will be deleted. Incorrect ring ordering—The geometry will be updated to have correct ring ordering. Incorrect segment orientation—The geometry will be updated to have correct segment orientation. Self intersections—The geometry's segments that intersect will be split at their intersection. Unclosed rings—The unclosed rings will be closed. Empty parts—The parts that are null or empty will be deleted. 更多的错误修复参照帮助中的 How to salvage a corrupt shapefile

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值