NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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%


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

permanent link

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

@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.

permanent link

answered 18 Dec '12, 22:38

elrobis's gravatar image

elrobis
41125
accept rate: 0%

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.

permanent link

answered 30 Mar '12, 14:52

dieterdreist's gravatar image

dieterdreist
3.7k113567
accept rate: 3%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×440
×341
×118
×20

question asked: 28 Mar '12, 14:50

question was seen: 7,056 times

last updated: 18 Dec '12, 22:38

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum