[Qgis-user] extracting vertices from a multipolygon using Field Calculator Function Editor

Zoltan zoltans at geograph.co.za
Mon Oct 18 04:42:24 PDT 2021


Hi Listers,
I can't for the life of me work out the syntax/commands to use in the 
FieldCalculator->FunctionEditor for extracting vertices.

I have a Polygon layer with Multipolygon rectangles at various rotations.
I need to extract the 4 corner points so that I can calculate (and save 
in a virtual layer) lines that I can later use with "Processing->Split 
with lines".

I will google for opening a new virtual layer and saving lines to it, 
but if that is quick and easy then some help there would also be welcome.

Please can someone point me to a sample functions covering these 
requirements, or just fill in the gaps below.
No, I'm not asking for someone to just write it for me.

Thanks in advance,
Zoltan
[Having a brain-dead day :-(  ]


    from qgis.core import *
    from qgis.gui import *

    @qgsfunction(args='auto', group='Custom', referenced_columns=[])
    def zCutBox(feature, parent):
         vertices =

         blah blah
         return vertices[0][0]


-- 

=============================================
Zoltan Szecsei GPrGISc 0031
Geograph (Pty) Ltd.
GIS and Photogrammetric Services

Cape Town, South Africa.

Mobile: +27-83-6004028 (Signal, not WhatsApp)
www.geograph.co.za
=============================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20211018/f8566a94/attachment.html>


More information about the Qgis-user mailing list