我想从geojson
文件创建几何。json
我用python 2.7中的库加载文件,然后使用这一行
point = ogr.CreateGeometryFromJson(geojson)
转换。
此行来自ogr
依赖于库的GDAL
库(版本 GDAL/OGR 1.11.3-1)当我运行此行时,python 崩溃。我只得到Segmentation fault: 11
.
geojson
看起来像这样:
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "someCRS" } },
"features": [
{ "type": "Feature", "properties": { "value1": "x", "value2": 886, "value3": 0, "value3": "y", "value4": "9878665", "value5": "91", "altitude": 0.000000, "feature": "y", "id": 4, "value6": 0, "value7": "xyz", "value8": 883645, "value9": 3.024 }, "geometry": { "type": "Point", "coordinates": [ 1, 1 ] } }
}]