[OSM-dev] Trouble with osm2pgsql and Postgres 8.4, Postgis 1.4

Jon Burgess jburgess777 at googlemail.com
Sun Oct 4 14:31:46 BST 2009


On Sun, 2009-10-04 at 14:04 +0100, Tom Taylor wrote:
> On 4 Oct 2009, at 13:49, Jon Burgess wrote:
> 
> > I updated the proj strings to match those in the 4.7.1 definition  
> > files
> > in r17981. Can you see if those work for you now?
> 
> Jon, I'm afraid not:
> 
> $ ./osm2pgsql -d osm ~/Downloads/great_britain.osm.bz2
> osm2pgsql SVN version 0.67-17981
> 
> Projection code failed to initialise

I can only think that something is inconsistent in your proj setup, e.g.
maybe mixing a custom proj library with the system projection or datum
definitions.

Can you see which proj library cs2cs & osm2pgsql are using?
Something like this:

$ ldd osm2pgsql | grep proj
        libproj.so.0 => /usr/lib64/libproj.so.0 (0x00007fd198360000)

$ type cs2cs
cs2cs is hashed (/usr/bin/cs2cs)
[jburgess at shark osm2pgsql]$ ldd /usr/bin/cs2cs | grep proj
        libproj.so.0 => /usr/lib64/libproj.so.0 (0x00007ff3a4468000)

Then if you feel like digging deeper to see what the code for each
program does when asked to initialize the projections then collect the
strace output:

$ strace -o /tmp/osm2pgsql.txt -f osm2pgsql great_britain.osm.bz2
$ strace -o /tmp/cs2cs.txt     -f cs2cs +init=epsg:4326 +to +init=esri.extra:900913

Then compares the output in cs2cs.txt vs osm2pgsql.txt. There will be a
lot of information in there. Towards the end you should see it opening
and reading various proj data files from /usr/share/proj (or similar).

If you get stuck, try attaching them to an email and send direct to me.
They will be too big for the email list.

	Jon






More information about the dev mailing list