[gdal-dev] Handle geojson bigger than 200MB

Momtchil Momtchev momtchil at momtchev.com
Mon Mar 2 01:12:30 PST 2020


On 29/02/2020 20:34, Francesco Bartoli wrote:
> Thanks Even, it works but I have strange result with the size value. I 
> wouldn’t have been expected the exception from this test:
>
> $ OGR_GEOJSON_MAX_OBJ_SIZE=500MB ogr2ogr -f "GeoJSON" 
> indonesia.geojson 
> "WFS:geonode.wfp.org/geoserver/wfs?request=GetFeature&typename=geonode:glb_bnd_adm0_1&outputformat=json" 
> -where “adm0_id=‘272’"
>
> indonesia.geojson is around 35MB so the exception shouldn’t raise if 
> OGR_GEOJSON_MAX_OBJ_SIZE=50 AFAIK:
>

OGR_GEOJSON_MAX_OBJ_SIZE is not a limit on the file size, but on the 
maximum memory allocation for a single GeoJSON feature which is 
estimated before the feature is read. As country borders are usually a 
single GeoJSON feature, a country with a complex coastline is the 
typical case where you need larger features.


-- 
Momtchil Momtchev <momtchil at momtchev.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200302/351d99ba/attachment.html>


More information about the gdal-dev mailing list