在数据存储中搜索10个最近的地点 [英] Search 10 nearest Locations in Datastore

本文介绍了在数据存储中搜索10个最近的地点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多包含存储在Google数据存储区中的geoPoints的实体。
现在,我需要根据发送给Google Cloud Function的位置获取最近的10个位置。

我看到,在 distance()函数中Google的App Engine,但在Google云端函数中没有任何可比性,甚至没有可能计算数据库中的任何内容。



是否有可能从数据存储库中获取10个最近的位置使用谷歌云功能还是需要使用不同的数据库?



最好的问候,

Pascal


我们在AppEngine上运行了一个地理空间服务。



我们的解决方案是将位置存储在Memcache并直接进行计算,而不是依赖数据库。



这显然取决于位置数量,但如果您对存储位置的方式很在行,可以很快搜索。



R-Trees是一个很好的例子: https://en.wikipedia.org/wiki/R-tree


I have a lot of Entities containing geoPoints stored in Google's Datastore. Now I need to get the 10 nearest locations based on a Location sent to a Google Cloud Function.
I saw, that there is a distance() function in Google's App Engine, but nothing comparable in Google Cloud Functions, not even the possible to calculate anything in the Database.

Is it possible to get the 10 nearest Locations from Datastore only using Google Cloud Functions or do I need to use a different Database for that ?

Best Regards,
Pascal

解决方案

We run a geospatial-heavy service on AppEngine.

Our solution is to store the locations on Memcache and doing the calculations directly instead of relying on the database.

This obviously depends on the amount of locations, but if you are clever about how you store the locations, you can search very quickly.

R-Trees are a very good example: https://en.wikipedia.org/wiki/R-tree

这篇关于在数据存储中搜索10个最近的地点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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