空間型別
Spring Data Neo4j 支援以下空間型別
支援的轉換
-
Spring Data common 的
Point
(必須是資料庫中 WGS 84-2D/SRID 4326 點) -
GeographicPoint2d
(WGS84 2D/SRID 4326) -
GeographicPoint3d
(WGS84 3D/SRID 4979) -
CartesianPoint2d
(Cartesian 2D/SRID 7203) -
CartesianPoint3d
(Cartesian 3D/SRID 9157)
派生查詢器關鍵字
如果您使用的是原生 Neo4j Java 驅動程式 org.neo4j.driver.types.Point
型別,則可以在派生查詢器方法中使用以下關鍵字和引數型別。
查詢區域內
-
findBy[…]Within(org.springframework.data.geo.Circle circle)
-
findBy[…]Within(org.springframework.data.geo.Box box)
-
findBy[…]Within(org.springframework.data.neo4j.repository.query.BoundingBox boundingBox)
您也可以使用 org.springframework.data.geo.Polygon ,但需要透過呼叫 BoundingBox#of 將其傳遞到 BoundingBox 中。 |
查詢某個點附近
-
findBy[…]Near(org.neo4j.driver.types.Point point)
- 返回按到給定點距離升序排列的結果 -
findBy[…]Near(Point point, org.springframework.data.geo.Distance max)
-
findBy[…]Near(Point point, org.springframework.data.domain.Range<Distance> between)
-
findBy[…]Near(Range<Distance> between, Point p)