[OSM-talk-fr] Osmose & CLC 06 & GPX
Vincent Meurisse
osm-talk-fr at meurisse.org
Lun 12 Oct 12:28:56 UTC 2009
> 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
Plus d'informations sur la liste de diffusion Talk-fr