Hello everybody,

First of all, sorry for my poor english.

I'm rendering a map loading osm.xml, but I want to print over the map a
track (route, or whatever). This route are in a GML file, so there is a way
to do this?

I'm using the example code:

from mapnik import *
import sys, os

if __name__ == "__main__":
    try:
        mapfile = os.environ['MAPNIK_MAP_FILE']
    except KeyError:
        mapfile = "osm.xml"
    map_uri = "image.png"

    #---------------------------------------------------
    #  Change this to the bounding box you want
    #
    ll = (-6.5, 49.5, 2.1, 59)
    #---------------------------------------------------

    z = 10
    imgx = 500 * z
    imgy = 1000 * z

    m = Map(imgx,imgy)
    load_map(m,mapfile)
    prj = 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 +nadgri...@null +no_defs +over")
    c0 = prj.forward(Coord(ll[0],ll[1]))
    c1 = prj.forward(Coord(ll[2],ll[3]))
    bbox = Envelope(c0.x,c0.y,c1.x,c1.y)
    m.zoom_to_box(bbox)
    im = Image(imgx,imgy)
    render(m, im)
    view = im.view(0,0,imgx,imgy) # x,y,width,height
    view.save(map_uri,'png')

I read that rendering maps follow the painter's algorithm. So, in case that
I could print the route over the map, this code will be previos render(m,im)
line?

Thanks,
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to