使用经纬度Excel表创build点Shapefile

这应该很简单:我有一张带有污染检测站点的Excel表格,以及相应的纬度和经度。 我想为这个表格创build一个点shapefile。

我已经写了一个脚本来创build文件,但不知道如何创build它的点:

#Creates Observation Site Shapefile import arcpy import fileinput import string import os from arcpy import env env.workspace = "F:\GEOG 487B\Project" env.overwriteOutput = True outpath = env.workspace newfc = "sites.shp" infile = "site_loc.xls" arcpy.CreateFeatureclass_management(outpath, newfc, "Point") 

shapefile被创build,但属性表是空的。 我怎样才能让ArcMap识别我的Latutude和Longitude列?
该表非常简单:列A =站点ID#,B =纬度,C =经度

谢谢!!

我知道有一个库可以读/写形状文件。 我以前用它来阅读国家气象局的Shapefile文件。

http://code.google.com/p/pyshp/

从该网页上的示例中,将点写入形状文件看起来相当容易。

我的答案可能晚了,但是可以使用Make XY Event Layer ,然后使用例如Copy Features将输出图层保存到shapefile或要素类中。 您也可以在没有Python的情况下通过在ArcCatalog> XY表中创build要素类中右键单击xls表单来执行此操作。

Interesting Posts