Spatial types

Spring Data Neo4j supports the following spatial typesspring-doc.cn

Supported conversions

Derived finder keywords

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.spring-doc.cn

Query inside an area:spring-doc.cn

  • findBy[…​]Within(org.springframework.data.geo.Circle circle)spring-doc.cn

  • findBy[…​]Within(org.springframework.data.geo.Box box)spring-doc.cn

  • findBy[…​]Within(org.springframework.data.neo4j.repository.query.BoundingBox boundingBox)spring-doc.cn

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:spring-doc.cn

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

  • findBy[…​]Near(Point point, org.springframework.data.geo.Distance max)spring-doc.cn

  • findBy[…​]Near(Point point, org.springframework.data.domain.Range<Distance> between)spring-doc.cn

  • findBy[…​]Near(Range<Distance> between, Point p)spring-doc.cn