1

我正在尝试实现 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

参考

谢谢!

4

1 回答 1

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-02-10T10:17:28.653 回答