【问题标题】:How to query location "within" in OrientDB 2.2.x Spatial Module in Java?如何在 Java 中的 OrientDB 2.2.x 空间模块中查询“内部”位置?
【发布时间】:2017-06-27 09:31:42
【问题描述】:

我正在尝试实现 OrientDB 空间模块,需要一些帮助以使用 Java 对其进行编码。

如何在 Java 中进行等价查询:

select *,ST_Distance_Sphere(location,ST_GeomFromText('POINT(12.4696635 41.8894657)')) as distance from Points where ST_Distance_Sphere(location,ST_GeomFromText('POINT(12.4696635 41.8894657)')) < 200 order by distance

Reference

谢谢!

【问题讨论】:

  • java 中没有等价物。你应该执行一个命令/查询你将如何在 java 中运行它?
  • 我认为有一些方法可以构建查询并执行它。

标签: java geospatial orientdb spatial orientdb2.2


【解决方案1】:

唯一的办法就是使用OSQL:

    List<ODocument> execute = db.query(new OSQLSynchQuery<ODocument>(
    "select   *,ST_Distance_Sphere(location,ST_GeomFromText('POINT(12.4696635 41.8894657)')) as distance from Points where ST_Distance_Sphere (location,ST_GeomFromText('POINT(12.4696635 41.8894657)')) < 200 order by distance"));

有帮助吗?

【讨论】:

    猜你喜欢
    • 2017-06-27
    • 1970-01-01
    • 2021-12-23
    • 1970-01-01
    • 1970-01-01
    • 2021-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多