OrientDB地理位置 [英] OrientDB geolocation

查看:170
本文介绍了OrientDB地理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

OrientDB函数



但不理解值的意义。



距离函数:
$ b


distance() - 使用Haversine算法计算全球两点之间的距离。坐标必须为度数

示例:


其中distance(x,y,52.20472,0.14056)<= 30

两个问题:


  1. X,Y和30值是什么?

  2. 值(52.20472,0.14056)是经度还是纬度?

谢谢!

解决方案

距离(x,y,52.20472,0.14056)≤30

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

考虑另一个例子:

选择距离(经度,纬度, 52.20472,0.14056)<= 30作为与地点距离的距离



该查询将遍历Places Class / Cluster中的记录以及它注入的每个记录记录的经度和纬度并计算它与固定位置的距离(52.20472,0.14056),并返回30米范围内的地方。

其中

Places是包含地点记录的类/簇
经度是当前记录的经度字段
纬度是当前记录的纬度字段
距离是字段名称

I´m using the OrientDB for NoSQL database, and i dont know how to query in geolocation exactly. I´ve read the specific documentation:

OrientDB Functions

but does not understand the significance of the values.

The distance function:

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

Example:

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

Two questions:

  1. What is the X, Y, and the 30 values?
  2. Are the values (52.20472, 0.14056) latitude and longitude?

Thanks!

解决方案

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

x and y are the longitude and latitude (variables) respectively of the record/position which you are calculating distance from the fixed coordinates 52.20472, 0.14056.

consider another example:

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

This query will loop through the records in the Places Class/Cluster and for each record it injects the longitude and latitude of the record and calculate it's distance to the fixed position (52.20472, 0.14056) and return the places that are within 30m.

where

Places is a class/cluster which contains records of places longitude is the longitude field of the current record latitude is the latitude field of the current record distance is an alias for the field name

这篇关于OrientDB地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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