1

I have an XML stylesheet like below:

map:

<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" background-color="#b8dee6" >

A cover layer in:

<Layer name="cover" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">

and another like:

<Layer name="line" srs="+proj=utm +zone=39 +ellps=WGS84 +datum=WGS84 +units=m +no_defs">

And I can render picture with Mapnik via this script:

import mapnik
ll = (53.8889,26.481,54.0681,26.5971)
z=12
imgx = 50 * z
imgy = 50 * z
m = mapnik.Map(imgx,imgy)
mapfile = 't'
prj = mapnik.Projection("+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 +no_defs +over")
c0 = prj.forward(mapnik.Coord(ll[0],ll[1]))
c1 = prj.forward(mapnik.Coord(ll[2],ll[3]))
print c0,c1

mapnik.load_map(m,mapfile)
bbox = mapnik.Envelope(c0.x,c0.y,c1.x,c1.y)
m.zoom_to_box(bbox)
mapnik.render_to_file(m, 'test10.png')

But I can't generate tile with tilecache:

tilecache.cfg:

type=Mapnik
mapfile=/home/test.xml
srs=EPSG:900913
bbox=53.8944,26.4911,54.054,26.5820
  • What happens when you try? Do you get an error message? – Martin Mar 7 '14 at 11:46
  • no. tile generated without any error . but number of tile is not true. and tiles do not have any map. – Hasan Ramezani Mar 7 '14 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.