Wednesday 27 June 2018

Extracting polyline of border between differing polygons using R or GRASS?


I have a shapefile with polygons with an associated variable that can take different values. I would like to extract the borders between polygons of differing value (red and blue) as a polyline (dark black line).


I would prefer solutions in R but will accept other open source solutions.


enter image description here



Answer



Using GRASS it would be a simple two step process. After importing the polygon vector into an appropriate GRASS location, you would run:


v.dissolve  output= column=

then, to get just the boundaries:


v.extract  output= type=boundary

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...