Closed larsks closed 2 weeks ago
Hi, thank you for using gpx
and reaching out! 😃
This it not a typo, at least not on our end. The actual property names for latitude and longitude are lat
and lon
, respectively. For reference, check out the API reference on the Waypoint object.
The code snippet below works as advertised:
>>> from gpx import GPX, Waypoint
>>> g = GPX()
>>> wpt = Waypoint()
>>> wpt.lat = 52.123
>>> wpt.lon = 4.123
>>> g.waypoints.append(wpt)
>>> print(g.to_string())
<gpx version="1.1" creator="PyGPX">
<wpt lat="52.123" lon="4.123"/>
</gpx>
I think there's clearly a bug. That example was copy-and-pasted straight from the README. I did not just sit down and make up attribute names in my head.
I'm happy to open a new document bug if you would prefer.
This looks like a typo: