User:Loïs/FR:Serveur+DB

From OpenStreetMap Wiki
Jump to: navigation, search

Serveur et DB

Références

Osmosis

bin/osmosis-0.38/bin/osmosis -v --truncate-apidb user="osmuser" password="osm" # initialiser une base (à tester)

Voir http://www.postgresql.org/docs/8.4/interactive/sql-delete.html & http://www.postgresql.org/docs/8.4/interactive/sql-truncate.html pour intégrer ça dans dakota-tools

  • remplissage de la base :

bin/osmosis-0.38/bin/osmosis -v --read-xml file="data/france.osm.gz" --write-apidb user="osmuser" password="osm" populateCurrentTables=yes (à tester)

bin/osmosis-0.38/bin/osmosis -v --read-xml file="data/france.osm.gz" --write-pgsql user="osmuser" password="osm"

 19h sur foulque, en iscsi (début 2010, 20GB)
 21h sur americ, sur PERC4/di (fin 2010, 45GB)

bin/osmosis-0.39/bin/osmosis -v --read-pbf file="data/france.osm.pbf" --write-pgsql user="osmuser" database="osm" password="osm"

 20h30 sur x4504, Sun Fire X4500 (au 18/10/2011, 67GB)

bin/osmosis-0.39/bin/osmosis -v --read-pbf file="data/europe.osm.pbf" --write-pgsql user="osmuser" database="osm" password="osm"

 159h sur x4504, Sun Fire X4500 (au 20/10/2011, 212 GB)
  • extraction en bounding box

bin/osmosis-0.38/bin/osmosis -v --read-pgsql user="osmuser" password="osm" --dataset-bounding-box bottom=47 left=-5 top=48 right=-4 completeWays=yes --wx 53271638.osm

Postgresql

SELECT pg_size_pretty(pg_database_size('osm'));

vacuum full; analyze;

Créer ou remettre une base d'aplomb :

 su - postgres
 psql -d postgres --command "CREATE ROLE osmuser with SUPERUSER LOGIN ENCRYPTED PASSWORD 'osm';"
 # ALTER USER osmuser with ENCRYPTED PASSWORD 'osm';
 psql -d postgres -U osmuser -W --command "CREATE DATABASE osm;"
 psql -d osm -U osmuser -W --command "CREATE LANGUAGE plpgsql;"
 psql -d osm -U osmuser -W -f /usr/share/postgresql/8.4/contrib/btree_gist.sql
 psql -d osm -U osmuser -W -f /usr/share/postgresql/8.4/contrib/hstore.sql
 psql -d osm -U osmuser -W -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
 psql -d osm -U osmuser -W -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
 cd <dir to>/osmosis/script/
 psql -d osm -U osmuser -W -f pgsnapshot_schema_0.6.sql
 psql -d osm -U osmuser -W -f pgsnapshot_schema_0.6_action.sql
 psql -d osm -U osmuser -W -f pgsnapshot_schema_0.6_bbox.sql
 psql -d osm -U osmuser -W -f pgsnapshot_schema_0.6_linestring.sql