Why not ask your question on the new OpenStreetMap Community Forum?

The goal:

I am attempting to generate map tiles with EPSG:4326 instead of web mercator by specifying EPSG:4326 in the mapnik style file srs attributes

My current setup:

I am running Ubuntu 14.14 LTS and have followed the switch2osm.org manually-building-a-tile-server-14-04 instructions. Using the default projection, I was able to successfully import data and serve tiles to a client. I am using the stack of osm2pgsql, renderd, mapnik, mod_tile, apache, postgres, and the OSM Bright stylesheet.

To import I used:

osm2pgsql --slim -d gis -C 16000 --number-processes 3 mapdata.osm.pbf

Then to run renderd:

sudo -u mapnik renderd -f -c /usr/local/etc/renderd.conf

At this point, I had everything working to serve up web mercator.

Attempting to serve tiles in EPSG:4326:

First I reimported the data with osm2pgsql using the -l flag:

osm2pgsql  -l --slim -d gis -C 16000 --number-processes 3 mapdata.osm.pbf

I then updated the mapnik stylesheet map and layer srs attributes to match what was defined in http://spatialreference.org/ref/epsg/4326/mapnik/

srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"

When starting renderd I will then receive the error:

"Unknown projection string, using web mercator as never the less.
 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"

I also attempted a few other options:


srs="+proj=longlat +datum=WGS84 +no_defs"

After seeing a post recommending to check if proj-epsg package is installed, I was heading down the path that proj was missing on my system (https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting#proj_init_error)

Per this proj init error guide I reinstalled proj to no effect.

I confirmed I do have it:

~$ proj
Rel. 4.8.0, 6 March 2012
usage: proj [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ]

I have checked my /usr/share/proj/epsg file and it contains an entry:

# WGS 84
<4326> +proj=longlat +datum=WGS84 +no_defs  <>

The guide shows a different path to /usr/local/share/proj/epsg. On my system it is /usr/share/proj/epsg


Do I need to configure mapnik or renderd somehow to be able to use proj?

Is my proj epsg file in an atypical location?

Is there any other information that would be useful?

Also, are there any other methods I could attempt to use to get finer debugging?

Some of the configuration files:





problem snippet EPSG:4326 version of mapnik OSMBright.xml:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+proj=longlat +datum=WGS84 +no_defs" 
font-directory="./fonts" background-color="#c4dff6"

working snippet web mercator version of mapnik OSMBright.xml:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" 
font-directory="./fonts" background-color="#c4dff6"

Thanks for any thoughts.

asked 29 Apr '16, 19:49

jsitarski's gravatar image

accept rate: 0%

I am struggling with the same problem, and do not want to use MapProxy. Did you find a solution?

(30 Jun, 09:55) Kcok
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

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



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:


question asked: 29 Apr '16, 19:49

question was seen: 3,007 times

last updated: 30 Jun, 10:38

powered by OSQA