Loading OSM data into PostgreSQL database using osm2pgsql - SpotScore/spotscore GitHub Wiki

Steps:

  1. Ensure that 'spotscore_postgis_1' container is up to date and running.
  2. If running Docker in Vagrant, import the OSM data file to a known folder (or clone the spotscore repo to get the example file in sample_data folder).
  3. Run: docker run -it --rm --link spotscore_postgis_1:pg -v /home/vagrant/spotscore/sample_data:/import spotscore/osm2pgsql sh -c 'osm2pgsql --create --slim --cache 500 -d gis -E 3857 -U spotscore --host pg --port 5432 -W /import/tartu-copy.osm'.
  4. Enter the database password: notsecret
  5. Import process starts and database tables become populated with data.