gpt4 book ai didi

geolocation - OrientDB 地理定位

转载 作者:行者123 更新时间:2023-12-04 17:48:52 26 4
gpt4 key购买 nike

我正在使用 OrientDB for NoSQL 数据库,但我不知道如何准确地查询地理位置。我已经阅读了具体的文档:

OrientDB Functions

但不明白值(value)观的意义。

距离函数:

distance() - Computes the distance between two points in the globe using the Haversine algorithm. Coordinates must be as degrees



例子:

where distance(x, y,52.20472, 0.14056) <= 30



两个问题:
  • X、Y 和 30 值是多少?
  • 值 (52.20472, 0.14056) 是纬度和经度吗?

  • 谢谢!

    最佳答案

    距离(x,y,52.20472,0.14056)<= 30

    x 和 y 分别是您正在计算距固定坐标 52.20472、0.14056 的距离的记录/位置的经度和纬度(变量)。

    考虑另一个例子:

    select distance(longitude, latitude, 52.20472, 0.14056) <= 30 as distance from Places order by distance

    此查询将遍历 Places Class/Cluster 中的记录,并为每条记录注入(inject)记录的经度和纬度,并计算其到固定位置 (52.20472, 0.14056) 的距离并返回 30m 内的地点。

    在哪里

    Places 是一个包含地点记录的类/集群
    longitude 是当前记录的经度字段
    latitude 是当前记录的纬度字段
    distance 是字段名的别名

    关于geolocation - OrientDB 地理定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23032138/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com