[gdal-dev] Changing layer name of GeoJSON datasets

Even Rouault even.rouault at spatialys.com
Sat Nov 19 07:24:52 PST 2016


Hi

Currently the GeoJSON datasource always return "OGRGeoJSON" as a layer name, 
which is quite boring (if you convert the geojson into a multi-layer capable 
dataousrce, you always have to rename the layer to something more meaningful)

I'd consider changing that to take the basename of the datasource, ie "my" if 
the filename is "/path/to/my.geojson". This would be similar to many other 
drivers like Shapefile, CSV, MapInfo File, JML ... (ie drivers with a single 
layer per file)

For URLS coming from HTTP services with query parameters "?foo=bar&...", we 
would likely keep the "OGRGeoJSON" name.

I'd also consider adding and reading a "name" extension member in the 
FeatureCollection object to store/retrieve the layer name. This would have the 
priority over the filename based rule when it exists.

{
	"type": "FeatureCollection",
	"name": "layer_name",
	"features": [
	}
}

Thoughts ?

Even

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


More information about the gdal-dev mailing list