7

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:

[osm]
type=Mapnik
mapfile=/var/maps/bin/mapnik/osm.xml
spherical_mercator=true
bbox=-16697000,8610000,-16667000,8640000
maxResolution=156543.0339/4
levels=18
srs=EPSG:900913

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.

2 Answers 2

4

I needed my TileCache configuration to look like this:

[osm]
type=Mapnik
mapfile=/var/maps/bin/mapnik/osm.xml
spherical_mercator=true

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

2
  • Is this the final answer to your own question?
    – Mapperz
    May 24, 2011 at 17:38
  • Yeah, as I mentioned, I got the answer over on StackOverflow.
    – Nik
    May 24, 2011 at 17:46
1

Is your data in PostGIS in EPSG 900913?

http://code.google.com/p/mapnik-utils/source/browse/example_code/tilecache/openlayers_osm.html

        **Your OSM data in postgis must be in EPSG 900913 or Spherical Mercator**
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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