Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

osm2pgsql windows "illegal option -W" error

tI'm trying to import map data into a postgis DB on windows. I've doing this for years using osm2pgsql but the latest update of Spain map generates a duplicate key error. It seems to be a 64 bit version issue. Is there a way to avoid this problems? I tried to sort it first using osmosis but i get the same error.

Another question. I downloaded new osm2pgsql version (February 6, 2013) and i can't make it work. It shows "illegal option --w". I use the following (which allways worked with previous versions)

 "osm2pgsql -c -d osm  -s  -S C:\sw\osm2postgre\default.style -U postgres -W -H localhost -P 5432 c:\mapas\spain.osm.bz2"
like image 730
naaas Avatar asked Mar 05 '26 20:03

naaas


1 Answers

The new version doesn't allow you to insert your password with -w, instead you have to set your password into the environment variable pgpassword before running osm2pgsql, like so:

SET pgpassword=postgres

For example.

like image 126
Yair Morgenstern Avatar answered Mar 07 '26 10:03

Yair Morgenstern



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!