SHIFT_LAYER

The SHIFT_LAYER command moves a layer by the specified offset.

The following parameters are supported by the command:

  • FILENAME - filename of the layer to split. If an empty value is passed in, all loaded vector layers will be split. This parameter can be listed more than once to specify multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2". When running the script in the context of the main map view (including loading a workspace) you can also pass in the value 'USER CREATED FEATURES' to have the 'User Created Features' layer split or 'SELECTED LAYERS' to have any layers selected in the Control Center split. If you don't pass anything in all loaded layers will be operated on.
  • COORD_OFFSET - specifies the offset to apply to any coordinates for the features that match the specified criteria. The offset should be specified as a comma-delimited list of the X and Y offsets (and optionally Z), such as COORD_OFFSET="100000.0,200000.0". If you just want to shift in the Z direction, specify 0 for the X and Y shifts. For example, to shift by 5 units in the Z direction, use COORD_OFFSET="0,0,5".
  • COORD_OFFSET_UNITS - String representing units to use to interpret value obtained by "COORD_OFFSET". Accepts "M" (meters), "METERS", "FT", "FEET", "KM", "MILES", "NM" (nautical miles), "DEGREES" (arc degrees) or any other unit name from the projection dialog. Defaults to meters. e.g. COORD_OFFSET_UNITS="FT"

Example: Shift a layer by 500 meters in the X direction and 300 meters in the Y direction.

SHIFT_LAYER FILENAME="BackCove_base.tif" COORD_OFFSET="500,300" COORD_OFFSET_UNITS="M"

Here are 2 sample SHIFT_LAYER script commands to shift an already loaded Lidar GMP file using a 3D shift:

// Shift layer by the control point file
SHIFT_LAYER GCP_FILENAME="augusta_xform_3d.txt" HAS_3D_POINTS=YES
// Shifting by inline GCPs
SHIFT_LAYER HAS_3D_POINTS=YES \
GCP="(X+2;Y+1;Z+0.45),437527.500,4906329.450,49.55,437529.500,4906330.450,50" \
GCP="(X+1.5;Y+0.5;Z+0.11),437652.260,4906246.210,64.89,437653.310,4906246.710,65" \
GCP="(X-0.1;Y+0.01;Z-0.13),437993.600,4906317.620,46.63,437993.500,4906317.630,46.5" \
GCP="(X-2;Y-1;Z-0.5),438118.080,4906109.990,20.60,438116.080,4906108.990,20.10"