-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Inconsistent layer extent between ST_Extent and ST_Estimated_Extent #29533
Comments
Author Name: Andreas Neumann (@andreasneumann) Forgot to add the URL of the WMS: |
Author Name: Alessandro Pasotti (@elpaso)
|
Author Name: Andreas Neumann (@andreasneumann) This issue might not be a server issue. We are experiencing strange things on the Desktop with this data as well (e.g. the extent that QGIS calculates (invalid) is different from the extent that Postgis is calculating (coorect)) Will post more infos when I find out more. |
Author Name: Andreas Neumann (@andreasneumann) More info: SELECT 1 AS pk, st_estimated_extent('ameisen_1700','ameisenschutz','geom') AS geom run in Postgis gives the invalid result that also QGIS uses. |
Author Name: Andreas Neumann (@andreasneumann) Issue is that QGIS uses the ST_Estimated_Extent() from Postgis as layer extent, which may differ from real extent given from ST_Extent() The question is, if QGIS should be using ST_Estimated_Extent(), because it may differe substantially from the real extent given back by ST_Extent() Note that I did not enable the "use estimated table metadata" checkbox. |
Author Name: Marco Bernasocchi (@mbernasocchi) the culprit might be here https://github.com/qgis/QGIS/blob/master/src/providers/postgres/qgspostgresprovider.cpp#L3240 |
Author Name: Andreas Neumann (@andreasneumann) Maybe this line should be:
|
Author Name: Andreas Neumann (@andreasneumann)
|
Author Name: Jürgen Fischer (@jef-n) Andreas Neumann wrote:
Depends. @mUseEstimatedMetadata@ was meant to trade performance for accuracy - and not to avoid usage of inaccurated stats. So the original version was to use the stats even if there is a where clause (which otherwise would alter the returned extent), if @mUseEstimatedMetadata@ is on. Wouldn't it be better to just analyze the table to update the stats? You want reliable stats for other queries too. |
Author Name: Andreas Neumann (@andreasneumann) Hi Jürgen, Thanks for having a look at the issue. In my case (PostgreSQL 10, Postgis 2.4) the vacuum analyze did not help unfortunately. However, Marco B. imported the data into his PostgreSQL 11 and did not reproduce the issue. |
Author Name: Jürgen Fischer (@jef-n) Andreas Neumann wrote:
Interesting - 9.6/2.3 and 10/2.4 have the issue - 11/2.5 is fine.
|
Author Name: Andreas Neumann (@andreasneumann) hm - strange. What do you suggest? I am happy to upgrade our server one day (not immediately) - but I guess that I am not the only one with such a combo (10/2.4) ;-( |
Author Name: Jürgen Fischer (@jef-n) Andreas Neumann wrote:
Now st_estimatedextent is only used when "use estimated metadata" is enabled, but in that case the where clause is still ignored. So it should still have the intended boost when enabled, but not be inaccurate anymore when disabled. |
Author Name: Andreas Neumann (@andreasneumann)
Original Redmine Issue: 21718
Affected QGIS version: 3.7(master)
Redmine category:data_provider/postgis
Assignee: Jürgen Fischer
We have a strange situation of a WMS service where there is only one layer in the project.
If the layer is loaded directly as the leaf layer, then not all data is displayed, if the layer is loaded as root (top level) layer, then all data is displayed.
For comparison reasons, in the attached project and screenshot the leaf layer is displayed in gray, and the top level layer in color (yellow).
Project is in EPSG 2056 and should also be loaded as such.
Data source is PostgreSQL (data attached).
The text was updated successfully, but these errors were encountered: