dou1908 2016-08-06 22:17
浏览 75
已采纳

AppEngine:Go下的地理空间查询

There appears to be geospatial-query support under Java (https://cloud.google.com/appengine/docs/java/datastore/geosearch) but there appears to be absolutely no documentation for doing the same under Go. Grepping google.golang.org/appengine for "geo" renders nothing but construction and validation of GeoPoint values.

Since Java supports this the API support must obviously be there. Does anyone have any experience with this or advice? Thanks.

Edit:

It looks like what limited support there is is only offered for Java:

http://startup-with-gae.blogspot.com/2016/01/geospatial-queries-with-google-cloud.html

  • 写回答

1条回答 默认 最新

  • donglu3087 2016-08-18 18:42
    关注

    It's, officially, completely unsupported in Datastore at this time. Use geohashes: https://github.com/gansidui/geohash/blob/master/geohash.go . It reduces this fro ma geospatial-storage/RTREE support problem to a string prefix-search.

    It allows you derive a hash that describes a particular location, and then you can take this string and successively remove characters from the right side (and do string prefix-searches against your list of places and their geohashes with what remains) to find places near your principal location and expanding outward.

    There is a predictable amount of geographic precision between each adjacent character of a geohash string, so you can either use this or the common prefix bytes between the principal point and the corner latitude/longitude of the map window to identify all places that should appear within it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程