I am trying to import OpenStreetMap (osm) data into a PostgreSQL database using osm2pgsql, and then I need to convert that data so I can use it in ArcSDE/ArcGIS Desktop 10.2.

Here is what I do:

  1. Using the PGAdmin GUI tool, I create a database call OSM
  2. I then enabled the PostGIS on the database:

  3. Since I am on a Window environment, I created a path variable to the osm2pgsql.exe

  4. Open a command prompt
  5. Load a small sample set of OSM data:

    osm2pgsql -l -c -d osm -U postgres -H localhost -S C:\osm2psql\default.style C:\temp\refine.osm

At this point I get the error

Projection code failed to initialise

Since I encountered that error, I figured I had to install the proj v.4 lib and I added that to the environmental path, but I still get the issue.

How do you resolve this issue?

I need my data in 4326, not in 900913. I think this is the reason why my data will not show in ArcGIS.

If I load the data without the -l command, which means lat/long, I get an invalid coordinate ID error from ArcGIS Desktop.

closed as off-topic by PolyGeo Feb 24 '18 at 3:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • What happens if you bypass ArcSDE and load the layer using "Query Layer" function in ArcGIS? Also, can you load the data into another software supporting PostGIS and check the correctness? – Michal Mackiewicz Jan 14 '14 at 14:29
  • I don't have another software to check it against, we are an Esri shop. I fixed the projection issue by installing the proj.4 on disk and setting up an environmental parameter called PROJ_LIB pointing to the 'nad' folder. So I'm beyond the spatial reference. I can now view the data in ArcGIS desktop, but I can't see the attribute data. – code base 5000 Jan 14 '14 at 16:05

As per OP's (code base 5000) comment the projection issue was fixed by

"installing the proj.4 on disk and setting up an environmental parameter called PROJ_LIB pointing to the 'nad' folder"


IMHO you need to follow the detailed instructions at www.switch2osm.org so esp. keep the original projection. AFAIK every GIS can then apply an 'on the fly' reprojection, as it knows the propper origin projection.

  • The instructions are for 8.3 PostGres and for linux. I am on a windows box. – code base 5000 Jan 15 '14 at 13:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.