GFDRR / Nepal-Geonode

GeoNode for Nepal
GNU General Public License v3.0
0 stars 1 forks source link

Editing OSM attributes #3

Open code-geek opened 6 years ago

code-geek commented 6 years ago

I've implemented an automatic OSM extraction module in the Nepal GeoNode, basing it off of Malawi's implementation here: https://github.com/MalawiGeospatialTools/osm-extract

Been trying to edit the ini files in order to only extract the attributes we need. However, it's throwing this error:


ERROR 1: Could not parse configuration file for OSM import
FAILURE:
Unable to open datasource `nepal/aerodromes_point.pbf' with the following drivers.
......
Makefile:142: recipe for target 'aerodromes_point.sql' failed
make: *** [aerodromes_point.sql] Error 1111
ingenieroariel commented 6 years ago

It could be that the filter ended up with zero features and the next step rejects it as an invalida file.

Try disabling that layer in case there is only one or a fee with that problem.

-a

On Dec 19, 2017, at 5:50 AM, Ashish Acharya notifications@github.com wrote:

I've implemented an automatic OSM extraction module in the Nepal GeoNode, basing it off of Malawi's implementation here: https://github.com/MalawiGeospatialTools/osm-extract

Been trying to edit the ini files in order to only extract the attributes we need. However, it's throwing this error:

ERROR 1: Could not parse configuration file for OSM import FAILURE: Unable to open datasource `nepal/aerodromes_point.pbf' with the following drivers. ...... Makefile:142: recipe for target 'aerodromes_point.sql' failed make: *** [aerodromes_point.sql] Error 1111 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

ppasq commented 6 years ago

I've made a test using your conf files. I've downloaded a nepal-latest.osm.pbf from GeoFabrik and run the script step by step.

$ osmosis --read-pbf-fast file=nepal-latest.osm.pbf --nkv keyValueList="aeroway.aerodrome" --write-pbf file=aerodromes_point.pbf
Jan 09, 2018 5:17:34 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.45
Jan 09, 2018 5:17:35 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Jan 09, 2018 5:17:35 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Jan 09, 2018 5:17:35 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Jan 09, 2018 5:17:53 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline complete.
Jan 09, 2018 5:17:53 PM org.openstreetmap.osmosis.core.Osmosiss run
INFO: Total execution time: 18349 milliseconds.
$ ogr2ogr -f PGDump aerodromes_point.sql aerodromes_point.pbf -lco COLUMN_TYPES=other_tags=hstore --config OSM_CONFIG_FILE conf/aerodromes_point.ini

The generated aerodromes_point.sql file is not empty (has about 10 features) and I got no errors.

@code-geek when you get the GDAL list of available drivers, is OSM included? -> OSM