[QGIS-Developer] action get measure

Andreas Neumann a.neumann at carto.net
Thu Jun 23 06:50:20 PDT 2022


Hi Silvain,

Hm - this will require a "Python action".

Because with a generic action you could do something like:

length(make_line($geometry,make_point(@click_x, at click_y)))

using a QGIS expression, but there are two problems:

- you can only get @click_x and @click_y if you click on the feature; 
but since it is a point feature you cannot click outside the tolerance 
of this point in order to receive the coordinates

- generic actions do not allow updates of data

So you'd have to use a Python action. If you Google for QGIS Python 
actions, you should get some ideas how it works.

Andreas

On 2022-06-23 15:32, PIERRE Sylvain wrote:

> Hi Andreas,
> 
> I want an interactive solution . Close to measurement tool except I can 
> catch the length and update a field in the layer table.
> 
> De : Andreas Neumann <a.neumann at carto.net>
> Envoyé : jeudi 23 juin 2022 15:29
> À : PIERRE Sylvain <sylvain.pierre at alsace.eu>
> Cc : qgis-developer at lists.osgeo.org
> Objet : Re: [QGIS-Developer] action get measure
> 
> Soyez vigilant : ce courriel provient d'une organisation externe à la 
> CeA.
> * Assurez-vous d'abord qu'il ne s'agit pas d'un email malveillant avant 
> de cliquer sur tout lien ou pièce jointe.
> Apprendre à reconnaître un email de phishing. [6]
> 
> Hi Sylvain,
> 
> Do you want an interactive solution where the user should interactively 
> draw a second point - or is the second point already in your data 
> table?
> 
> Andreas
> 
> On 2022-06-23 14:42, PIERRE Sylvain via QGIS-Developer wrote:
> 
>> Hi ,
>> 
>> I want to build an action on a point layer, wich draw a line from a 
>> point and store the lenght inside a field layer.
>> 
>> Is ther any way to do that ?
>> 
>> Thanks
>> 
>> Sylvain
>> 
>> Sylvain PIERRE
>> 
>> Chef de projet système d'information
>> 
>> Direction des Systèmes d'Information et du Développement Numérique
>> 
>> Service Projets et Ingénierie Numérique
>> 
>> Collectivité européenne d'Alsace
>> 
>> Tél : 03 88 76 68 88
>> 
>> sylvain.pierre at alsace.eu
>> 
>> www.alsace.eu [1]
>> 
>> [2]  [3]  [4]
>> 
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer [5]
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer 
>> [5]



Links:
------
[1] http://www.alsace.eu
[2] http://www.facebook.com/toutelalsace
[3] http://www.twitter.com/toutelalsace
[4] http://www.instagram.com/toutelalsace
[5] https://lists.osgeo.org/mailman/listinfo/qgis-developer
[6] 
https://intranet.alsace.eu/actualites/apprenez-a-reconnaitre-un-email-phishing/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220623/0cd2f89b/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 8029 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220623/0cd2f89b/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 895 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220623/0cd2f89b/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 851 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220623/0cd2f89b/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1039 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220623/0cd2f89b/attachment-0005.png>


More information about the QGIS-Developer mailing list