<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>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:</p>
<p><i>"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))</i></p>
<p>In the overlay_intersects-part you have to change the layername
to your polygon layer.</p>
<p>If you have an older QGIS Version you can achieve the more or
less same result with the refFunctions Plugin.</p>
<p>Hope this helps</p>
<p>Best regards</p>
<p>Stefan</p>
<pre class="moz-signature" cols="72">--
Mit freundlichen Grüßen
Stefan Giese
Projektleiter/Consultant
------------------------------------------------------
Aufwind durch Wissen!
Jetzt neu: Webinare und Online-Schulungen
bei der <a class="moz-txt-link-abbreviated" href="http://www.foss-academy.com">www.foss-academy.com</a>
------------------------------------------------------
WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany
Fon: +49 (0)761 / 519 102 - 61
Fax: +49 (0)761 / 519 102 - 11
<a class="moz-txt-link-abbreviated" href="mailto:stefan.giese@wheregroup.com">stefan.giese@wheregroup.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.wheregroup.com">www.wheregroup.com</a>
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885</pre>
<div class="moz-cite-prefix">Am 30.08.2021 um 16:36 schrieb
Jeanneret Cédric:<br>
</div>
<blockquote type="cite"
cite="mid:7ae4578cd8894ad9b95944357059cada@ville-fr.ch">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Open Sans";
panose-1:2 11 6 6 3 5 4 2 2 4;}@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}@font-face
{font-family:"var\(--ff-mono\)";
panose-1:0 0 0 0 0 0 0 0 0 0;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}code
{mso-style-priority:99;
font-family:"Courier New";}pre
{mso-style-priority:99;
mso-style-link:"Préformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Open Sans",sans-serif;
color:windowtext;}span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:"Courier New";
mso-fareast-language:FR-CH;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">I
would like to use a set of rules to draw features from a
point_layer that are within a polygon_layer.<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">Points
that answer true to<o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span
style="font-size:10.0pt;font-family:"var(--ff-mono)",serif;border:none
windowtext 1.0pt;padding:0cm;mso-fareast-language:FR-CH">("VAL_PROTECTION_EP3"
= '1' AND "TYPE" = 1)
<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH"
lang="DE-CH">and that are within polygons that answer true
to<o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span
style="font-size:10.0pt;font-family:"var(--ff-mono)",serif;border:none
windowtext 1.0pt;padding:0cm;mso-fareast-language:FR-CH">("TYPE"
in ('P','E') AND "CAT_CANTON" = 2) OR ("TYPE" in ('P','E')
AND "CAT_CANTON" = 3)<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">should
be displayed as red dots<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">Points
that answer true to<o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span
style="font-size:10.0pt;font-family:"var(--ff-mono)",serif;border:none
windowtext 1.0pt;padding:0cm;mso-fareast-language:FR-CH">("VAL_PROTECTION_EP3"
= '2' AND "TYPE" = 1)
<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH"
lang="DE-CH">and that are within polygons that answer true
to<o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span
style="font-size:10.0pt;font-family:"var(--ff-mono)",serif;border:none
windowtext 1.0pt;padding:0cm;mso-fareast-language:FR-CH">("TYPE"
in ('P','E') AND "CAT_CANTON" = 2) OR ("TYPE" in ('P','E')
AND "CAT_CANTON" = 3)<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">should
be displayed as orange dots<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">Points
that answer true to<o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span
style="font-size:10.0pt;font-family:"var(--ff-mono)",serif;border:none
windowtext 1.0pt;padding:0cm;mso-fareast-language:FR-CH">("VAL_PROTECTION_EP3"
= '3' AND "TYPE" = 1)<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH"
lang="DE-CH">and that are within polygons that answer true
to<o:p></o:p></span></p>
<p class="MsoNormal" style="vertical-align:baseline"><span
style="font-size:10.0pt;font-family:"var(--ff-mono)",serif;border:none
windowtext 1.0pt;padding:0cm;mso-fareast-language:FR-CH">("TYPE"
in ('P','E') AND "CAT_CANTON" = 1)<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">should
be displayed as yellow dots<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-bottom-alt:auto;background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">I
cannot find the right combination of expressions for the
rule to work.<o:p></o:p></span></p>
<p class="MsoNormal"
style="background:#F9F8F6;vertical-align:baseline"><span
style="font-size:11.5pt;font-family:"Segoe
UI",sans-serif;color:#242729;mso-fareast-language:FR-CH">Any
help would be appreciated: what would a working syntax be
for such a rule to work in QGIS Layer Styling panel ?<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Open
Sans",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Open
Sans",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Open
Sans",sans-serif;color:black;mso-fareast-language:FR-CH">Cédric
Jeanneret</span><span style="mso-fareast-language:FR-CH"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>