[Qgis-developer] Resize QGIS line or polygon about its centroid

Régis Haubourg regis.haubourg at gmail.com
Tue Feb 21 23:53:47 PST 2017


Hi Calvin,
what you describe requires to store the specific object size somewhere,
which is the exact same requirement with data defined labeling (or any data
defined stuff in QGIS, those widgets are everywhere).
Modifying the source layer is quite wrong, and sometimes impossible
(readonly datasets). You can have a look to EasyCustomLabeling where I
coded a duplication of the objects I needed to label into a memory layer.
Persistence is made thanks to MemoryLayerSaver plugin that saves them in a
separated .mldata file. In you case, a symbol is made of so much markers,
sub markers that you can't just define one width or size parameter shortcut
button (or mouse scroll + key modifier) so easily.

This is anyway quite hacky and justify a planned and funded work for QGIS3
: Auxiliary storage. That work will provide a way to store data or other
ressources inside the qgs project. That will provide a nicer and more
portable method for custom labeling or styling.

Just to end up with your cartographic need, up to now, I've always managed
to handle what you describe with conditional rules in expressions without
having to manually storing values. I eventually had to store exceptions to
rules in the following way:

Ex: Styling city point with size proportional to the number of inhabitants
, except for one

CASE
  WHEN city = 'Grenoble' then  22
  ELSE scale_exp("altitude", 0, 0, 1, 10, 0.5)
END

I hope that helps
Cheers Régis

2017-02-21 21:14 GMT+01:00 C Hamilton <adenaculture at gmail.com>:

> I have an project where I want a feature to be larger than life just so
> that it shows up on the map. Ideally I would like is to be able to select
> one of more features and with the mouse have it interactively resize them,
> but keeping them centered about their centroids. Once I am satisfied with
> their size I would either click a button to fix them or hit the Enter key.
>
> I saw the Affine transformations plugin, but that takes too much thought.
> Is this capability already there and am just not finding it or has it
> simply not been done? If the latter is the case I may consider writing the
> plugin to do it although I think it would be nice for it to be a part of
> the standard QGIS editing functions.
>
> Thanks,
>
> Calvin
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170222/564a6cd0/attachment.html>


More information about the Qgis-developer mailing list