Right now I have a GeoJson file with a structure like this:
{
"geometry": {
"type": "MultiLineString",
"coordinates": [
[ <Coords line 1>
],
[ <Coords line 2>
],
[ <Coords line 3>
]
]
},
"type": "Feature",
"properties": {
"time": 960,
"value": 0.5
} }
I want to create a MultiPolygon shapefile from that but ogr2ogr throws an error using this command:
ogr2ogr -f "ESRI Shapefile" -nlt MULTIPOLYGON <out_file.shp> <file.shp> OGRGeoJson
ERROR 1: Attempt to write non-polygon (MULTILINESTRING) geometry to POLYGON type shapefile.
I've been searching other possibilities to achieves this and for example with QGis is quite simple, but I need a solution that can be used from terminal.
As a side note, all the lines in the geoJson starts and ends at the same point, so they make a closed line.