[GRASS-user] Split polygons with lines

Moritz Lennert mlennert at club.worldonline.be
Fri Mar 15 07:21:23 PDT 2019


On 10/03/19 15:39, Shane Carey wrote:
> Hi,
> 
> I've been looking for ways of grass gis splitting a polygon into 
> multiplepolygons with a line shapefile and wondering are there tools in 
> Grass to do this!!

Does the following correspond to what you are looking for ?

test = polygons
test2 = lines

# patch lines and polygons together
v.patch test,test2 out=test_patched

# transform lines to boundaries
v.type test_patched out=test_patched_bound

# break boundaries at intersections
v.clean test_patched_bound tool=break out=test_patched_bound_clean

# add centroids to new areas
v.centroids test_patched_bound_clean out=final

This can be easily scripted into a small addon module.

Moritz





More information about the grass-user mailing list