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
WFS 2.0 paging problem with Postgis and BBOX #6181
Comments
When playing with the SQL Server driver I tried using FILTER rather than STIntersects.
When getting shapes for display, extra features are fine as they simply get dropped when drawing. WFS however would return these false positives. Possible options:
|
It would also be worth trying to implement |
ST_Intersects also uses the spatial index, so while there will be a slow-down, it should only be proportional to the number of features actually intersecting the BBOX |
Geoserver has a setting "Loose bbox" in PostGIS connection settings for controlling this behavior https://docs.geoserver.org/stable/en/user/data/database/postgis.html#postgis-loose-bbox. With the default setting BBOX filter is using the fast path. Clever enough WFS users can also make the selection by themselves: Intersects filter is always performing the accurate comparison while BBOX maybe not. PostGIS used to be slow with ST_Intersects but nowadays it is really using the spatial index so perhaps it could use ST_Intersects directly. With some other data sources (GeoPackage, shapefile etc.) the accurate BBOX/Intersects can only be achieved by making the final filtering with Mapserver. That makes is hard to get the paging to work in a reliable way. |
If we knew that the data source was doing an accurate intersection test upstream then perhaps MapServer could skip that test in msQueryByRect(). |
…w-up of fixes MapServer#6181, fixes MapServer#6230) (fixes MapServer#6347 (comment))
…w-up of fixes MapServer#6181, fixes MapServer#6230) (fixes MapServer#6347 (comment))
MapServer ver 7.6.1
Mapserver requests features from Postgis with a query similar to this:
The use of && for better performace will only checking if the bounding boxes of geometry intersects.
docs/overlaps_geometry_box2df.html
In the file mapquery.c#L1252
a more restrictive check is then performed, for exmple msIntersectPolygons
which in same case can exclude some geometries returned from db breaking the paging mechanism.
In the images you can see a case of a geometry returned by Postgis but excluded from Mapserver check,
which breaks the feature count for the pagination calculation.
The text was updated successfully, but these errors were encountered: