Hi Nikos, I am using a similar approach to yours to extract data from OSM files to a GIS format. I chose Spatiallite as a format since it is superior to the Shapefile format in all areas. FYI here’s what I do: osmconvert -b="5.5,49,8,50.5" -o=saarland.osm.pbf "europe-latest.osm.pbf" ogr2ogr --config OSM_CONFIG_FILE /home/frank/gdal/osmconf.ini -f SQLite -dsco SPATIALITE=YES -progress -gt 65536 -t_srs "EPSG:31466" /tmp/saarland.sqlite /tmp/saarland.osm.pbf
Please note the “–config” switch for a custom osmconf.ini. With that you can copy the config to a custom location and have several configs for many use cases. HTH Frank Dipl. Geogr. Frank Broniewski Waldhölzbacher Str. 51 66679 Losheim am See 06872 5090684 www.frankbroniewski.com Von: Nikos Alexandris Gesendet: Dienstag, 7. November 2017 16:15 An: [email protected] Betreff: [gdal-dev] Extracting keys & values from OSM Planet Dear OSM experts, a reproducible workflow that extracts specific tags from OSM's Planet data set, includes: 1. downloading OSM Planet in form of a pbf file 2. convert pbf to o5m using `osmconvert` 3 extract areas of interest in separate `aoi_*.o5m` files, based on boundaries in form of .poly files, using `osmconvert` 4. filtering for specific tags (i.e. highways), parallel tasks in 80 cores ```bash # custom function for 'highway' tags function osmfilterhighway { osmfilter $1 --drop-version --keep="highway=track =footway =bridleway =path" > $(basename $1 .o5m)_highway.osm; } export -f osmfilterhighway # filter find . -type f -name \*aoi*.o5m |parallel -j80 osmfilterhighway {} ``` 1. Is it any better using GDAL's `osmconf.ini` "method" [0], over `osmconvert` and `osmfilter`, in terms of reliability/speed etc.? 2. Is OGR handling well the conversion from .osm to ESRI Shapefiles? 3. What is the way to split "other_tags" in multiple new fields *when* knowing exactly which tags are contained and should be obtained? Thank you for any help, Nikos [0] https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
