Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been trying for two and a half weeks so far to get a local copy of OpenStreetMap running on a server. I have downloaded the planet file and imported it into a PostGIS database called 'osm'. I have used OSM Mapnik tools to generate an XML stylesheet for Mapnik to use. I have used TileLite to prove that Mapnik can render OSM tiles from the database. The tiles even look the way that I want them to look.

My problem now is that I cannot get TileCache to work with Mapnik. I have a MapServer instance installed that I am using to serve Shapefiles. This works with TileCache. The default 'basic' layer in the TileCache configuration file works as well. Please help with my OSM layer:


I have read every last blog post, forum post, and tutorial I can find. Any help would be appreciated. I suspect I have either missed something or I am doing something stupid. The problem may even be in OpenLayers.

share|improve this question
up vote 3 down vote accepted

I needed my TileCache configuration to look like this:


I also needed to use a TMS layer type in OpenLayers. Everything is better now!

share|improve this answer
Is this the final answer to your own question? – Mapperz May 24 '11 at 17:38
Yeah, as I mentioned, I got the answer over on StackOverflow. – Nik May 24 '11 at 17:46

Is your data in PostGIS in EPSG 900913?

        **Your OSM data in postgis must be in EPSG 900913 or Spherical Mercator**
share|improve this answer
It is. I got a comment over on StackOverflow about using a TMS layer in OpenLayers, as well as simplifying my TileCache config.…. It is looking like this will fix my problem. – Nik May 24 '11 at 15:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.