# NOT RUN {
#Example 1: Use Clip2Coast on a pre-generated polygon
MyPolys=create_Polys(PolyData,Densify=TRUE,Buffer=c(10,-15,120))
plot(MyPolys,col='red')
plot(Coast[Coast$ID=='All',],col='grey',add=TRUE)
MyPolysClipped=Clip2Coast(MyPolys)
plot(MyPolysClipped,col='blue',add=TRUE)
#View(MyPolysClipped)
#Example 2: Use Clip2Coast while creating a polygon, with Clip=TRUE in create_Polys().
MyPolysBefore=create_Polys(PolyData,Buffer=c(10,-15,120))
MyPolysAfter=create_Polys(PolyData,Buffer=c(10,-15,120),Clip=TRUE)
plot(MyPolysBefore,col='green')
plot(Coast[Coast$ID=='All',],add=TRUE)
plot(MyPolysAfter,col='red',add=TRUE)
# }
Run the code above in your browser using DataLab