scaleShape: Scales shapefile.

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/shape.R

Description

Scales input shapefile to desired area assuming stationary centroid. Units must be the same.

Usage

1
scaleShape(inShape, newArea)

Arguments

inShape

A shapefile

newArea

A number for the desired area

Details

For more complex shape scaling and transformations, see scaleShapeTransformation

Value

A scaled shapefile with specified area and projection of inShape

Note

Edited by CDMartinez 14 Dec 15

Author(s)

Created by CDMartinez 03 Dec 15

Examples

1
2
3
4
5
6
library(sp)
points <- rbind(c(250,250),c(250,1750),c(1750,1750),c(1750,250),c(250,250))
shape <- SpatialPolygons(list(Polygons(list(Polygon(points)), 'auOutline')))
shape2 <- scaleShape(shape, 2000000)
plot(shape, axes = TRUE)
plot(shape2, add = TRUE)

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