This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Has anyone successfully loaded OSM to PostgreSQL with osm2pgsql on Windows lately?

1

I can't seem to find any clear and current documentation on the process and am stuck here:

E:\GIS_Data\OSM>osm2pgsql -v -U maugust -W -s --host localhost 4096 -S default.s tyle -d POSTGIS US-WEST-LATEST.OSM.BZ2 osm2pgsql SVN version 0.69-21289M

Password: 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 PREPARE get_way (int4) AS SELECT AsText(way) FROM planet_osm_point WHERE osm_id = $1; failed: ERROR: function astext(geometry) does not exist LINE 1: PREPARE get_way (int4) AS SELECT AsText(way) FROM planet_osm... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

Error occurred, cleaning up

I've read this http://forum.openstreetmap.org/viewtopic.php?id=16350 which seems to indicate that some things in Post GIS 2.0+ are broken for windows? Are there any workarounds for this, and any further, renamed columns/fields, etc.? or are Windows users at PostGIS 2.0 simply unable to load OSM data with osm2pgsql?

Thanks for any suggestions!

asked 28 May '14, 17:15

aug_aug's gravatar image

aug_aug
16111
accept rate: 0%

So I made it past the above when I ran basically all of the tweaks here:

https://github.com/springmeyer/win-osm-workshop/blob/master/Tutorial.md#step-6-configure-the-osm-postgis-database

...now my osm data appears to load into my PostGIS database however now I'm stuck at a "key (id) = xxx...duplicate key value violates unique constraint..." error - anyone have any ideas?

(28 May '14, 20:59) aug_aug
1

I load stuff into PostgrSQL/PostGis on Windows all the time (both on XP SP3 and Windows 8.1). My main config is PostgreSQL 9.3 and PostGIS 2.x: you really need to give versions (and possibly dates) of all major components. Not sure that this help forum is place to solve what look like problems specific to your config.

(28 May '14, 21:48) SK53 ♦

Source code available on GitHub .