[Qgis-developer] Simplify geometry affects $area calculations

Andreas Neumann a.neumann at carto.net
Sun Jun 22 07:46:41 PDT 2014


Hi Anita,

While I agree with you in general the difficulty is that if you do
serverside simplification QGIS does not even see the original geometry
anymore. So not easy to solve.

On the other hand you have several relatively easy workarounds. Either:

- disable simplification
- write the area to a new column
- calculate area in the database (e.g. Postgis, Spatialite)

Using $area in symbology isn't too efficient anyway. For each zoom and
pan you will calculate the same areas again and again.

Sorry that I can't give any better answers - just the recommendation
that you should not calculate areas on-the-fly for symbology purposes.

Andreas


Am 22.06.2014 13:59, schrieb Anita Graser:
> Hi,
> I noticed this issue because I had a choropleth map showing population
> density (calculated dynamically using "population"/$area). Some of the
> polygons changed color when zooming. Simplify geometry, which is
> active by default, caused minor changes to the value of $area when
> zooming. I think $area should always be calculated from the original
> geometry rather than the simplifies one to avoid such issues.
> Is this a known problem, or should I open a ticket?
> Best wishes,
> Anita
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 



More information about the Qgis-developer mailing list