Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: SRID expected to be either a number or an Integer object but was: undefined #83

Open
jclappiway opened this issue Dec 1, 2021 · 6 comments

Comments

@jclappiway
Copy link
Contributor

Hello,

I'm having an issue on neo4j spatial point with .transform(XEntity)

Error: SRID expected to be either a number or an Integer object but was: undefined

DEBUG Point { srid: Integer { low: 4326, high: 0 }, x: 50.47511, y: 3.23385, z: undefined }

@jasperblues
Copy link
Member

I will need to check history but I thought point type in Neo4j was supported. This might be a regression. In the meantime you can do what this query does: https://github.com/liberation-data/drivine-inspiration/blob/master/src/movies/moviesForActor-NEO4J.cypher

And unpack the point type into an object with two values, eg:

MATCH (actor:Person {name: $name})
RETURN {
         location:  {lat: actor.location.lat, long: actor.location.lng},
         otherStuff: {name: actor.name} 
       }

If you're interested in sending a PR the code where transformation is done is here:

https://github.com/liberation-data/drivine/blob/master/src/mapper/Neo4jResultMapper.ts

^-- Hmm, yes indeed we can see point should be supported around line 27. Are you doing a read or a write?

@jclappiway
Copy link
Contributor Author

@jasperblues thanks for the tip on unpack point.
I found the file, this is where the DEBUG is coming from.

FYI: the error is gone when I deleted :

if (val instanceof neo4j.types.Point) { return val; }
But we're not getting a neo4j point 👎

It's a read query.

Thanks again !

@jasperblues
Copy link
Member

jasperblues commented Dec 2, 2021

So the desired behavior would be to get some platform agnostic instance of Point ?

By that I mean, instead of return val return new Point(val.lat, val.lng)

Let me also check if any test-cases use the point type. I suspect unfortunately not

@jasperblues
Copy link
Member

Did you get this solved @jclappiway ?

@jclappiway
Copy link
Contributor Author

I used your solution : unpacking the point manually.
Do you want me to fix this ?

@jasperblues
Copy link
Member

Yes pls, if you are happy to @jclappiway !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants