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

Using variable in ST_Intersects causes InvalidShapeException #9962

Open
littlemurph opened this issue Apr 7, 2023 · 1 comment
Open

Using variable in ST_Intersects causes InvalidShapeException #9962

littlemurph opened this issue Apr 7, 2023 · 1 comment
Labels
Milestone

Comments

@littlemurph
Copy link

OrientDB Version: 3.2.17 & 3.0.8 running in container

Java Version: 1.8 from container base image

OS: RHEL 8.6 Host

Expected behavior

Should return line records that intersect

Actual behavior

Error: com.orientechnologies.orient.core.exception.OStorageException: Error on executing command: select from line let $geom = (SELECT geom from #14:0) where $geom <> null AND ST_Intersects(aline, $geom) = true
DB name="trick"

Error: org.locationtech.spatial4j.exception.InvalidShapeException: can't make Geometry from: null

Steps to reproduce

I'm trying to find all the "lines" that intersect a specific polygon. My database structure is:

poly {
  geom: OPolygon
}

line {
 aline: OLineString
}
create class poly
create property poly.geom embedded OPolygon
create index poly.geom on poly(geom) spatial engine lucene
create class line
create property line.aline embedded OLineString
create index line.aline on line(aline) spatial engine lucene
insert into poly set name = 'Poly1', geom = ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))')
insert into line set name = 'Line1', aline = St_GeomFromText('LINESTRING(2 10, 2 -5)')

select from line let $geom = (SELECT geom from #14:0) where $geom <> null AND ST_Intersects(aline, $geom) = true

The last select statement throws the error mentioned above (in 3.0.8 it's a nullpointer exception). I am expecting it to return the line since they intersect.

Replacing the $geom in the ST_Intersects with 'POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))' works. I'm not sure why I can't use a variable there.

@tglman tglman added this to the 3.2.x milestone Apr 11, 2023
@tglman tglman added the bug label Aug 7, 2023
@sudoStatus200
Copy link

Hi @tglman ,
I would like to start contributing to orientdb , I have significant amount of experience in working with geospatial tools(postgis + psql , qgis etc) . So I was thinking I will start with this issue.

Is this still a valid issue? and any tips and suggestions for starting contributing to orientdb?

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

No branches or pull requests

3 participants