I need only basic osm2pgsql
usage. Using postgres user and sandbox (created) database.
sudo -u postgres osm2pgsql -s -U postgres -d sandbox brazil-latest.osm.pbf
NOTES
Using UBUNTU 14 LTS, osm2pgsql --version
say "osm2pgsql SVN version 0.82.0 (64bit id space)". At SQL terminal (psql) the select version()
says "9.3.9 on x86_64-unknown-linux-gnu".
Prepare, all steps:
wget -c http://download.geofabrik.de/south-america/brazil-latest.osm.pbf
wget -c http://download.geofabrik.de/south-america/brazil-latest.osm.pbf.md5
md5sum -c brazil-latest.osm.pbf.md5
# OK
sudo -u postgres psql sandbox
# ... SELECT PostGIS_version(); -- 2.1 OK
\q
sudo -u postgres osm2pgsql -s -U postgres -d sandbox brazil-latest.osm.pbf
last command errors:
osm2pgsql SVN version 0.82.0 (64bit id space)
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE: table "planet_osm_point" does not exist, skipping
NOTICE: table "planet_osm_point_tmp" does not exist, skipping
Setting up table: planet_osm_line
NOTICE: table "planet_osm_line" does not exist, skipping
NOTICE: table "planet_osm_line_tmp" does not exist, skipping
Setting up table: planet_osm_polygon
NOTICE: table "planet_osm_polygon" does not exist, skipping
NOTICE: table "planet_osm_polygon_tmp" does not exist, skipping
Setting up table: planet_osm_roads
NOTICE: table "planet_osm_roads" does not exist, skipping
NOTICE: table "planet_osm_roads_tmp" does not exist, skipping
Allocating memory for dense node cache
Out of memory for node cache dense index, try using "--cache-strategy sparse" instead
Error occurred, cleaning up
Try also sudo -u postgres osm2pgsql --create --cache-strategy sparse -s -U postgres -d sandbox brazil-latest.osm.pbf
but some error: "Allocating memory for sparse node cache
Out of memory for sparse node cache, reduce --cache size
Error occurred, cleaning up
"
Try also osm2pgsql -c -d sandbox -U postgres -H localhost -S brazil-latest.osm.pbf
that say "Usage error".
Try also osm2pgsql -U postgres --slim -C 20000 -d sandbox --host localhost --number-processes 20 ./brazil-latest.osm.pbf
but "Error: Connection to database failed: fe_sendauth: no password supplied".
sudo -u postgres osm2pgsql -U postgres --slim -C 20000 -d sandbox --host localhost --number-processes 20 ./brazil-latest.osm.pbf
say "Error: Connection to database failed: fe_sendauth: no password supplied".
-C
option is correct (!), I try with-C 2000
(same error) them-C 200
and it works! It is a 1GB RAM DigitalOcean servelet.