【发布时间】:2014-06-09 21:00:50
【问题描述】:
我在创建几何类型为几何集合的图层时遇到问题。因此我无法输出到 shapefile。我在下面附上了代码。 dstLayer 为空。如果 geom 类型是多边形或多线串或任何其他类型,则不会发生这种情况。
spatialReference = osr.SpatialReference()
spatialReference.SetWellKnownGeogCS('WGS84')
driver = ogr.GetDriverByName("ESRI Shapefile")
dstPath = os.path.join("common-border", "border.shp")
dstFile = driver.CreateDataSource(dstPath)
dstLayer = dstFile.CreateLayer("layer", spatialReference, ogr.wkbGeometryCollection)
任何帮助将不胜感激。
谢谢
【问题讨论】:
-
不可能,因为 Shapefile 不支持集合。
标签: python gis esri gdal shapely