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

proj_init_error

1

Hey guys! When rendering from PostgreSQL/PostGIS database by Python/Mapnik I receice the following ERROR:

proj_init_error:failed to initialize projection with: '+init=epsg:4326'

I took the steps like in http://switch2osm.org/serving-tiles/manually-building-a-tile-server/

My OS is Windows.

I imported my africa.osm by osm2pgsql to my database.

Is it possible, that the whole thing only works with the whole planet_latest.osm?

asked 28 Mar '12, 14:50

MHein's gravatar image

MHein
141111116
accept rate: 0%


3 Answers:

3

Hi,

Did you install the proj library? Usually you get this kind of error if the library cannot be found by programs. If you're not using a package like OSGeo4W, you need to set the environment variables correctly.

From the Windows proj4 README.txt:
PATH=%PATH%;C:\PROJ\BIN
PROJ_LIB=C:\Software\PROJ\NAD

The mapnik installation guide for windows also mentions the proj4 library if you're planning on using epsg codes

HTH Frank

answered 30 Mar '12, 15:46

frabron's gravatar image

frabron
3611411
accept rate: 16%

edited 30 Mar '12, 17:21

I'm guessing that there should be some backslashes in that?

(30 Mar '12, 16:10) SomeoneElse ♦

Um, yes, of course. I saw them in the editor preview, but the actual view somehow ate them. I escaped them now ...

(30 Mar '12, 17:22) frabron

Thx.. got bored looking at blank maps

(22 May '12, 08:24) ronzulu

2

@frabon is right in that this error is related to mapnik not seeing the Proj4 libraries.

I was able to fix this problem by creating an Environment Variable, PROJ_LIB, and pointing it to my GDAL installation's grid shift files. On my system it's C:\Program Files\GDAL\projlib.

I thought using the GDAL proj stuff was better than creating a redundant install. Of course, since I'm using true-blue WinXP32, I still needed to logout/login or reboot to apply the change. It definitely did the trick, though.

answered 18 Dec '12, 22:38

elrobis's gravatar image

elrobis
41125
accept rate: 0%

1

Not sure about your problem, maybe you have to load the projection strings into your db (see Postgis docu for this). For your second question: I can confirm that osm2pgsql as well as the rest of the rendering stack works also with extracts, no need to use the whole planet.

answered 30 Mar '12, 14:52

dieterdreist's gravatar image

dieterdreist
3.7k113567
accept rate: 3%

Source code available on GitHub .