Hello,

my apologies for sending a too long message first.  I hope the admin cancelled 
it.

In osm.xml the GPX source file can be inserted (near the end).
When executing "do_track.py", no track is drawn.

Here's the original message:


Hello Dane,

> > is it a hint on what goes wrong?
>
> No, I think you will need to post a full test case, ideally with a
> sample (small) gpx dataset and sample xml styles.

I stripped the files down quite a bit and attached them to this mail.
A guess is that the problem is something really simple, a typo or
similar...

None of the attached GPX files work.  One of them is based on the
example found on Wikipedia.


Best regards,
Torsten.

Attachment: osm_track.xml
Description: XML document

#! /usr/bin/python
#coding: latin-1

"""
"""

from mapnik import *
import sys, os


mapfile = "osm_track.xml"
#ll = (8.9, 48.9, 9.1, 49.0)
ll = (-180.0, -89.0, 180.0, 89.0)
imgx = 1600
imgy = 1200

map_uri = "out.png"

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)
e = m.envelope()

print "c0.x", e.minx
print "c0.y", e.miny
print "c1.x", e.maxx
print "c1.y", e.maxy

print "scale", m.scale(), 1.0 / m.scale()
print "denom", m.scale_denominator()

im = Image(imgx, imgy)
render(m, im)
view = im.view(0, 0, imgx, imgy)
view.save(map_uri, 'png')

Attachment: test.gpx
Description: XML document

Attachment: ttrack.gpx
Description: XML document

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

Reply via email to