[Qgis-developer] GDAL 2.1 can update Geojson files - What is missing in QGIS to edit GeoJSON files ?

Even Rouault even.rouault at spatialys.com
Thu Jan 14 07:44:05 PST 2016


Hi Michael,

> 
> I have read that GDAL can now update GeoJSON  since version 2.1.0. See [1]
> 
> If I build QGIS with GDAL 2.1, would I be able to edit the GeoJSON as I can
> for Shapefiles ?

Yes, that was developed mostly for the QGIS use case and has been tested with 
it. You have full editing capabilities : adding, deleting, modifying features, 
adding, deleting fields.

> 
> Another GeoJSON related question. Any idea on the relevance of adding the
> ability to create a spatial index file *.qix for GeoJSON layers in order to
> improve rendering speed ?

The OGR GeoJSON driver proceeds into the ingestion of the full file into 
memory, which can be a limitation when dealing with huge files ( the json-c lib 
might typically consume an amount of memory more than 10 times the size of the 
geojson file).
For a in-memory layer like the one used underneath by the GeoJSON driver, the 
spatial filtering done by OGR uses a basic BBOX filter while iterating over the 
features (the BBOX isn't stored into the geometry object but recomputed each 
time it is needed). This could potentially benefit from a in-memory spatial 
index, but I'd expect that to be only useful for large geojson files (let's say 
> 100 MB), i.e. the ones that the driver would currently have issues to deal 
with.

A more "streaming-like" approach for the driver not proceeding to full 
ingestion of features could be desirable to remove that limitation, but that's 
more involved. A possibility could be to have a "at-hand" parser to delimitate 
JSon "Feature" objects and use only json-c to parse each feature. But GeoJSON 
is certainly not the more appropriate file format to deal with huge datasets...

Cheers,

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the Qgis-developer mailing list