-
Notifications
You must be signed in to change notification settings - Fork 147
Initial spatial support using Point type #334
Conversation
Upstream merge
Upstream merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is looking good @michaeldgraham , but could you please add a little more test coverage? Specifically, I'd like to see tests that use the latitude/longitude fields (in addition to the use of the x,y,z fields) and a couple of integration tests that demonstrate creating/querying a Point type in the database. Thanks!
Codecov Report
@@ Coverage Diff @@
## master #334 +/- ##
==========================================
+ Coverage 96.27% 96.46% +0.19%
==========================================
Files 23 24 +1
Lines 2576 2606 +30
==========================================
+ Hits 2480 2514 +34
+ Misses 96 92 -4
Continue to review full report at Codecov.
|
Great PR! We were waiting this geospatial support for our project. We're looking forward to see this published in next version! |
Includes refactoring that unifies some logic used by both temporal and spatial types
🎉 🌐 |
This PR contains initial support for Neo4j spatial properties.
Schema Augmentation
Point
types are now translated using updated transformations in the schema augmentation process, similar to the current behavior of the Neo4j temporal types (Time, Date, DateTime, etc.). Output typePoint
fields are transformed to_Neo4jPoint
and input typePoint
fields are transformed to_Neo4jPointInput
.To support this, the following type definitions are now generated in the schema augmentation process:
Configuration
Similar to the temporal configuration for the augmentation process, generated spatial type support can be disabled by configuring:
For more information about spatial values and their constructor functions in Cypher, see:
https://neo4j.com/docs/cypher-manual/current/syntax/spatial/#cypher-spatial-instants
Tests
The following tests have been added:
Node
Read
Query node with spatial properties using spatial arguments
Nested Query with spatial property arguments
Write
Create node with spatial properties
Delete node using spatial property node selection
Update node spatial property using spatial property node selection
Relationship
Read
Query relationship with spatial properties
Write
Add relationship mutation using spatial property node selection
Add relationship mutation with spatial properties
Remove relationship mutation using spatial property node selection
Computed
Handle
@cypher
query with spatial payloadHandle
@cypher
mutation with spatial payloadConfiguration
Config - spatial - disable spatial schema augmentation