Skip to content

Commit

Permalink
GH-2410 - Documentation for existing geo features.
Browse files Browse the repository at this point in the history
Closes #2410
  • Loading branch information
meistermeier committed Nov 1, 2021
1 parent 8c262f9 commit 688662c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/asciidoc/appendix/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ include::query-creation.adoc[]

include::custom-queries.adoc[]

include::spatial-types.adoc[]

include::migrating.adoc[]

include::build.adoc[]
Expand Down
34 changes: 34 additions & 0 deletions src/main/asciidoc/appendix/spatial-types.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[[spatial-types]]
= Spatial types

Spring Data Neo4j supports the following spatial types

[[spatial-types.conversion]]
== 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)

[[spatial-types.derived-finder]]
== 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.

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

NOTE: 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)`

0 comments on commit 688662c

Please sign in to comment.