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 am using tm_wgs84_sans_antarctica.shp with mapnik to generate tiles. I am using the tiles with Google Maps Javascript API V3. But the projection is way off. Here is roughly what my code looks like:

import mapnik
m = mapnik.Map(
s = mapnik.Style()
r = mapnik.Rule()

polygon_symbolizer = mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9'))

m.append_style('My Style',s)

ds = mapnik.Shapefile(file='tm_wgs84_sans_antarctica.shp')
layer = mapnik.Layer('world')
layer.datasource = ds
layer.styles.append('My Style')

bbox = tile.bounds()
bbox = mapnik.Box2d(bbox[0], bbox[1], bbox[2], bbox[3])
im = mapnik.Image( *tile.size() )
mapnik.render(m, im)

As you can see I am not setting any srs either in map or in layer. I tried different combination of projection strings without really understanding what they mean, but either got no map or wrongly projected map. Please let me know if any other information is required.


share|improve this question
is there a prj file with the shp and dbf files? If so it should have the projection information in the prj file. It is in text format. – mhoran_psprep Mar 28 '12 at 21:57
up vote 0 down vote accepted

The prj file has this:


Using srs +init=epsg:4326 which is defined as:

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

fixed the problem. Now the shape file gets rendered fine with google maps.

share|improve this answer

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.