geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
459 stars 250 forks source link

BBOX for Postgres returning unwanted results #1666

Open webb-ben opened 1 month ago

webb-ben commented 1 month ago

Description Using the bbox intersection with a postgres backend results in items being returned that do not match the filter

Steps to Reproduce Steps to reproduce the behavior:

Go to https://reference.geoconnex.us/collections/mainstems/items?bbox=-109.448547,36.611118,-107.668762,37.322120&properties=uri&limit=1000

Notice that https://geoconnex.us/ref/mainstems/29559 is included in the result although it does not intersect the bbox. It seems the bbox of the feature might intersect with the input bbox.

Expected behavior Only items that intersect with the input bbox are returned as in returned for the CQL request: https://reference.geoconnex.us/collections/mainstems/items?filter=INTERSECTS(geom,%20POLYGON((-109.448547%2036.611118,%20-109.448547%2037.322120,%20-107.668762%2037.322120,%20-107.668762%2036.611118,%20-109.448547%2036.611118)))&limit=1000

Screenshots/Tracebacks

image image

Environment

Additional context Related to https://github.com/DOI-USGS/nhdplusTools/issues/386