Tuesday, 16 October 2018

Converting GeoJSON to Shapefile using ogr2ogr?


I have a GeoJson file that I want to convert to ESRI Shapefile using ogr2ogr in FWTools.



I tried using


ogr2ogr -F "ESRI Shapefile" filename.shp geojsonfile.json OGRGeoJSON

I got output



ERROR 6: Can't create fields of type StringList on shapefile layers. ERROR 1: Attempt to write non-polygon (POINT) geometry to type shapefile. ERROR 1: Terminating translation prematurely after failed translation of layer OGRGeoJSON



GeoJSON input we are giving is in standard geojson format.


content of geojson are like {to share I took only a part from features array }


{"id":1223,

"properties":{"name":"3","level":2},
"map_version":11,"type":"FeatureCollection","x_id":1234,"obj_type":"LevelGeometry",
"features":[

{
"my_area":[131.40093253528894,33.58879853190332,6.515867411008615,3.490549810987222,-0.6237271428108215],
"id":1984791,
"location":{"type":"Point","coordinates":[131.4009325,33.5887985]},
"properties":{"display_name":"xyz"},
"type":"Feature",

"geometry":{"type":"Polygon","coordinates":[[[131.4009508,33.5888314],[131.4008895,33.5887946],[131.4009148,33.5887653],[131.4009761,33.5888020],[131.4009508,33.5888314]]]},
"obj_type":"Geometry"
}

]
}


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...