I'm extending the GeoModel to store locations in the datastore so I can do geo-based searches more efficiently and I assumed I coul开发者_如何学Pythond use the GeoPt property to store latitude and longitude. And the storage has worked fine. But I'm at a complete loss as to how to extract the lat and lon from an entity.
I must be missing something simple but I can't actually find the documentation for the GeoPt type so I'm looking for help on supported methods.
class StopLocation(GeoModel):
stopID = db.StringProperty()
def create(stopID,lat,lon):
stop = StopLocation()
stop.stopID = stopID
stop.location = GeoPt(lat,lon)
latitude = stop.location???
latitude = stop.location.lat
longitude = stop.location.lon
Does that not work?
精彩评论