Spatial types

Spring Data Neo4j 支持下列空间类型

Spring Data Neo4j supports the following spatial types

Supported conversions

  • Spring Data common’s Point (must be a WGS 84-2D/SRID 4326 point in the database)

  • GeographicPoint2d (WGS84 2D/SRID 4326)

  • GeographicPoint3d (WGS84 3D/SRID 4979)

  • CartesianPoint2d (Cartesian 2D/SRID 7203)

  • CartesianPoint3d (Cartesian 3D/SRID 9157)

Derived finder keywords

如果你正在使用本机 Neo4j Java 驱动程序 org.neo4j.driver.types.Point 类型,可以在派生查找器方法中使用以下关键字和参数类型。

If you are using the native Neo4j Java driver org.neo4j.driver.types.Point type, you can make use of the following keywords and parameter types in derived finder methods.

在某个区域内查询:

Query inside an area:

  • 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 中。

You could also use a org.springframework.data.geo.Polygon but would need to pass it into a BoundingBox by calling BoundingBox#of.

在某个点附近查询:

Query near a certain point:

  • findBy[…​]Near(org.neo4j.driver.types.Point point) - returns result sorted by distance to the given point ascending

  • 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)