Description Usage Arguments Details Value Note Author(s) Examples
Scales input shapefile to desired area. Units must be the same.
1 2 | scaleShapeTransformation(inShape, newArea, percent = NULL,
orientation = NULL, affine = NULL)
|
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 |
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.
A scaled shapefile with specified area and projection of inShape
Edited by CDMartinez 14 June 16
Created by CDMartinez 11 May 16
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.