如何从 GeoPt 属性中提取经纬度?
我正在扩展 GeoModel 以在数据存储中存储位置,以便可以更有效地进行基于地理的搜索,并且我假设可以使用 GeoPt 属性来存储纬度和经度。并且存储工作正常。但我完全不知道如何从实体中提取经纬度。
我一定错过了一些简单的东西,但我实际上找不到 GeoPt 类型的文档,所以我正在寻找有关受支持方法的帮助。
class StopLocation(GeoModel):
stopID = db.StringProperty()
def create(stopID,lat,lon):
stop = StopLocation()
stop.stopID = stopID
stop.location = GeoPt(lat,lon)
latitude = stop.location???
I'm extending the GeoModel to store locations in the datastore so I can do geo-based searches more efficiently and I assumed I could 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???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那不行吗?
Does that not work?