More

Error while importing OSM to PostgreSQL

Error while importing OSM to PostgreSQL


I'm trying to import OSM to PostgreSQL using the osm2pgsql tool.

osm2pgsql -cGs -d osm -U postgres -W postgres -H localhost -S /usr/local/share/osm2pgsql/default.style /Users/asmaa/SIG/Projet_SIG/campus.osm

I am getting this output with an error:

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 Using built-in tag processing pipeline Allocating memory for dense node cache Allocating dense node cache in one big chunk Allocating memory for sparse node cache Sharing dense sparse Node-cache: cache=800MB, maxblocks=102400*8192, allocation method=11 Mid: pgsql, scale=100 cache=800 Setting up table: planet_osm_nodes NOTICE: table "planet_osm_nodes" does not exist, skipping Setting up table: planet_osm_ways NOTICE: table "planet_osm_ways" does not exist, skipping Setting up table: planet_osm_rels NOTICE: table "planet_osm_rels" does not exist, skipping ***Reading in file: postgres error while opening file postgres***

Any suggestions?


Your problem is the -W argument in your prompt. This argument does not take any input, but forces a prompt for the postgres user's password. So to solve your problem remove postgres after the -W argument.

osm2pgsql -cGsW -d osm -U postgres -H localhost -S /usr/local/share/osm2pgsql/default.style /Users/asmaa/SIG/Projet_SIG/campus.osm