Description Usage Arguments Value Note Author(s) Examples
Scales input shape to desired area within extent of outer shape. Units must be the same.
1 | scaleShape2Shape(innerShape, outerShape, innerArea)
|
innerShape |
A shapefile to be scaled |
outerShape |
A shapefile limiting extent of shape scaling |
innerArea |
A number for the desired area of shape output |
A scaled shapefile with specified area and same projection as input.
Edited by CDMartinez 15 Mar 16
Created by CDMartinez 11 Mar 16
1 2 3 4 5 6 7 8 9 | library(sp)
points <- rbind(c(250,250),c(250,1750),c(1750,1750),c(1750,250),c(250,250))
ShapeOuter <- SpatialPolygons(list(Polygons(list(Polygon(points)), 'auOutline')))
triPoints <- rbind(c(500,500),c(1000,1500),c(1500,500),c(500,500))
shape <- SpatialPolygons(list(Polygons(list(Polygon(triPoints)), 'maxOutline')))
shape2 <- scaleShape2Shape(innerShape = shape, outerShape = ShapeOuter, innerArea = 1500000)
plot(ShapeOuter, axes = TRUE)
plot(shape, add = TRUE, border = 'black')
plot(shape2, add = TRUE, border = 'red')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.