-
Notifications
You must be signed in to change notification settings - Fork 84
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
Comments
CC @aaime |
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. |
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. |
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 |
Just tested it. Yes, it returns true |
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. |
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. |
Worth having a CITE test for this? |
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.) |
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)
The text was updated successfully, but these errors were encountered: