当只有线文件和面文件时,这里提供一条思路 将面文件转化为线文件;(Data Management Tools -- Features -- Feature To Line); 将两个线文件一并转化为面文件;(Data Management Tools -- Features -- Feature To Polygon) 根据实际情况调整属性表即可!
ArcGIS 笔记1 前言:此部分是在实际操作该软件时遇到的一些问题和解决方法。大部分解决方法是通过网络搜索得到,而且为了省时、省事就直接通过截屏的方式进行记录了。 l 提取栅格单元值到点 l 根据属性值提取栅格像元 l 选中线经过的面状要素(选中之后可以提取) 实际上这用到了一个按照位置选择的知识,选择可以分为两种,一种是按照属性值进行选择,一种是按照位置信息进行选择,这两种方法都不要忘了,一定要熟记在心。按照位置进行选择是GIS(地理信息系统的一个特色)。 l ARCGIS 中按照某字段属性批量导出shp(矢量) Q:如何通过某字段属性批量导出各个字段对应的shp文件?比如现有一副国家的的行政区划图,想要提取各个省份的shp文件。 A:解决该问题,可以通过Analysis Tools——Extract——Split工具实现。在“Input Features”和“Split Features”中都选择需要分割的行政区划图,相当于用自己切割自己。在“Split Field”中选择具有唯一标识的字段,例如省级行政区名、行政区代码名等,要求这个字段的属性为字符串,它将作为生成的shp文件的文件名。然后在目标工作空间“Target Workspace”设置输出路径即可。 l ARCGIS 中按照某字段属性批量导出栅格(栅格) 根据某个属性字段把栅格数据导出的方法 l ArcGIS 连接两个矢量文件属性 l ArcGIS 生成面数据多边形的中心点数据 Creates a feature class containing points generated from the representative locations of input features. l 将栅格Nodata的数值赋值为0 l 改变栅格分辨率几种不同的方法 l 把矢量图层按照属性表拆分成独立的图层 l 把多个矢量图层合并为一个 (Union) l 多个矢量图层融合 l 根据属性把矢量图层要素融合 l 批量删除属性表字段 l 栅格计算器的条件函数 Con(范围DEM.tif 600,范围DEM.tif / 600,Con(范围DEM.tif 1600,1,1600 / 范围DEM.tif)) Float(Con(范围DEM.tif 650,范围DEM.tif / 650,Con(范围DEM.tif 1550,1,1550 / 范围DEM.tif))) Float(Con(1990.tif=1,0.3,Con(1990.tif=2,0.6,Con(1990.tif=3,0.1,Con(1990.tif=4,0.9,Con(1990.tif=5,1,0.2)))))) l 把土地利用数据的栅格单元赋值成小数的解决方法 l 矢量面转栅格失败的原因(我遇到了) l 浮点型栅格根据属性提取像元值 l 提取矢量面的边界 l 怎么利用一个面图层分割另一个面图层? 问题描述: 杨凌区是咸阳市的一部分,我怎么把整个咸阳市分割成杨凌区和咸阳市非杨凌区两个部分 下图是咸阳市的一个面状要素 解决办法: 方法一:利用Identity工具 处理结果: 方法二:利用Union工具 效果一样 l 怎么处理面与面之间的空隙? 比如下图这样的: 研究的解决方案是: 第一步:矢量编辑该图层 第二步:把新添加的矢量要素的某个属性和要划归的矢量要素的属性保持一致。 第三部:按照该属性字段进行融合。 第四:处理结果:
一、如果这个面是在单独的一个图层中: 1.菜单selection-select by location 2.select features from 里勾选要选择的要素所在图层 3.选择关系:intersect(相交) 4.the features in this layer里选择面图层 二、如果想手动画个面来选择要素: 1.editor工具栏-start editing 2.task下拉列表里选select features using an area 3.用铅笔(sketch tool)画面选择要素
备忘 :Shapefile 属性表中的中文显示乱码如何处理 问题:shapefile 的属性表中,中文字符显示为乱码。 原因:字符编码方式不匹配。系统解读的编码方式和文件实际存储的编码方式不匹配,无法正常显示。“ Before ArcGIS 10.2.1, shapefiles were encoded in the languagelocale of the system on which the shapefile was created. As of version 10.2.1,shapefiles are always encoded in UTF-8, which presents a problem on systemsthat use languages with multibyte character encodings, such as Chinese,Japanese or Russian. ” 解决: 1 、打补丁,参考esri 的文档下载补丁,目前只有10.2.1 和10.2.2 的补丁。原理是修改注册表,更改编码方式。更高版本似乎没有补丁。 2 、手动修改注册表,更改默认编码方式;所有的文件以后都以相同的指定默认编码方式打开。自己修改注册表,又一定风险。 3 、为特定shapefile 指定编码方式,创建一个与*shp 同名的*.cpg 文件用于存储编码方式信息,用记事本编辑,写入需要使用的编码方式,如OEM ,UTF-8 ,……。好处在于可以针对不同的中文编码方式。 参考资料: a 、http://www.faceye.net/search/101949.html b 、http://support.esri.com/en/knowledgebase/techarticles/detail/21106
Summary 栅格数据怎样可以得到逐点的经纬度信息,并分别将经度、纬度坐标以二维矩阵形式(影像)输出? 已知 mask.tif 文件已投影为 WGS_1984_UTM_zone_50N ,行列分别是 411 、 452 ,空间分辨率 1000m 。 Steps - Convert a raster of the study area to point. 打开 ArcToolBox , Conversion--From Raster--Raster to Point ,处理结果返回 points.shp 。 - Create two fields (floating or double) to store x and y. 右键 points , Open Attribute Table ,在属性表中添加 2 个域,分别列出经度、纬度,如 Fig. 1 。 Fig. 1 - Calculate geometry (longitude for x, latitude for y) 在属性名称上右键选择 Calculate Geometry ... ,经度对应 x ,纬度对应 y ,注意单位选择 Decimal Degrees ,如 Fig. 2 ,计算结果将会存储在属性表中。 Fig. 2 - Convert to raster using x field (longitude raster) 打开 ArcToolBox , Conversion--To Raster--Point to Raster ,参数配置如 Fig.3 ,像元参数设置与 mask.tif 一致。 Fig. 3 输出纬度矩阵与 mask.tif 空间信息完全一致,如 Fig. 4 。 Fig. 4 LatLong.rar References Is there any tool that can generate raster longitude and latitude in Arcgis? Answered by José Ignacio álvarez Francoso. Specifying the precision and scale allows you to restrict the range of values and number formats a field can accept, giving you greater control . For example, if you specify a float with a precision of 4 and a scale of 2, the field will accept 12.34. If you try to enter 12.345 into the field, an error message would display, as this exceeds the maximum number of digits and decimal places allowed. On the other hand, if you specify a float with a precision of 5 and a scale of 3, the field would let you enter 12.345.
ArcGIS10:ArcGIS version not specified. You must call RuntimeManager.Bind before creating any ArcGIS 今天将ArcGIS系列的软件从ArcGIS9.3.1升级到ArcGIS10,然后就使用VS创建一个简单的AE应用程序,然后拖放一个toolbar、LicenseControl以及MapControl控件。 接着编译应用程序,编译成功。 点击运行时,出现如下错误: ArcGIS version not specified. You must call RuntimeManager.Bind before creating any ArcGIS components. 问题解决方案: 在program.cs中添加如下代码 ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode. EngineOrDesktop ); (注意,这里的代码不是 ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode. Engine );一定要有OrDesktop) 这里还需要添加一个Reference:ESRI.ArcGIS.Version(这步个人没做,不清楚什么意思) 完整的参考代码如下所示: using System; using System.Collections.Generic; using System.Windows.Forms; namespace WindowsFormsApplication1 { static class Program { /// summary /// The main entry point for the application. /// /summary static void Main() { ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
Arcgis desktop command line: It will be easier to process Geodata with command line in desktop than batch command in arctoolbox. Show this is a brief summary about command line from the desktop help. Where is command line: It is just in on the main tools bar of arcmap, arccatalogue and arcscene (main components of desktop) Composition of command line interface: The above textbox is area to input command, and the one below is place to show the result. Where to get the command: You can firstly know the command you need, and have a look at the command directive in the help of arctoolbox. Eg , you want to clip several input polygon shp with a study area shp, so ,you know the command is clip maybe, then find the clip from analysis of arctoolbox, and go to the help, where you can find the format of command, clip_analysis, the real name of shp clip. How to set up the workspace: Input in the command workspace followed the pathway of your workspace is used to set up the workspace, eg: Workspace c:\test How to get the hint of the command 1 usage command You can input ‘ usage clip_analysis’ and press enter to get the composition of a clip command, the syntax of clip_snalysis will appear in the result textbox below command line textbox. 2 when you input clip_analysis, and press space immediately, there will be a hint appear above the command line textbox, which shows the parameters you need to input. How to input a command with several lines Normally, a command has 1 line, and pressing enter makes it executed. If you want to input several command and need then to be executed together, you can use the ctrl+enter in place of enter after finishing each command line. So the command you have just finished will be hanged and you could continue to input another command line, finishing all those command lines you need , a press of enter will execute all of them together. Command line parameters, necessary or optional In the command syntax, shows the necessary parameters, and {}shows the inside is not necessary but optional, while no input for optional parameter, the default values will be used, otherwise, a # or “”(two double quotes) will be of the same function. The pathway of parameter If you need to use pathway or files where there is a space, you have to put the full pathname a pair of quotes. Eg GetCount ‘e:\a b .gdb\a.shp’ Using wildcards The symbol of * is used as a wildcard in the command line, for example *means use every feature class R* use feature class begin with R *.shp use all the shp files *,feature class ,e.g. ‘*,line’ use any line feature . Feature class types frequently used in command line are point, label, node, line,arc, route, polygon, region. E.g. Clip_analysis *,line studyarea %inout%_clipped If the input files are road.shp, river.shp, plines.shp, so the output file will be road_clipped, river_clipped and plines_clipped. Another way to denote the output file is that adding the sequent number , thus the above command line could be change like that : Clip_analysis *,line studyarea %inout%_i% , i% represent the sequent number. Thus the output will be road_0, river_1, plines_2 Command line management: Right click in the command textbox, there will be several choice appear, load enables you to load command file you have well edited, and just press enter to execute all the commands. Also you can use copy, paste and save to realize the same function. If you have executed a command for a long time, it will disappear, if you want to use the same command and parameters again, you can use the ‘recall’ function in the result textbox, you can scroll the mouse to the command executed before in the result textbox and just right click on the command, choose recall, the command line will appear in the command line box ,what you need to do is pressing enter. Using variables When you are inputting parameter in a command line, you can right click the mouse and choose “insert variable” , you will be leaded to the interactive interface where you can choose the variable you need, or you can choose ”variable” , where you can customize and manage your own variables, which could be used for later and free you from tedious jobs.
关键词:ArcObject,ArcGIS,栅格像元值(遥感图像)读取,样带,Excel,Matlab。 遥感影像以缩微的形式记录地表特征,已被广泛应用于区域土地覆被变化等研究当中。每幅遥感数据都是一个数据矩阵,这与很多科学软件的数据格式有共同之处(如Matlab、Excel)。任何专业软件都有其突出的有点和明显的缺陷,一般的遥感处理软件(如ERDAS或ENVI)都是针对栅格数据的,或实现矢量数据的一般功能。所以,不同软件之间高精度数据迁移转换是日常科研当中的重要任务。本文以NDVI为例,基于ArcObject+VBA在ArcGIS环境中编写程序,生成NDVI样带数据序列,为日后在Matlab中进行数据分析调定基础。 背景:时间序列数据分析在地理学研究当中是一种常用的地理过程研究方法,GIS以其强大的能力能够有效处理空间问题,把GIS与时间序列分析方法相结合,根据其共性发展出一种空间序列分析方法。在空间序列方法中,以空间位置代表时间位置,而空间位置上的属性变量的表达方式与时间序列相一致。其实,空间序列方法有其地理学的传统名词样带。 需求分析:提取NDVI影像上的数据样带NDVI值,生成一维空间序列数据,使其能在EXCEL或Matlab中进行数据分析。 代码思路: 1)用线数据集Clip影像,生成样带数据,数据中只有线数据集覆盖下的范围融合NDVI值; 2)循环计算栅格影像各行数据,当像元值大于0时则记录该值,否则跳过。(AO的PixelBlock每128行跳过一次); 3)将记录好的数据保存在txt中。(Excel和Matlab支持文本数据导入。) 实现代码: ' Part 1: Define the temporary raster data. Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pRasterLy As IRasterLayer Dim pRaster As IRaster Dim pRasBandC As IRasterBandCollection Dim pRasterDS As IRasterDataset Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap ' Get the raster from the raster layer. Set pRasterLy = pMap.Layer(0) Set pRaster = pRasterLy.Raster ' Set the raster dataset to be the first band of the raster Set pRasBandC = pRaster Set pRasterDS = pRasBandC.Item(0).RasterDataset Dim pRasterCursor As IRasterCursor Dim pRaster1 As IRaster2 Set pRaster1 = pRasterDS.CreateDefaultRaster Set pRasterCursor = pRaster1.CreateCursorEx(Nothing) 'use IRasterEdit interface Dim pRasterEdit As IRasterEdit Set pRasterEdit = pRaster1 'loop through each pixel block in the raster. Dim pPB As IPixelBlock3 Dim PixelBlockWidth As Long, PixelBlockHeight As Long ' Dim pTLC As IPnt Dim pBandCol As IRasterBandCollection Set pBandCol = pRasterDS ''''''''''''''' Dim v As Double Dim i As Integer Dim j As Integer Dim length As Integer length = 0 Dim VAL1(2890) As Double '1990=2959 这里要实现计算样带中的非零值个数 '2000=2961 '2005=2890 Do Set pPB = pRasterCursor.PixelBlock For i = 0 To pPB.Width - 1 For j = 0 To pPB.Height - 1 v = pPB.GetVal(0, i, j) If v 0 Then 如果像元值不为零,则存入数据集中 VAL1(length) = v length = 1 + length End If Next j Next i Loop While pRasterCursor.Next = True MsgBox length ' Dim l As Integer l = length Open c:\ndvi05.txt For Output As #1 记入文本 For i = 0 To l - 1 Step 1 Print #1, , VAL1(i); Next i Close #1 ' End Sub 相关截图: 1)ArcGIS图示效果 2)Excel数据显示(其中一段) 3)Matlab中显示效果(整个数据样带) 原文于新浪博客 2010-10-21
NITF is abbrevation of National Imagery Transmission Format, whihc is a raster format standard defined by NITF Standards Technical Board. Geospatial analysts in different industries use NITF to store multiple types of data in a single file, including imagery, vectors, annotation, and complex metadata. The NITF format allows for storage and disseminaiton of imaginery and its associated metadata - or the detailed information about the location, context, context, and structure of the image - in a single file. NITF is essential to the interoperability of systems within and among many government organizations worldwde. Further, to ensure proper usage and implementation across systems and customers accessing the NITF data format, the Joint Interoperability Test Command (JITC) certifies systems implementing the NITF format for compliance with the standard. The NITF is the standard for formatting digital imagery and imagery-related products and exchanging them among members of the Intelligence Community (IC), the Department of Defence (DOD), and other departments and agencies of the United States Government as governed by Memoranda of Agreement (MOA) with those departments and agencies. The initial NITFS purpose was to standardize the imagery format and associated data being transmitted from/to secondary imagery dissemination (SIDS). Due to the growing NITFS acceptance, it is now being applied to imagery dissemination systems in general, not SIDS alone. The purpose of NITFS is to transmit a file composed of an image accompnied by subimages, symbols, labels, text, and other information that relate to the image. One of the main features of NITFS is that it allows several items of each data type to be included in one file, yet any data types may be omitted. The NITF file incorporates the CGM standard for graphic and accommodates user-selectable compression for images. The file is submitted to the Message Transfer Facility (MXF), which allows it to be transferred usiing any of a set of user-selectable protocols and media. The output is a message which, by conforming to the standards and their use, is compliant with NITFS.