[postgis-users] Create equally spaced lines within a polygon

Karl Zinglersen karl.zinglersen at gmail.com
Tue Dec 3 10:04:37 PST 2013


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.
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.

Karl

Den lørdag den 30. november 2013 13.21.46 UTC-3 skrev Nicolas Ribot:
>
> Hi, 
>
> You should look at this french article for skeletonization of 
> irregular polygons. The st_delaunayTriangles method can also help. 
> Note that the middle line of a polygon is not always a straight line. 
> Then, using linear referencing, it should be easy to walk the middle 
> line to create perpendicular segments. 
>
> Nicolas 
>
> On 29 November 2013 18:25, Karl Zinglersen <karl.zi... at gmail.com<javascript:>> 
> wrote: 
> > I need to create transect lines across polygons for planning aerial 
> surveys 
> > for musk oxen and caribous in Greenland. 
> > 1. In QGIS I have made polygons of the polygon zones for each survey. 
> Each 
> > polygon hold an attribute of spacing value, e.g. 5, 10 and 20 km. 
> > 2. Lines must be equally spaced and parallel. 
> > 3. Lines must be perpendicular to the polygon centerline. 
> > 4. Centerline must run at the longest distance across the polygon - and 
> > consequently the transects run as the shorter distances. 
> > I've attached a hand made sketch, which display the concept. 
> > 
> > I've tried this query 
> > 
> > SELECT GENERATE_SERIES(FLOOR(ST_YMin(the_polygon))::int , 
> > CEILING(ST_YMax(the_polygon))::int,200) y_value, ST_XMin(the_polygon) 
> x_min, 
> > ST_XMax(the_polygon) x_max from 
> >             (SELECT the_geom AS the_polygon FROM lakes) l 
> > 
> > 
> > SELECT ST_Intersection(the_geom, the_polygon)  AS the_geom FROM 
> >     (SELECT the_polygon, ST_Setsrid(ST_MakeLine(ST_MakePoint(x_min, 
> > y_value),ST_MakePoint(x_max, y_value) ), ST_Srid(the_polygon)) AS 
> the_geom 
> > FROM 
> >         (SELECT the_polygon, 
> > GENERATE_SERIES(FLOOR(ST_YMin(the_polygon))::int , 
> > CEILING(ST_YMax(the_polygon))::int,200) y_value, ST_XMin(the_polygon) 
> x_min, 
> > ST_XMax(the_polygon) x_max from 
> >             (SELECT the_geom AS the_polygon FROM lakes) l 
> >         )c 
> > 
> > ) lines 
> > 
> > from gis stackechange 
> > 
> http://gis.stackexchange.com/questions/24064/filling-a-polygon-with-lines-using-postgis 
> > 
> > however these transects runs horisontally and don't seem to take into 
> > account the shape and rotation of the polygon centerline. 
> > 
> > Should I be able to change the query or should take a different 
> approach? 
> > 
> > Karl Zinglersen 
> > 
> > _______________________________________________ 
> > postgis-users mailing list 
> > postgi... at lists.osgeo.org <javascript:> 
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users 
> _______________________________________________ 
> postgis-users mailing list 
> postgi... at lists.osgeo.org <javascript:> 
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20131203/6861cf7a/attachment-0001.html>


More information about the postgis-users mailing list