1

I was wondering if in GRASS GIS exists a way to split a polygonal area based on its intersection with a vector line, eg:

 ______                      ______
|      |                    |  *   |
|  *   |  + __________  ->  |______|
|      |                    |  *   |
|______|                    |______|

1 polygon  +  1 line    ->  2 polygons

2 Answers 2

2

This workflow might help (assuming a polygon vector "polys" and a line vector "lines":

v.type input=polys out=boundary_lines from=boundary to=line
v.patch boundary_lines,lines out=lines_patch
v.type input=lines_patch out=new_boundary  # default is from lines to boundaries
v.centroids new_boundary out=new_areas

Note that you loose the polys attribute table. You'll have to do some v.distance trickery to attach original poly attributes to the new_areas.

1
1

I think there is a better way but for now what I do is:

  • create a polygon from the line with "v.buffer"

  • use v.overlay to extract a polygon layers composed by the union of the 2 polygon

  • use again v.overlay to extract only the polygons that are not overlaid by the buffered line

this gives me 2 polygons with an empty space where the buffered line was ... it is not optimal ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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