Depends on your QGIS version, from 3.16 onwards you can use the overlay-functions to proof if the point and polygonlayer are in a spatial relation like intersects or touches and so on. The expression for your first rule will be like this one:

/"VAL_PROTECTION_EP3" = '1' AND  "TYPE"  = 1 AND overlay_intersects( layer:='pol', filter := ("TYPE" in ('P','E') AND "CAT_CANTON" = 2) OR ("TYPE" in ('P','E') AND "CAT_CANTON" = 3))/

In the overlay_intersects-part you have to change the layername to your polygon layer.

If you have an older QGIS Version you can achieve the more or less same result with the refFunctions Plugin.

Hope this helps

Best regards

Stefan

--
Mit freundlichen Grüßen
Stefan Giese
Projektleiter/Consultant
------------------------------------------------------
Aufwind durch Wissen!
Jetzt neu: Webinare und Online-Schulungen
bei der www.foss-academy.com
------------------------------------------------------

WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany

Fon: +49 (0)761 / 519 102 - 61
Fax: +49 (0)761 / 519 102 - 11

[email protected]
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885

Am 30.08.2021 um 16:36 schrieb Jeanneret Cédric:

I would like to use a set of rules to draw features from a point_layer that are within a polygon_layer.

Points that answer true to

("VAL_PROTECTION_EP3" = '1' AND  "TYPE"  = 1)

and that are within polygons that answer true to

("TYPE" in ('P','E') AND "CAT_CANTON" = 2) OR ("TYPE" in ('P','E') AND "CAT_CANTON" = 3)

should be displayed as red dots

Points that answer true to

("VAL_PROTECTION_EP3" = '2' AND  "TYPE"  = 1)

and that are within polygons that answer true to

("TYPE" in ('P','E') AND "CAT_CANTON" = 2) OR ("TYPE" in ('P','E') AND "CAT_CANTON" = 3)

should be displayed as orange dots

Points that answer true to

("VAL_PROTECTION_EP3" = '3' AND  "TYPE"  = 1)

and that are within polygons that answer true to

("TYPE" in ('P','E') AND "CAT_CANTON" = 1)

should be displayed as yellow dots

I cannot find the right combination of expressions for the rule to work.

Any help would be appreciated: what would a working syntax be for such a rule to work in QGIS Layer Styling panel ?

Cédric Jeanneret


_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to