Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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**
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. stackoverflow.com/questions/6112427/osm-tilecache-and-mapnik/…. It is looking like this will fix my problem. –  Nik May 24 '11 at 15:55
add comment
up vote 3 down vote accepted

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!

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
add comment

Your Answer

 
discard

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.