我想使用pyshp库和geo_接口协议将shapefile转换成geojson对象。我用了块组.shp文件作为输入。您可以在以下网页中找到它:
https://github.com/GeospatialPython/pyshp/tree/master/shapefiles
import shapefile
r = shapefile.Reader('blockgroups.shp')
newGeojson = r.__geo_interface__
print(newGeojson)
问题是,当我打印newGeojson对象时,我注意到新geojson对象中的字段与中的原始值不匹配块组.shp文件。这是因为在geojson对象中添加了DeletionFlag字段。 删除标志字段存在于块组.shp文件作为隐藏字段,因此我们无法在shapefile的属性表中看到它。相反,在新的geojson对象中,它显示为一个可见字段,并接受区域字段的值。从这里没有值匹配它的正确值。 有人有同样的问题吗?有没有办法纠正这个问题?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐