Skip to content

Latest commit

 

History

History
executable file
·
21 lines (19 loc) · 1023 Bytes

import_osm.MD

File metadata and controls

executable file
·
21 lines (19 loc) · 1023 Bytes

Make sure you already have osm2pgsql, wget install on your machine,

Download the OSM PBF of your region on GEOFABRIK

    mkdir geosmBackend/DB/working_dir
    cd geosmBackend/DB/working_dir
    wget https://download.geofabrik.de/africa/cameroon-latest.osm.pbf -O osm.pbf 

Import OSM PBF in database

  • Import OSM PBF in database using osm2pgsql
  • Create index on created tables
$ osm2pgsql --cache 10000 --number-processes 5 --extra-attributes --slim -G -c -U postgres -d <database_name> -H localhost -W --hstore-all -S ../data-osm.style osm.pbf
$ chmod +x ../create_index.sh
$ ../create_index.sh <database_name>

To keep update the OSM data:

More information here : https://github.com/Magellium/magosm_db