views:

390

answers:

1

I could use a third dimension in my current project, which strongly involves google-maps and django. How do I deal with this?

class Waypoint(models.Model):
    latlng = models.PointField()

>>> p = Point( 5, 10, 20)
<Point object at Ox...>
>>> p.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng = p
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w.save()
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,0</coordinates></Point>'
                              ^

Note third diemsnion is ignored. GRRR!

A: 

Here is the answer: http://groups.google.com/group/geodjango/browse_thread/thread/12431e87ea78248d#

Andrew Johnson
I'll give this a try.
TokenMacGuy