For testing purposes we set up up a PostGIS server containing planet.osm. == PostGIS Server == The server runs on atlantis, a pgAdmin frontend is running at http://atlantis.informatik.privat/pgadmin4/. The OSM data is in database osm. == Importing OSM to PostGIS == To import {{{planet.osm}}}, we use {{{osm2pgsql}}}. Several things have to considered to import {{{planet.osm}}} without running out of memory or time. The import {{{planet.osm.pbf}}} on atlantis, run this command as user {{{postgres}}}: {{{ osm2pgsql -c -d osm -C 60000 --slim --flat-nodes /local/data/postgresql/flatnodes /local/data/brosip/planet-latest.osm.pbf }}} {{{-C 60000}}} sets the node cache to 60000 MB (don't use more, atlantis has 95 GB of RAM, and {{{osm2pgsql}}} will use additional RAM for other stuff). Lower values will increasingly impact the performance to a point where the import will take years (this is the case with default parameters). {{{-c}}} means that the database tables are created if missing {{{-d}}} specifies the database to use {{{--slim}}} will take much longer, but externalizes some stuff to the disk and to the database itself. Without {{{--slim}}}, you will quickly run out of RAM on atlantis. {{{--flat-nodes}}} is a file to which parts of the node cache are externalized in {{{--slim}}} mode. This file has to local (e.g. {{{/local/data}}}), the performance will be abysmal over NFS. After much experimentation, Patrick achieved throughputs of around 5M nodes per second, 82k ways per second and 4 (sic!) relations per second. At currently 8371364 relations in planet.osm, the import will still take 3-4 weeks.