20

Is it possible to generate a boustrophedon pattern which fill a vector Region with GRASS?

I have a vector region in GRASS. And I would like to generate a vector (a polyline) being the bostrophedon pattern which fill this region.

In the picture bellow, I have the "gray" area, and I would like to generate the red polyline automatically.

Is it possible with GRASS or another GIS tool ?

enter image description here

In a perfect world, the function will take the following argumets :

  • A starting point (which must be anywhere in the area)
  • A distance between two parallels lines
  • A direction (a vector which will help to draw the pattern)
  • Interesting question. How would you determine the starting point? "Top Left" may not always relate to a nice corner point as in your example. – Darren Cope Feb 13 '15 at 14:41
  • I answered to your comment in the question – Adrien BARRAL Feb 13 '15 at 15:47
  • 1
    Probably something could be cooked up using PyGRASS: grass.osgeo.org/grass70/manuals/libpython/pygrass_index.html – markusN Feb 14 '15 at 14:42
  • Is the required output just an image with the lines drawn on it, or are you really after some output of coordinates that could be given to a tractor to most efficiently plough a field? – nmtoken Jul 5 '15 at 8:40
2
+50

I have no idea about how to build such function, but the steps to perform might be

  1. Draw one line with the desired azimuth and create new lines with offset so that the polygon is totally covered.

Line field created

  1. Buffer the polygon for defining the gap between the polygon boundary and boustrophedon. Cut the lines at boundaries of the buffered polygon and keep the internal parts.

Line field cut with the buffered polygon

  1. Connect the end and start points of the lines in correct order.

Ready boustrophedon pattern

  • 1
    I tried the same thing, I think you're onto something here. Steps 1 and 2 are fairly easy - or can be mocked up. Step 3 is trickier.. it might be possible in postgis to sort the points representing the st_intersection() of the parallel lines / inner buffer by their ST_LineLocatePoint() value along the inner buffer, and join alternate pairs. – Steven Kay Dec 21 '15 at 16:15
  • 1
    If the boundary of the polygon has inner corners or spikes then the lines which connect end and start points may intersect the boundary. It is not difficult to test if intersection happens but what would be the right way to draw the linestring in such case and how to make it automatically? It may not be easy to find a general solution. – user30184 Dec 21 '15 at 18:32
  • you're right, getting directions correct will be tricky. also, suspect this approach will have edge cases, e.g. u-shaped fields, or fields with holes :) – Steven Kay Dec 21 '15 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.