Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created April 30, 2012 04:12
Show Gist options
  • Save springmeyer/2555408 to your computer and use it in GitHub Desktop.
Save springmeyer/2555408 to your computer and use it in GitHub Desktop.
import custom tags for haiti using osm2pgsql --sanitize-columns
# build fancy osm2pgsql version
git clone https://github.com/schuyler/osm2pgsql.git
cd osm2pgsql
./autogen.sh
./configure
make
# for osx, fix bogus linking that likely happened to apple's libpq
install_name_tool -change /usr/lib/libpq.5.dylib /usr/local/lib/libpq.5.dylib osm2pgsql
# grab data and scripts
wget http://labs.geofabrik.de/haiti/latest.osm.bz2
wget https://raw.github.com/hotosm/presets/master/hdm_presets_3.xml
wget https://raw.github.com/hotosm/scripts/master/preset2style.py
# run the preset convertor to generate a new style for importing
chmod +x preset2style.py
./preset2style.py hdm_presets_3.xml
./preset2style.py -p hdm_presets_3.xml -s default.style > haiti.style
# create a new db
createdb -T template_postgis haiti-sanitized
# import!
./osm2pgsql -S haiti.style -d haiti-sanitized --sanitize-columns latest.osm.bz2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment