[Qgis-user] Setting a line's length attribute

Matej matej at matnet.net
Tue Mar 3 12:54:09 PST 2009


Hi Andreas,

the solution with a trigger sounds very interesting. 

Could you please present more about it?

Thanks,
Matej
matej at matnet.net

----- Original Message ----- 
From: "Andreas Neumann" <a.neumann at carto.net>
To: "qgis-user" <qgis-user at lists.osgeo.org>
Sent: Tuesday, March 03, 2009 8:37 PM
Subject: Re: [Qgis-user] Setting a line's length attribute


> Hi Matej,
> 
> QGIS does not yet have a field calculator or a similar mechanism. But 
> since your data is in Postgis already, it is very easy to do it with 
> Postgis and SQL:
> 
> UPDATE yourschema.yourtable SET LineLength = ST_Length(the_geom);
> 
> You can even set a row-level trigger so that the length gets 
> automatically updated if a geometry changed. Please let me know if you 
> are interested in the trigger thing.
> 
> Andreas
> 
> Matej wrote:
>> Hello,
>>  
>> I have a PostGIS table which has an attribute "length". I would like 
>> to have calculated length of every particular segment (the information 
>> that is printed when I click on the Identify Features and then select 
>> some line segment) to be somehow "set" into the field length 
>> automatically. In MapInfo, this can be achieved by Update column and 
>> then setting the ObjectLen to the appropriate field.
>>  
>> How can this be done in QGIS?
>>  
>> Thanks a lot!
>>  
>> Matej
>> matej at matnet.net <mailto:matej at matnet.net>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>   
> 
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>



More information about the Qgis-user mailing list