wavded / ogre

ogr2ogr geojson-focused web client
http://ogre.adc4gis.com
MIT License
266 stars 78 forks source link

support multiple layers from one source file #63

Closed andrewharvey closed 7 years ago

andrewharvey commented 7 years ago

If a source file contains multiple layers, it would nice if ogre would split it up into multiple GeoJSON output files

wavded commented 7 years ago

Unfortunately ogr2ogr does not support this.

andrewharvey commented 7 years ago

No problem. Right now I'm using something like this:

IFS=$'\n'
for layer in `ogrinfo SourceFile.ext | grep '^[[:digit:]]' | cut -d' ' -f2-`; do
    ogr2ogr -f GeoJSON "${layer}.geojson" SourceFile.ext "$layer"
done