scaleShape2Shape: Scale shapefile within shapefile

Description Usage Arguments Value Note Author(s) Examples

View source: R/shape.R

Description

Scales input shape to desired area within extent of outer shape. Units must be the same.

Usage

1
scaleShape2Shape(innerShape, outerShape, innerArea)

Arguments

innerShape

A shapefile to be scaled

outerShape

A shapefile limiting extent of shape scaling

innerArea

A number for the desired area of shape output

Value

A scaled shapefile with specified area and same projection as input.

Note

Edited by CDMartinez 15 Mar 16

Author(s)

Created by CDMartinez 11 Mar 16

Examples

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')

madorning/energySimMD documentation built on May 22, 2019, 2:40 p.m.