-
Notifications
You must be signed in to change notification settings - Fork 50
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
Only use features within atlas feature does not seem to work on a Report #271
Comments
Cannot reproduce the bug with a custom dataset. Do the layers have the same CRS? |
The layers are in a postgis enabled database.
The data is not in the public schema Parks (layer driving the report): becpas2 (layer with the details) The column they have in common is pa_name, however, the column is not explicitly set as a linking field. Do I need to create a relationship in QGIS or an FK in PostgreSQL? If I export the layers to a geopackage and we both test that, would that help? |
I just exported the data to a geopackage but I had to zip it to upload it. |
What spatial predicate is being used for "inside atlas feature"? Reason, many of my polygons would be covered by the atlas feature as they were dissolved to make the features for the atlas so the boundaries would touch. |
I am going to try an attribute approached. I will post the result here. |
I can now get it to work with a geopackage fine. I will roll back to the postgis tables and see if the base format is causing the problem. Note, I did upgrade to the latest QGIS 3.22.0 this morning. UPDATE - need to test more in a clean project to make sure about the "fine" part. Not so sure anymore, see my update to the post directly above this one |
Even with QGIS 3.22.0 when the layers are coming from PostgreSQL/PostGIS the plot goes missing on the report. Below is the PDF report output. |
If I use the feature subset technique I can get the report to work with the layers coming from PostGreSQL/PostGIS. Report attached: |
Hi, Just an update Inside plot_layout_item.py class PlotLayoutItem method get_polygon_filter I do get inside the elif 'layout_filter_by_atlas' part Not sure about the following: |
Hi. Quick update, I can log out the SRID: In the docs at https://qgis.org/api/classQgsLayoutReportContext.html I cannot find a crs() member function but maybe it is inherited? |
geopackage vs postgisThere is a difference. The difference seems to be in plot_factory.py in the class PlotFactory in the method fetch_values_from_layer. In the elif for the polygon_filter the rectangle returned by ct.transformBoundingBox(self.polygon_filter.geometry.boundingBox()) is identical for both formats. However, the features restricted but request.setFilterRect(rect) seems to differ (more for postgis and less for geopackage) The test in the for-loop (for f in it) visible_geom_engine.intersects(...) gives a different result. No hits for postgis but hits for geopackage. I could be wrong but the creation of the geom engine might be the place to look. QgsGeometry.createGeometryEngine(g.constGet()) The engine seems to treat the geometry from postgis differently than the geometry for geopackage. |
that's kind of weird. Geopackages might have some trouble with the fid vs primary key (see #236), but I wasn't aware of any geometrical difference. Not sure if @nyalldawson has some other idea. |
Possible bug
When using a chart on a QGIS report (not print composer) the concept of an atlas feature does not seem to work. I can see the variable and I can see the setting on the chart but it does not seem have the desired effect.
To Reproduce
Load some layers
Screenshots
![report_dataplot](https://user-images.githubusercontent.com/4993063/139511785-dd6f268a-654f-4fba-9813-5f4a244fc1e6.png)
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: