Import OSM PBF file to PostGIS database with relation members

trolleway
1 min readJan 9, 2019

--

Import PBF to PostGIS if you need access to relation members and role data.

#Install latest osmosis
#current version in Ubuntu fails while read pbf
wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.tgz
mkdir osmosis
mv osmosis-latest.tgz osmosis
cd osmosis
tar xvfz osmosis-latest.tgz
rm osmosis-latest.tgz
#End of osmosis install
psql -d gis -c "CREATE extension IF NOT EXISTS hstore"
psql -d gis -f /home/trolleway/osmosis/script/pgsnapshot_schema_0.6.sql
osmosis/bin/osmosis \
--read-pbf file="filtered.pbf" \
--write-pgsql host="localhost" database="gis" user="" password=""

--

--

No responses yet