我想从geojson
文件创建几何体。
我在python 2.7中使用json
库加载文件,然后使用此line
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 ] } }
}]