<div dir="ltr">Hi, I believe I was unclear - the centerlines have to straight. But I'll keep in mind your reference to delauney triangles and skeletonization for future purposes.<div>To create the centerline a manual sketch is probably OK. Could I then just move on with linear referencing? Which function should I use - most seems to be percentages of a linestring.</div><div><br></div><div>Karl<br><br>Den lørdag den 30. november 2013 13.21.46 UTC-3 skrev Nicolas Ribot:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi,
<br>
<br>You should look at this french article for skeletonization of
<br>irregular polygons. The st_delaunayTriangles method can also help.
<br>Note that the middle line of a polygon is not always a straight line.
<br>Then, using linear referencing, it should be easy to walk the middle
<br>line to create perpendicular segments.
<br>
<br>Nicolas
<br>
<br>On 29 November 2013 18:25, Karl Zinglersen <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="FyCUkc8j3SQJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">karl.zi...@gmail.com</a>> wrote:
<br>> I need to create transect lines across polygons for planning aerial surveys
<br>> for musk oxen and caribous in Greenland.
<br>> 1. In QGIS I have made polygons of the polygon zones for each survey. Each
<br>> polygon hold an attribute of spacing value, e.g. 5, 10 and 20 km.
<br>> 2. Lines must be equally spaced and parallel.
<br>> 3. Lines must be perpendicular to the polygon centerline.
<br>> 4. Centerline must run at the longest distance across the polygon - and
<br>> consequently the transects run as the shorter distances.
<br>> I've attached a hand made sketch, which display the concept.
<br>>
<br>> I've tried this query
<br>>
<br>> SELECT GENERATE_SERIES(FLOOR(ST_YMin(<wbr>the_polygon))::int ,
<br>> CEILING(ST_YMax(the_polygon)):<wbr>:int,200) y_value, ST_XMin(the_polygon) x_min,
<br>> ST_XMax(the_polygon) x_max from
<br>>             (SELECT the_geom AS the_polygon FROM lakes) l
<br>>
<br>>
<br>> SELECT ST_Intersection(the_geom, the_polygon)  AS the_geom FROM
<br>>     (SELECT the_polygon, ST_Setsrid(ST_MakeLine(ST_<wbr>MakePoint(x_min,
<br>> y_value),ST_MakePoint(x_max, y_value) ), ST_Srid(the_polygon)) AS the_geom
<br>> FROM
<br>>         (SELECT the_polygon,
<br>> GENERATE_SERIES(FLOOR(ST_YMin(<wbr>the_polygon))::int ,
<br>> CEILING(ST_YMax(the_polygon)):<wbr>:int,200) y_value, ST_XMin(the_polygon) x_min,
<br>> ST_XMax(the_polygon) x_max from
<br>>             (SELECT the_geom AS the_polygon FROM lakes) l
<br>>         )c
<br>>
<br>> ) lines
<br>>
<br>> from gis stackechange
<br>> <a href="http://gis.stackexchange.com/questions/24064/filling-a-polygon-with-lines-using-postgis" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fgis.stackexchange.com%2Fquestions%2F24064%2Ffilling-a-polygon-with-lines-using-postgis\46sa\75D\46sntz\0751\46usg\75AFQjCNGnrJwh3oXMXn7r27UYP0lvTV0jQg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fgis.stackexchange.com%2Fquestions%2F24064%2Ffilling-a-polygon-with-lines-using-postgis\46sa\75D\46sntz\0751\46usg\75AFQjCNGnrJwh3oXMXn7r27UYP0lvTV0jQg';return true;">http://gis.stackexchange.com/<wbr>questions/24064/filling-a-<wbr>polygon-with-lines-using-<wbr>postgis</a>
<br>>
<br>> however these transects runs horisontally and don't seem to take into
<br>> account the shape and rotation of the polygon centerline.
<br>>
<br>> Should I be able to change the query or should take a different approach?
<br>>
<br>> Karl Zinglersen
<br>>
<br>> ______________________________<wbr>_________________
<br>> postgis-users mailing list
<br>> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FyCUkc8j3SQJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">postgi...@lists.osgeo.org</a>
<br>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNFq7nnxngR7sOb6icF73DL5HQVrbA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNFq7nnxngR7sOb6icF73DL5HQVrbA';return true;">http://lists.osgeo.org/cgi-<wbr>bin/mailman/listinfo/postgis-<wbr>users</a>
<br>______________________________<wbr>_________________
<br>postgis-users mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="FyCUkc8j3SQJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">postgi...@lists.osgeo.org</a>
<br><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNFq7nnxngR7sOb6icF73DL5HQVrbA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNFq7nnxngR7sOb6icF73DL5HQVrbA';return true;">http://lists.osgeo.org/cgi-<wbr>bin/mailman/listinfo/postgis-<wbr>users</a>
<br></blockquote></div></div>