<div dir="ltr">Hi,<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">aggregate ( layer:='yourpolygonlayername', aggregate:='concatenate', expression:="yourfieldtoextract", filter:=contains($geometry, geometry(@parent)))<br></blockquote><div> </div><div>+1 for Harissou's answer. I'm gonna copy this one in my future workflows. Thanks!<br><div><br></div><div>You can also try the <a href="https://plugins.qgis.org/plugins/pointsamplingtool/" target="_blank">Point Sampling Tool</a> plugin. It allows for multiple vectors and raster to be sampled. It creates a 3rd layer + it results in 1 column/attribute per sampled attribute of the layers. If your purpose is to have a single column/attribute hold the values sampled from a series of vector layers (layer 1, layer 2, layer 3, etc.), you might need to merge your layers to sample first.</div><div><br></div><div>You can also try the v.what.vect or v.what.rast GRASS modules within QGIS for sampling vectors and rasters respectively. This option does not create a third layer but simply updates the point layer with values from the sampled layer although it only allows for one layer to be sampled at one time resulting again in multiple columns if you want to sample multiple layers.</div><div></div><div><br></div><div>In both cases, if you have multiple layers that you want to sample (with similar attributes + no overlap), you can merge these layers first before sampling them. If they have similar attributes/fields, you can then sample the resulting layer. Of course this adds another step to your workflow.</div><div><br></div><div>All the best,</div><div>Ben Hur</div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 24, 2020 at 2:01 PM Harrissou <<a href="mailto:delazj@gmail.com" target="_blank">delazj@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-NZ">Hi Tony,<br><br>You can use functions from the aggregate group in the field calculator of the point layer. No need to create a third layer. (Somehow) Picked from the QGIS function help panel<br><br>aggregate ( layer:='yourpolygonlayername', aggregate:='concatenate', expression:="yourfieldtoextract", filter:=contains($geometry, geometry(@parent)))<br><br>This will populate the point layer field with values of whatever polygon covers the point.<br>You can also use the direct functions concatenate, concatenate_unique, minimum, maximum... depending on how your data are shaped and what you actually need.<br><br>Hope that helps,<br>Harrissou<br><br><div class="gmail_quote">Le 24 juin 2020 05:29:58 GMT+02:00, "Tony Shepherd (FarmMaps NZ)" <<a href="mailto:tony@farmmaps.nz" target="_blank">tony@farmmaps.nz</a>> a écrit :<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><p class="MsoNormal">Hi All<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Am I missing something?  Is there a simple point and click tool in QGIS to update an existing field in a QGIS layer based on a value in another using a geographic join?  For example a series of points and a series polygons.  I want to update a field in points from a value in a field in polygons based on which polygon the point falls in.  Simple stuff.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">In a previous life using MapInfo we simply used query editor and<u></u><u></u></p><p class="MsoNormal" style="text-indent:36pt">update point_layer set col1 = colx from polygon_layer where obj within any<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">To me, this seems like a very simple everyday thing to do to an existing table.  I can, of course, use vector -> Join Attributes by Column but why in this case would I needlessly complicate things by having to create a third layer?  I don’t need an extra layer, I just need to update the one I have already.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I can see that the internet is littered with similar questions dating back as long as QGIS has been around.  Perhaps I have missed something obvious, and if so apologies for wasting the time of others, but can you point me to the tool?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span>Cheers<u></u><u></u></span></p><p class="MsoNormal"><span>Tony<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="color:rgb(64,64,64)">Tony Shepherd</span></b><span style="color:rgb(89,89,89)">  </span><b><span>|</span></b><span style="color:rgb(89,89,89)">  GeoSpatial / Mapping Manager<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(89,89,89)">Ph 027 435 6193  </span><b><span>|</span></b><span style="color:rgb(89,89,89)">  E <a href="mailto:tony@farmmaps.nz" target="_blank"><span style="color:rgb(5,99,193)">tony@farmmaps.nz</span></a><u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(89,89,89)">FarmMaps NZ, 3 Kerwood Place, Gore 9740<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(89,89,89)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:rgb(89,89,89)"><img border="0" width="160" height="75" style="width: 1.6666in; height: 0.7812in;" id="gmail-m_-5209304714054674772gmail-m_6369489664430954852_x0000_i1027" alt="FM_logo1_small (Custom)"><u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(123,123,123)"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-family:Arial,sans-serif;color:rgb(123,123,123)"><u></u> <u></u></span></b></p><p class="MsoNormal"><a href="http://tonyshepherd8.wixsite.com/home" target="_blank"><b><span style="font-family:Arial,sans-serif;color:windowtext;text-decoration:none"><img border="0" width="157" height="34" style="width: 1.6354in; height: 0.3541in;" id="gmail-m_-5209304714054674772gmail-m_6369489664430954852Picture_x0020_1"></span></b></a><a href="https://www.wunderground.com/personal-weather-station/dashboard?ID=ISTLGORE2" target="_blank"><b><span style="font-family:Arial,sans-serif;color:windowtext;text-decoration:none"><img border="0" width="170" height="37" style="width: 1.7708in; height: 0.3854in;" id="gmail-m_-5209304714054674772gmail-m_6369489664430954852Picture_x0020_3"></span></b></a><b><span style="font-family:Arial,sans-serif"><u></u><u></u></span></b></p><p class="MsoNormal"><u></u> <u></u></p></div></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</div>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><span><div dir="ltr"><div dir="ltr"><div dir="ltr"><font face="monospace, monospace"><div dir="ltr"><div dir="ltr" style="font-size:small"><div style="font-family:Arial,Helvetica,sans-serif">---</div><div style="font-family:Arial,Helvetica,sans-serif"><b style="font-family:monospace,monospace">Ben Hur S. Pintor</b><br></div><div style="font-family:Arial,Helvetica,sans-serif"><div><font face="monospace, monospace" color="#000000"><a href="https://bnhr.xyz/" target="_blank">bnhr.xyz</a></font></div><div><font face="monospace, monospace"><a href="mailto:hi@bnhr.xyz" target="_blank">hi@bnhr.xyz</a></font></div></div><div style="font-family:Arial,Helvetica,sans-serif"><br></div><div style="text-align:center;font-family:Arial,Helvetica,sans-serif"><img src="https://docs.google.com/uc?export=download&id=1RWxakH_JIlVojbdRj8QYwVsdJVnAYVHT&revid=0B5hrESDcDUYodlYvUjBmbnp6RlB0YmRVemlJSzJ1TldvVHY0PQ"><br></div><div style="text-align:center;font-family:Arial,Helvetica,sans-serif"><span style="color:rgb(68,68,68);font-family:"arial black",sans-serif;font-size:xx-large">open spatial & data solutions</span><br></div></div></div></font></div></div></div></span></div></div>
</div></div></div></div></div></div></div></div></div>