Re: [postgis-users] Length of a line above polygon

2012-07-03 Thread Matej Mailing
:-) Hopefully this could be of some use to anyone else when having such a problem. Thanks, Matej 2012/7/4 Matej Mailing : > Hi, > > Thank you for the answer. However, I don't get the right result. For > example, when there is a line that is long 500 meters and it crosses 5 > polyg

Re: [postgis-users] Length of a line above polygon

2012-07-03 Thread Matej Mailing
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 t

[postgis-users] Length of a line above polygon

2012-07-03 Thread Matej Mailing
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

Re: [postgis-users] How to match lines between two similar graphs?

2012-01-26 Thread Matej Mailing
Hi, I am having somehow similar issue: I have a (single) table with the lines that represent cables on the ground. Those cables sometimes cross, sometimes they go in the same direction in some distance between them, sometimes one on another and my goal is to get the trenches (that are wide for exa

Re: [postgis-users] Merging lines - one on another

2012-01-24 Thread Matej Mailing
Should this work if I have all the data in one table and thus using the same geom1 and geom2? I have now installed PostGIS 2.0 and use only one geom as an input to the ST_Snap and have problems with the result being only one geometry data row. What should I change? I will really appreciate any an

Re: [postgis-users] Merging lines - one on another

2012-01-21 Thread Matej Mailing
Thanks to both of you. Now I have a query like: SELECT * FROM public.my_table AS part_1, public.my_table AS part_2 WHERE ST_SharedPaths(part_2.wkb_geometry_4326, ST_SnapToGrid(part_1.wkb_geometry_4326, part_2.wkb_geometry_4326, 0.5, 0, 0, 0)) - it seems that ST_Snap(geom, geom, float) doesn't ex

[postgis-users] Merging lines - one on another

2012-01-21 Thread Matej Mailing
Hi all, I am using QGIS with PostGIS with the data that represents some cables on the terrain. There are some segments where the cables are drawn one near another (for example about 30 cm apart) and they even cross sometimes. My goal is to get the trenches, so to "merge" those parts of lines, that