arcpy根据给定坐标值生成要素,要素的坐标有偏移?
arcgis10.2 帮助文档里的代码:
生成的要素折点坐标跟给定坐标不一致,有点点偏移,不知道是什么原因。
import arcpy
# A list of features and coordinate pairs
feature_info = [[[1, 2], [2, 4], [3, 7]],
[[6, 8], [5, 7], [7, 2], [9, 5]]]
# A list that will hold each of the Polygon objects
features = []
for feature in feature_info:
# Create a Polygon object based on the array of points
# Append to the list of Polygon objects
features.append(
arcpy.Polygon(
arcpy.Array([arcpy.Point(*coords) for coords in feature])))
# Persist a copy of the Polyline objects using CopyFeatures
arcpy.CopyFeatures_management(features, "c:/geometry/polygons.shp")
生成的要素折点坐标跟给定坐标不一致,有点点偏移,不知道是什么原因。
1 个回复
zsf - SGG
赞同来自:
Polyline(inputs,{spatial_reference},{has_z},{has_m})
Polygon(inputs,{spatial_reference},{has_z},{has_m})
最简单的办法,指定一个数据模板图层,函数如下
arcpy.Polygon(input,layer)
要回复问题请先登录或注册