如何查询“附近"的实体?使用Google App Engine中的GeoPt属性? [英] How do I query for entities that are "nearby" with the GeoPt property in Google App Engine?

查看:64
本文介绍了如何查询“附近"的实体?使用Google App Engine中的GeoPt属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该如何创建一个GQL查询,以根据其GeoPt属性返回最近的实体(从当前位置开始)?我是否应该创建一个距离"函数来计算一组具有相当近距离的实体?

How should I create a GQL query that returns the nearest entities (from my current location) based on their GeoPt property? Should I just created a 'distance' function that calculates for a set of entities with a reasonably close distance?

提前谢谢!

推荐答案

App Engine不特别处理GeoPt属性-它没有内置的空间索引.但是,有许多第三方库增加了对空间索引的支持. (我认为)最好的是地理模型.

App Engine doesn't treat GeoPt properties specially - it has no built in spatial indexing. There are a number of third-party libraries that add support for spatial indexing, however. The best one (in my opinion) being geomodel.

这篇关于如何查询“附近"的实体?使用Google App Engine中的GeoPt属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆