【问题标题】:Create Point Shapefile Using Excel Table of Latitude and Longitude使用经纬度 Excel 表创建点形状文件
【发布时间】:2013-11-05 22:45:32
【问题描述】:

这应该很简单: 我有一个带有污染检测点的 Excel 表,以及它们对应的纬度和经度。我想为这个表创建一个点 shapefile。

我已经编写了一个脚本来创建文件,但不知道如何在其中创建点:

#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 已创建,但属性表为空。如何让 ArcMap 识别我的纬度和经度列?
表很简单: A 列 = 站点 ID#,B = 纬度,C = 经度

谢谢!!

【问题讨论】:

标签: python sql excel arcmap


【解决方案1】:

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

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

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-14
      相关资源
      最近更新 更多