> Si tu as un fichier GPX d'exemple
c'est le code que j'utilise pour map.meurisse.org :

def gpx(req,points):
    req.content_type = "application/gpx+xml"
    file = '''<?xml version="1.0" encoding="iso-8859-1" ?>
<gpx
xmlns="http://www.topografix.com/GPX/1/1";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.topografix.com/GPX/1/1http://www.topografix.com/GPX/1/1/gpx.xsd";
version="1.1"
creator="http://map.meurisse.org/";>
<trk><trkseg>
'''
    for point in points:
        file += '<trkpt lat="%f" lon="%f"></trkpt>\n' % (point[0], point[1])
    file += '</trkseg></trk>\n</gpx>'
    return file


-- 
Vincent Meurisse

_______________________________________________
Talk-fr mailing list
Talk-fr@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-fr

Répondre à