[OSGeo-UK] [External] QGIS query
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Thu Aug 21 09:39:55 PDT 2025
Actually, the previous approach (which bounced, oops) with a virtual layer
is probably overkill, you can do some rule-based styling on the layer being
input. Add a rule for $area < your_threshold and use a centroid style. Add
an "else" rule for your desired style. The red centroid dot appears on
completion of small polygons.
Not sure how to prevent creation of tiny polygons in the first place, but
its only a Ctrl-Z away if you create one and its flagged as too small and
you want to zap it.
Barry
On Thu, Aug 21, 2025 at 5:32 PM Barry Rowlingson <b.rowlingson at gmail.com>
wrote:
> I just tried creating a virtual layer based on the layer being digitised
> with SQL like:
>
> select * from p where area(geometry) < 1000
>
> then when I create polygons with area < 1000 in my layer `p`, I get a
> feature in the virtual layer. You could style this as a point at the
> centroid. Then when you create a feature smaller than that threshold, you
> get a red dot at its centroid.
>
> Seems to update instantly on completion of the polygon, you don't even
> have to save the edited layer to get the virtual layer to update. At first
> I wasn't seeing the virtual layer change but that was when I was styling
> the virtual layer as polygons and they might have been hiding under the new
> feature. Styled as centroid points they show up as I close the polygon.
>
>
> Useful starting point?
>
> Barry
>
>
>
>
>
>
>
> On Thu, Aug 21, 2025 at 5:11 PM Al Graham via UK <uk at lists.osgeo.org>
> wrote:
>
>> *This email originated outside the University. Check before clicking
>> links or attachments.*
>> Hi all
>> A (hopefully) quick QGIS question for you.
>>
>> If I am digitising land cover from an aerial photo is there a way to
>> limit the size of the polygon geometry to a minimum mappable unit (MMU)?
>> For instance, say that size is 3 square metres, is it possible for QGIS to
>> automatically flag, or reject, a new polygon that is 1m by 1m? Or is this
>> something I would have to reconcile once the digitising has been completed?
>>
>> I think it's the latter option, but I thought I'd ask in case there's
>> some special QGIS function I am unaware of.
>>
>> Cheers
>> Al
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/uk/attachments/20250821/145698f8/attachment.htm>
More information about the UK
mailing list