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

Is bbox=x,y,x,y a invalid/empty bbox or a point ? #288

Closed
rouault opened this issue Nov 7, 2019 · 9 comments · Fixed by #346
Closed

Is bbox=x,y,x,y a invalid/empty bbox or a point ? #288

rouault opened this issue Nov 7, 2019 · 9 comments · Fixed by #346
Assignees
Labels
OGC API: Features Issue related to feature resources (see #190) Part 1: Core Issue related to Part 1 - Core

Comments

@rouault
Copy link
Contributor

rouault commented Nov 7, 2019

The spec doesn't mention if a bbox degenerated to a single point (like bbox=2,49,2,49) should be considered as a geometry-with-point intersection or geometry-with-empty intersection. From a client side of view, it would be great to have some clarification. In the case where this would be legit for servers to interpret this a geometry-with-empty intersection, clients might replace their query with a small rectangle around the point (like box=1.99,48.99,2.01,49.01)

@rouault
Copy link
Contributor Author

rouault commented Nov 7, 2019

CC @aaime

@cportele
Copy link
Member

cportele commented Nov 7, 2019

Why would a degenerate bounding box (point or horizontal/vertical line) be considered "empty"? It specifies a non-empty set of positions. If the bbox is a point then everything that intersects that point should be matched.

@aaime
Copy link
Contributor

aaime commented Nov 7, 2019

The underlying library we use for intersections, JTS, considers the polygon generated from the empty bbox as non intersecting... probably because it's not a valid one, topologically speaking (the intersection process is a two step, first checking that envelopes intersect, and then doing a polygon vs polygon intersection that ensures the bbox actually intersects the geometry). I guess we could make it work so that if the bbox is a empty one, a point in polygon test is done instead.

@cportele
Copy link
Member

cportele commented Nov 7, 2019

Thanks @aaime, I wasn't aware of that behaviour in JTS.

The Simple Features for SQL spec does not discuss degenerate envelopes either, if I recall correctly. Does anyone know what the SQL implementations (PGIS, Oracle, etc.) do? I think PGIS would return true for something like SELECT ST_Intersects(ST_Envelope('POINT(2 49)'::geometry), 'LINESTRING ( 2 49, 3 49 )'::geometry)?

@rouault
Copy link
Contributor Author

rouault commented Nov 7, 2019

I think PGIS would return true for something like SELECT ST_Intersects(ST_Envelope('POINT(2 49)'::geometry), 'LINESTRING ( 2 49, 3 49 )'::geometry)?

Just tested it. Yes, it returns true

@jampukka
Copy link
Contributor

jampukka commented Nov 7, 2019

My implementation seems to return features that intersect with point bbox (x,y,x,y) and also with a line (x1,y,x2,y) or (x,y1,x,y2). However for collections with point/linestring features it's unlikely for the specified point to hit any of the features due to inaccuracies caused by reprojection and floating point<->decimal conversions.

@cportele cportele added Part 1: Core Issue related to Part 1 - Core OGC API: Features Issue related to feature resources (see #190) labels Dec 19, 2019
@cportele cportele added this to the Part 1, Version 1.0.1 milestone Dec 19, 2019
@cportele
Copy link
Member

cportele commented Jan 20, 2020

Web-meeting 2020-01-20: A degenerated bbox is a point and should be evaluated as a point.

We should check the other databases beside PostGIS to confirm that this is the interpretation of the DBs, too.

@aaime
Copy link
Contributor

aaime commented Jan 20, 2020

Worth having a CITE test for this?

@cportele cportele self-assigned this Mar 3, 2020
@cportele
Copy link
Member

cportele commented Mar 3, 2020

Meeting 2020-03-03: Confirmed the conclusion in the 2020-01-20 meeting. Clarification text will be added (no change to the requirements).

(A test case in the CITE ETS could be useful.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OGC API: Features Issue related to feature resources (see #190) Part 1: Core Issue related to Part 1 - Core
Projects
Development

Successfully merging a pull request may close this issue.

4 participants