scaleShapeTransformation: Transforms shapefile using an affine transformation.

Description Usage Arguments Details Value Note Author(s) Examples

Description

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

Usage

1
2
scaleShapeTransformation(inShape, newArea, percent = NULL,
  orientation = NULL, affine = NULL)

Arguments

inShape

A shapefile

newArea

A number for the desired area of the transformed shape

percent

The decimal percent ratio to transform the shapefile

orientation

The direction to transform the shapefile

affine

A 2D affine matrix to apply to shapefile

Details

Supply either the affine matrix or the percent and orientation that will be used to transform the shapefile. If orientation is one of the cardinal directions then percent is the decimal ratio for shapefile elongation in the specified direction relative to the perpendicular direction axis. If orientation is one of the ordinal directions, then percent is the decimal ratio for shear transformation of the shapefile in the specified direction relative to the perpendiuclar direction axis.

Value

A scaled shapefile with specified area and projection of inShape

Note

Edited by CDMartinez 14 June 16

Author(s)

Created by CDMartinez 11 May 16

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 <- scaleShapeTransformation(inShape = shape,newArea = 1500000,
percent = .05, orientation='SW')
shape3 <- scaleShapeTransformation(inShape = shape,newArea = 1500000,
affine = rbind(c(.2,1),c(1,.2)))
plot(shape, axes = TRUE)
plot(shape2, add = TRUE, border = 'red')
plot(shape3, add = TRUE, border = 'blue')

madorning/energySim0.1.0 documentation built on May 22, 2019, 2:23 p.m.