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

Dane Springmeyer blake at hailmail.net
Sun Oct 4 16:12:47 BST 2009


Tom,

There are 10.6 ready binaries of the latest stable release of proj.4  
available here:

http://www.kyngchaos.com/software:frameworks

I use this proj distribution on OSX frequently and have not had a  
problem. If you try this approach, just patch your osm2pgsql Makefile  
like so:

Index: Makefile
===================================================================
--- Makefile	(revision 17981)
+++ Makefile	(working copy)
@@ -7,6 +7,7 @@

  CFLAGS += -g -O2 -Wall -Wextra
  CFLAGS += $(shell xml2-config --cflags)
+CFLAGS += -I/Library/Frameworks/PROJ.framework/unix/include
  CFLAGS += $(shell geos-config --cflags)
  CFLAGS += -I$(shell pg_config --includedir)
  CFLAGS += -DVERSION=\"$(VERSION)-$(SVN)\"
@@ -19,7 +20,8 @@
  LDFLAGS += $(shell geos-config --libs)
  LDFLAGS += -L$(shell pg_config --libdir) -lpq
  LDFLAGS += -lbz2 -lz
-LDFLAGS += -g -lproj
+#LDFLAGS += -g -lproj
+LDFLAGS += -L/Library/Frameworks/PROJ.framework/unix/lib -lproj
  LDFLAGS += -lstdc++
  LDFLAGS += -lpthread


Dane



On Oct 4, 2009, at 7:14 AM, Tom Taylor wrote:

>
> On 4 Oct 2009, at 14:31, Jon Burgess wrote:
>
>> Can you see which proj library cs2cs & osm2pgsql are using?
>> Something like this:
>
> This seems to be the equivalent tool on OS X:
>
> $ otool -l /usr/local/bin/cs2cs |grep proj
>          name /usr/local/Cellar/proj/4.7.0/lib/libproj.0.dylib
> (offset 24)
> $ otool -l ./osm2pgsql |grep proj
>          name /usr/local/Cellar/proj/4.7.0/lib/libproj.0.dylib
> (offset 24)
>
>> 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).
>
> Using dtruss, which is pretty much the same, to trace the execution -
> they both just refer to the same library: /usr/local/Cellar/proj/ 
> 4.7.0/
> lib/libproj.0.dylib.
>
> I guess I'll give up on it on OS X for the time being. I've got an
> Ubuntu Virtual Machine here which is probably going to be a lot  
> easier!
>
> Thanks for your help Jon - much appreciated.
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev





More information about the dev mailing list