GME

Geospatial Modelling Environment

shiftrotate (Shift And Rotate Features)

Shifts and/or rotates vector features and writes the result to a new output data source

Description

This tool shifts and/or rotates vector features and writes the result to a new output data source. The shift is specified as a distance each feature is moved in the x and y directions (negative values imply a shift left/down, positive values imply a shift right/up respectively). If you do not specify a shift then no shift is applied (i.e. the default shift is 0,0). If the features need to be shifted by different amounts, then you can specify two fields in the attribute table that contain the x and y shift values for each feature.

The rotation is a more complex transformation to specify because you must define the pivot point around which the rotation is based. The rotation angle is specified in degrees (positive values correspond to clockwise rotations, negative values to counter-clockwise rotations). The pivot point can be specified as a point that is different for each feature, or is common among all features (a global pivot point). The default is that the pivot point is global. There are five options for where the pivot point is located in relation to the rectangle that bounds the dataset (in the case of a global pivot) or the feature (in the case of local pivots): the upper left (UL), upper right (UR), lower left (LL), lower right (LR) or centre (C). Note that the centre is not the 'centre of gravity', but the geometric centre of the envelope. There is also the option of specifying your own global pivot point by supplying its coordinates, e.g. pivot=c(315000,4950000).

If your goal is to adjust the spatial position of all the features in your dataset you will probably want to use a global pivot point. If your goal is to use this tool in the context of randomization tests then you will probably want to use a local pivot point.

The order in which a shift and rotation are applied can affect the result. By default the rotation is applied before the shift but you can override this using the 'rotfirst' parameter.

Syntax

shiftrotate(in, out, [shift], [rot], [pivot], [global], [rotfirst], [copyfields], [where]);

inthe input feature data source
outthe output feature data source
[shift]the distances to move features along the x and y axes, or the field names of the fields containing these values (must be in coordinate system units)
[rot]the rotation angle in degrees, or the field name of the field containing these values
[pivot]the pivot point for the rotation (upper left: UL or NW, upper right: UR or NE, lower right: LR or SE, lower left: LL or SW, centre: C) or a coordinate pair (default=C)
[global](TRUE/FALSE): if TRUE the pivot definition applies to the entire dataset (e.g. the NW corner of the dataset), if FALSE it applies to the current feature (e.g. the centre of the current feature) (default=TRUE)
[rotfirst](TRUE/FALSE): if TRUE and both a shift and rotation are specified, the rotation is applied before the shift, if FALSE the shift is applied first (default=TRUE)
[copyfields](TRUE/FALSE): if TRUE the fields in the input attribute table are copied to the output attribute table (default=FALSE)
[where]the selection statement that will be applied to the feature data source to identify a subset of features to process (see full Help documentation for further details)

Example

shiftrotate(in="C:\data\plots.shp", out="C:\data\newplots.shp", shift=c(-10000,500), rot=45, copyfields=TRUE);

shiftrotate(in="C:\data\plots.shp", out="C:\data\newplots.shp", shift=c("XVAL","YVAL"), rot="ROTVAL", pivot=LL, global=FALSE, rotfirst=FALSE);


Messages

Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently  Read more...

Links

Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn