Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-12-2020 02:18 AM
Hi, I'm loading data to neo4j DB using python script via py2neo api. I have a use case where I have a 'Geometry' field which is going to be populated as a pair of numbers which will corresponds to Latitude and Longitude, like: 'Geometry':[48.965, 7.456]. Is there a way to add this Geometry object as a list of number in neo4j. Does neo4j supports the attribute values to be of list or array type ?
If so, how can it be done via py2neo api.
11-12-2020 04:12 AM
I would suggest to use neo4j's point type, and not use an array of numbers - these will be easier to query, and Neo4j has built-in spatial functions that will let you work with data like that
py2neo looks like it supports spatial types here:
and you would need to use wgs842d to represent your points with latitude and longitude (read this: https://neo4j.com/docs/cypher-manual/current/syntax/spatial/#cypher-spatial-crs-geographic)
12-01-2020 09:05 PM
In the continuation of the above thread, i wanted to know if there is a way to add Multipoint like MULTIPOINT ((10 40), (40 30), (20 20), (30 10))
Or
MULTIPOINT (10 40, 40 30, 20 20, 30 10)
in neo4j. I'm able to add Point as an attribute to a node using the following code from python
import py2neo.data.spatial as sp
point = sp.WGS84Point((4.123, 7.345))
But it seems like py2neo has support only for points which includes 'CartesianPoint' and 'WGS84Point'.
Is there a way to add Multipoint as an attribute too ?
Thanks
All the sessions of the conference are now available online