[postgis-users] Length of a line above polygon

Denis Rouzaud denis.rouzaud at gmail.com
Tue Jul 3 04:41:15 PDT 2012


Hi,

You can use something like

SELECT areas.id, SUM( ST_Length( lines.geometry) ) FROM lines,areas 
WHERE ST_Intersects(lines.geometry,areas.geometry) GROUP BY areas.id ;

Greetings,

Denis

On 07/03/2012 01:36 PM, Matej Mailing wrote:
> Hi all,
>
> We have a layer that contains polygons and another that contains lines
> that lie on them. Parts of the lines are laying "inside" the polygons
> and I would like to get a sum of all the lengths of lines that lie on
> the polygons. What is the easiest way to achieve this?
>
> TIA,
> Matej
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list