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

C Hamilton adenaculture at gmail.com
Wed Feb 22 06:32:52 PST 2017


Hi Regis,

I would assume that in this use case the user would not be modifying the
source polygons, but would make a copy of them which could be a memory
layer and then resize them. I mentioned resizing small features so that
they visibly would be better shown on the map, but the other use case would
be when the user draws a polygon and would then like to shrink or enlarge
it, then perhaps move it into position. QGIS already has the move tool, but
I don't see one to shrink or enlarge polygon tool.

I understand how a point label's size can be modified based on some
attribute, but can an expression be written that would allow a polygon size
be scaled and centered about the source centroid, based on some attribute
in the data. If that is possible I don't know how it would be done.

Thanks,

Calvin

On Wed, Feb 22, 2017 at 2:53 AM, Régis Haubourg <regis.haubourg at gmail.com>
wrote:

> 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/3d1ced25/attachment.html>


More information about the Qgis-developer mailing list