[Qgis-developer] Simplify geometry affects $area calculations

Anita Graser anitagraser at gmx.at
Sun Jun 22 08:06:32 PDT 2014


Thanks for your answer Andreas,
I've one question though: If the data source is a Shapefile and
simplification is enabled, will the Field Calculator results be
dependent on the zoom? I expect they will be. Isn't that a big source
of potential confusion for the users?
And yes, I do understand that the problem is more
complicated/different when server-side simplification is performed.
Best wishes,
Anita

On Sun, Jun 22, 2014 at 4:46 PM, Andreas Neumann <a.neumann at carto.net> wrote:
> 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
>>
>
> _______________________________________________
> 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