txt转shp

合集下载

ARCgis如何实现shap,CAD,txt坐标文件之间的转换

ARCgis如何实现shap,CAD,txt坐标文件之间的转换

关于arcgis文件格式的转化text坐标文件转成CAD文件:如果你的txt文档记录的坐标文件格式如下:点号1,X1坐标,Y1坐标,高程1点号1,X2坐标,Y2坐标,高程2点号n,Xn坐标,Yn坐标,高程n1.请将txt文档记录的坐标导入到EXCEL中,步骤如下:EXCEL程序中,[文件]-〉[打开],打开对话框的文件类型下拉列表中选择“所有文件”,选中你的坐标数据.TXT文件后单击[打开],在向导对话框中的“分隔符号”选择[逗号]后,单击[下一步]按钮直到[完成]按钮,就把你的坐标数据导入了EXCEL里啦。

2.修改EXCEL各列数据的顺序如下:[第一列:点号] [第二列:空列] [第三列:Y坐标值}] [第四列:X坐标值],第五列:高程值]3.[文件]-〉[另存为...]-〉另存为对话框中,文件类型下拉列表中选择“CSV(逗号分隔符)*.csv”格式,单击[保存]后,退出EXCEL。

4.将保存的“坐标数据.CSV”的文件扩展名改为“坐标数据.dat”,这个文件就可以在CASS中展绘坐标点了。

如何text文件转成shap文件工作过程中,如果获得了一批点坐标信息(如通过GPS获得的点位坐标),如何将这些坐标信息直接转换成Arcmap下面的点呢?或者说就是把这些点坐标直接转换成线或面呢?需要用到Add XY Data…工具,下面是具体的方法:1,将数据导入到Excel里面,总共有两列X,Y(列名可以随便取,但必须有列名),下面对应x,y坐标数据即可;2,将文件保存成.xls或者dbf文件。

(1)ArcMAP下面,菜单tools-Add XY Data(2)这时会形成一个新图层,所有的点都添加进来了,但现在添加进来的点由于没有objectID或者FID,现在图层不具备.shp图层的大部分功能,如点的选择,编辑,关联,属性等操作(3)在刚才生成的图层上点右键,选data-expot data…,导出成.shp文件。

CAD2007_Express使用说明

CAD2007_Express使用说明

Express Tools 中文使用说明目录前言 (1)Blocks(图块工具) (1)Text(文字工具) (2)Layout tools(布局工具) (4)Dimension(标注工具) (5)Selection tools(选择工具) (6)Modify(修改工具) (7)Draw(绘图工具) (8)File tools(文件工具) (9)Web tools(Web工具) (10)Tools(定制工具) (11)Command Line Only(指令行指令) (13)2007版被Express Tools移除而官方正式支持的指令 (15)其它指令 (19)Bloc Blocks(图块工具)[List Xref/Block Properties]指令:XLIST功能:列示图块性质说明:查询图块或外部参考中包含的对象的性质批注:查询图块中所选取单一对象的性质(图层、颜色、线型)。

[Copy Nested Objects]指令:NCOPY功能:复制巢状对象说明:复制图块和外部参考中的巢状对象批注:可以在不分解图块的情况下复制图块里的单一对象。

[Trim to Nested Objects]指令:BTRIM功能:用图块物件修剪说明:用图块或外部参考中的巢状对象作为边界修剪批注:2002以后已经直接可用图块对象作为边界修剪,是无用的指令。

[Extend to Nested Objects]指令:BEXTEND功能:延伸至图块对象说明:延伸至图块或外部参考中的巢状对象批注:2002以后已经直接可把线延伸至图块对象,是无用的指令。

[Explode Attributes to Text]指令:BURST功能:分解属性成为文字说明:分解图块并将属性转换为文字批注:平常分解有属性的图块时,属性的文字都会还原成卷标文字,用BURST后可把图块分解,而属性文字不会还原,且其性质会成为一般文字。

[Convert Shape to Block]指令:SHP2BLK功能:造型转图块说明:将SHAPE指令插入的造型转换成图块批注:可将性质为造型(SHAPE)的对象转换成图块(造型可用Express里的MKSHAPE建立,并以指令SHAPE插入造型对象),此选项在Modify(修改工具)亦可选取。

ArcGIS10.2 学习课程——3.数据转换

ArcGIS10.2 学习课程——3.数据转换
另一种,比较可靠的转Mapinfo公开格式MIF,点、 线、面都比较好,注记会转一个text层,是线, 后面同上
中国信息化高级技术培训中心欢迎你
Page 19
ArcGIS到MapGIS
注记可通过MIF做中间格式
中国信息化高级技术培训中心欢迎你
Page 20
问题解决
mapgis转shp,有属性丢失?
Page 33
3.3 CAD导入ArcGIS
1)直接加载CAD,右键:数据->导出数据 2)快速导入工具
中国信息化高级技术培训中心欢迎你
Page 34
直接加载CAD,右键:数据->导出数据
矢量:数据->导出数据
中国信息化高级技术培训中心欢迎你
Page 35
直接加载CAD,右键:数据->导出数据
中国信息化高级技术培训中心欢迎你
1、mapgis->mif->ArcGIS
2、图件和属性数据分别转,要转换的mapGIS文件 的属性用mapGIS软件中的“属性库管理”功能模 块导出成“*.dbf”格式;
Page 21
转换模型
中国信息化高级技术培训中心欢迎你
Page 22
批量转换
中国信息化高级技术培训中心欢迎你
中国信息化高级技术培训中心欢迎你
Page 28
注意事项一
1、安装需要单独安装
中国信息化高级技术培训中心欢迎你
Page 29
注意事项二 扩展模板,必须选择上
中国信息化高级技术培训中心欢迎你
Page 30
注意事项三
中国信息化高级技术培训中心欢迎你
注意转换,目录一定不好有汉字,目录中不要有空 格
图层名不要使用汉字

Dwg 图转换为Shp 图操作流程

Dwg 图转换为Shp 图操作流程
8.保存图形。
说明:
以上的接边工作(3-5)也可以使用下面的方式来处理:
3.将所有需要接边的单幅DWG文件加载到CADMAP中。
4.对每一单幅,使其激活为当前编辑文件,使用 CTRL+A 命令选择所有的对象,点击复制命令,然后使用All.DWG激活为当前编辑图形,在图形中点击右键,选择"粘贴到原坐标"命令,将单幅图复制到All.Dwg中;
Visual Foxpro 6.0
(要安装的软件还真多呀!)
以下将分步讲解,懒得截图了,大家就将就看吧。
一、CAD 图处理
1.新建"A_完成编辑的DWG"文件夹;
2.打开待处理的DWG文件;
3.删除多余对象,如填充线,图廓外信息等;
4.编辑文本。将分散的文本集合成一个对象,如:"文" "明" "路" 三个对象合为 "文明路" 一个对象,将多余的两个注记文本删除;
2.用 ArcToolBox >> Clean 工具将 All_cov 处理为 Polygon Coverage文件格式: All_Cov_Clean;
七、转换为Shp 文件(面)
1.新建"F_ArcView 输出Top 后的Shp" 文件夹;
2.用ArcView 打开 All_Cov_Clean ,然后用 Convert to Shapefile 将其转换为 All_poly.shp 文件,并保存到"F_ArcView 输出Top 后的Shp" 文件夹中,关闭ArcView;
如果您找不到 ArcView 3.3 或 Arcgis Workstation 8.3 ,也可以使用ArcGis 9 来完成。时间有限,懒是配图,大家有兴趣的就将就看吧。使用ArcView 3.3 主要是考虑到软件体积比Arcgis9 小,而占用内存要少,命令也简单直接一点。不过我还是喜欢在ArcGis 9 + autocad map 2004 + Visual Foxpro 6 来处理。

Arcgis10.0之后版本坐标值转换成shp图层教程

Arcgis10.0之后版本坐标值转换成shp图层教程

Arcgis10.0之后版本坐标值转换成shp图层教程通过坐标数值⽣成点线⾯的shp图层Arcgis10.0之后版本虽然交9.3增加了很多功能,但是却不知何故少了⼀些常⽤的功能。

本问主要就⽐较常⽤通过坐标数值⽣成点线⾯的shp图层做简单介绍。

⼀、前期准备1.将附件CreateFeaturesFromTextFile⽂件复制到任何⼀个固定的位置。

2.打开Arcgis,新建toolbox3.按图新建脚本⼯具C:\Program Files\ArcGIS\Desktop10.1\ArcToolbox\Stylesheets\geoprocessing_help.xsl 4.点击下⼀步,Script File选择刚才那个脚本⽂件“CreateFeaturesFromTextFile”5.设置参数其中,“坐标值规定“中的Default的值为12345678.12345 “输出shp⽂件”中的Direction改为output “坐标系统“的type改为optional6.点击finished⼆、制作带有坐标的⽂本⽂件。

1.这个⽂件第⼀⾏以d,x,m开头,分别表⽰点线⾯。

2.接下⼏⾏是坐标值,以“编号(编号从0开始)X坐标Y坐标”例如:0 40545654.256 532145697.3253.另起⾏以end结束。

保存成txt格式的⽂件。

三、⽣产shp图层1.打开刚才那个制作好的脚本⼯具CreateFeaturesFromTextFile2.按照提⽰操作,坐标系统可以不填3.点击Ok。

完成注意事项:编写的txt⽂件的坐标必须按照顺序编写,否则图形会出现紊乱(点⽂件除外)。

将⼀下⽂本粘贴到txt中,并保存成.py的⽂件。

'''---------------------------------------------------------------------------------- Tool Name: CreateFeaturesFromTextFileSource Name: CreateFeaturesFromTextFile.pyVersion: ArcGIS 9.1Author: Environmental Systems Research Institute Inc. Required Argumuments: An Input Text File containing feature coordinatesAn Input Character designating the decimal separator used in the text file.An output feature classOptional Arguments: A spatial reference can be specified. This will be thespatial reference of the output fc. Description: Reads a text file with feature coordinates and creates a feature classfrom the coordinates.----------------------------------------------------------------------------------'''import string, os, sys, locale, arcgisscriptinggp = arcgisscripting.create()gp.overwriteoutput = 1msgErrorTooFewParams = "Not enough parameters provided." msgUnknownDataType = " is not a valid datatype. Datatype must be point, multipoint, polyline or polygon."msgErrorCreatingPoint = "Error creating point %s on feature %s"# sets all the point propertiesdefcreatePoint(point, geometry):try:point.id = geometry[0]point.x = geometry[1]point.y = geometry[2]# When empty values are written out from pyWriteGeomToTextFile, they come as 1.#QNAN# Additionally, the user need not supply these values, so if they aren't in the list don't add themif len(geometry) > 3:if geometry[3].lower().find("nan") == -1: point.z = geometry[3]if len(geometry) > 4:if geometry[4].lower().find("nan") == -1: point.m = geometry[4]return pointexcept:raise Exception, msgErrorCreatingPointtry:# get the provided parametersinputTxtFile = open(gp.getparameterastext(0))fileSepChar = gp.getparameterastext(1)outputFC = gp.getparameterastext(2)# spatial reference is optionaloutputSR = gp.getparameterastext(3)# make sure the text type specified in the text file is valid. inDataT = inputTxtFile.readline().strip().lower()d = {'d':'point','ml':'multipoint','x':'polyline','m':'polygon'} inDataType = d[inDataT]dataTypes = ["point", "multipoint", "polyline", "polygon"] if inDataType.lower() not in dataTypes: msgUnknownDataType = "%s%s" % (inDataType, msgUnknownDataType)raise Exception, msgUnknownDataType# create the new featureclassgp.toolbox = "management"gp.CreateFeatureclass(os.path.split(outputFC)[0],os.path.split(outputFC)[1], inDataType, "#", "ENABLED", "ENABLED", outputSR)# create a new field to assure the id of each feature is preserved. idfield = "File_ID"gp.addfield(outputFC, idfield, "LONG")# get some information about the new featureclass for later use. outDesc = gp.describe(outputFC)shapefield = outDesc.ShapeFieldName# create the cursor and objects necessary for the geometry creation rows = gp.insertcursor(outputFC)pnt = gp.createobject("point")pntarray = gp.createobject("Array")partarray = gp.createobject("Array")locale.setlocale(locale.LC_ALL, '')sepchar = locale.localeconv()['decimal_point']# loop through the text file.featid = 0lineno = 1for line in inputTxtFile.readlines():lineno += 1# create an array from each line in the input text filevalues = line.replace("\n", "").replace("\r","").replace(fileSepChar, sepchar).split(" ")# for a point feature class simply populate a point object and insert it.if inDataType == "point" and values[0].lower() != "end":row = rows.newrow()pnt = createPoint(pnt, values)row.SetValue(shapefield, pnt)row.SetValue(idfield, int(values[0]))rows.insertrow(row)# for a multipoint the text file is organized a bit differently. Groups of points must be inserted at the same time. elifinDataType == "multipoint":if len(values) > 2:pnt = createPoint(pnt, values)pntarray.add(pnt)elif (len(values) == 2 and lineno != 2) or values[0].lower() == "end":row = rows.newrow()row.SetValue(shapefield, pntarray)# store the feature id just in case there is an error. helps track down the offending line in the input text file.if values[0].lower() != "end":row.SetValue(idfield, featid)featid = int(values[0])else:row.SetValue(idfield, featid)rows.insertrow(row)pntarray.removeall()elif (len(values) == 2 and lineno == 2):featid = int(values[0])# for polygons and lines. polygons have a bit of logic for interior rings (donuts).# lines use the same logic as polygons (except for the interior rings)elifinDataType == "polygon" or inDataType == "polyline":#takes care of#adds the point array to the part array and then part array to the featureif (len(values) == 2 and float(values[1]) == 0 and lineno != 2) or values[0].lower() == "end":partarray.add(pntarray)row = rows.newrow()row.SetValue(shapefield, partarray)# store the feature id just in case there is an error. helps track down the offending line in the input text file. if values[0].lower() != "end":row.SetValue(idfield, featid)featid = int(values[0])else:row.SetValue(idfield, featid)rows.insertrow(row)partarray.removeall()pntarray.removeall()#adds parts and/or interior rings to the part arrayelif (len(values) == 2 and float(values[1]) > 0) or values[0].lower() == "interiorring":partarray.add(pntarray)pntarray.removeall()#add points to the point arrayeliflen(values) > 2:pnt = createPoint(pnt, values)pntarray.add(pnt)elif (len(values) == 2 and lineno == 2):featid = int(values[0])inputTxtFile.close()del rowsdel rowexcept Exception, ErrorDesc:# handle the errors here. if the point creation fails, want to keep track of which point failed (easier to fix the # text file if we do)if ErrorDesc[0] == msgErrorCreatingPoint:if inDataType.lower() == "point": msgErrorCreatingPoint = msgErrorCreatingPoint % (values[0],values[0])else:msgErrorCreatingPoint = msgErrorCreatingPoint % (values[0], featid) gp.AddError(msgErrorCreatingPoint) elifErrorDesc[0] != "":gp.AddError(str(ErrorDesc))gp.AddError(gp.getmessages(2))# make sure to close up the fileinput no matter what. if inputTxtFile: inputTxtFile.close()。

DEM数据格式转换

DEM数据格式转换

DEM数据格式转换作者:不详发表时间: 2013-7-19 10:29:11最近遇到DEM数据格式转换的问题。

问题缘由要把一批DEM数据通过ArcSDE入库,但是手上已有的数据的格式是TXT(记录点的X,Y,Z)和DXF,这两种格式却都不能直接导入。

有两种可行的方法总结如下:1.TXT——(Access)数据库表——(ArcMap)shp——(3D Analyst)TIN——(ArcToolbox)Raster(1)用Access导入TXT文件,转换为数据库表,相应的字段给予对应的字段名称(如:X,Y,Z);(2)ArcMap—>Tools菜单—>Add XY Data对话框,选择转换后的数据库表,为X和Y 选择对应的字段名称,必要时定义投影信息。

新文件绘制完毕,在文件名上右键单击,选择Data—>Export Data,输出点shp文件;(3)加载3D Analyst工具条,3D Analyst—>Create/Modify TIN—>Create TIN From Features,选择上一步生成的shp文件,并制定高程值对应的字段名,生成TIN;(4) ArcToolbox—>3D Analyst Tools—>Conversion—>From TIN—>TIN to Raster,生成GRID 格式的Raster数据集。

现在可以通过ArcSDE导入数据库了。

2. TXT——(VirtuZo).grd——(ArcToolbox)Raster(1)通过VirtuZo软件,把TXT文件转换为后缀名为.grd的文件,其实按理.grd文件是ArcInfo Grid交换格式文件。

这里要注意的是这个文件的头文件格式如下:ncols 数据列数nrows 数据行数xllcorner 数据左上角的X值yllcorner 数据左上角的Y值cellsize 数据分辨率NODATA_value 无值数据标志(一般-99999)通过VirtuZo转出来的文件可能头文件有点出入,需要按照这个格式进行调整,幸好它是明码文件;(2)通过批量改名,把grd的后缀改为txt或asc,这是因为转换的源文件它只认这两个后缀的文件;(3)ArcToolbox—>Conversion Tools—>To Raster—>ASCII to Raster,生成GRID格式的Raster 数据集。

Arcgis常用操作方法

Arcgis常用操作方法

一些常用操作方法总结一、计算面积 (可以帮我们计算小班面积)添加AREA字段,然后右键点击字段列,然后点击CALCULATE VALUES; --->选择ADVANCED--》把下面的代码输入,然后在最下面=处写OUTPUT点击OK就OK了。

Dim Output as doubleDim pArea as IareaSet pArea = [shape]Output = pArea.area二、计算长度 (可以帮我们计算林带长度)同上添加LENGTH字段,然后右键点击字段列,然后点击CALCULATE VALUES; --->选择ADVANCED--》把下面的代码输入,然后在最下面=处写OUTPUT。

点击OK就OK了。

Dim Output as doubleDim pCurve as ICurveSet pCurve = [shape]Output = pCurve.Length三、小班升序排列:同上添加小班号字段,然后右键点击字段列,然后点击CALCULATE VALUES; --->选择ADVANCED --》把下面的代码输入,然后在最下面=处写OUTPUT。

点击OK就OK了。

Static i as longDim Output as stringi=i+1Output =i四、村界切割小班选择->根据位置选择,小班are are crossed by the outline of村面,然后选择->设置可选择图层为村面。

用追踪工具,任务为切割多边形要素,进行切割五、字段赋值选择->根据位置选择,小班are within村面。

打开属性表显示选中的,选择一整列计算字段值对整个字段赋一个常量或,勾选高级加求变量代码六、拓扑检查ArcCatalog选要进行拓扑检查的文件夹右键->新建个人geodatabase->新建要素集->导入要素类->新建拓扑(导入要拓扑的图层)。

将txt坐标形式数据转成点线面图层(shapefile、coverage)资料

将txt坐标形式数据转成点线面图层(shapefile、coverage)资料

很多时候我们获取到某个点位、线路、范围的数据都是点坐标形式,如何将其转换到图形形式(如shapefile,dwg等)呢?arcgis中的add xy data可以将坐标点以excel或者dbf的格式导入,生成点。

但是如果手中的一系列点坐标是条线,或者一个面范围呢?可以用add xy data的方式先生成点,然后连接成线或者面。

有没有直接将坐标系列生成对应的点、线、面呢?方法还是有的。

一、在arcview中实现在file-extentions对话框中分别勾选:Generate to shape(txt转shp)以下列方式构建坐标系列txt文件:点:1 x1 y22 x2 y2.....n xn ynend线:1x1 y1x2 y2...xn ynend2X1 y1X2 y2..EndEnd面:和线形式一样,但是x1,y1和xn,yn相同二、arcinfo workstation中用generate命令生成或者用装了workstation后的Arctoolbox 里面的generate工具(生成成果是coverage格式)。

以下列方式构建坐标系列txt文件:LinesThe format for line coordinates is:<ID><X,Y>endendPointsThe format for point coordinates is:<ID> <X,Y> {Angle} {Scale}endPolygonsThe format for POLYGON coordinates is:<ID> {AUTO | X,Y>}X,Yendend三、用Arctoolbox中CreateFeaturesFromTextFile工具(10.0以前才有)以利用ArcToolbox/Samples/Data Management/Features中的两个工具Create Features From Text File(导入)和Write Features To Text File(导出)完成txt文本格式的要素导入导出。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档