Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

Name

add — Add a constant value to a dataset or add two datasets together

Syntax

add hi hiname ;# add active dataset to workspace hiname dataset, result in hiname.

add lo hiname ;# add active dataset to workspace hiname dataset, result in active.

add value ;# add value to active dataset, result in active data.

add x | y | sca value ;# add value to x or y or scalar coordinates.

add x | y | z | sca [value] xx | yy | zz | sca [factor] ;# add data coordinates together.

Description

The add command will add a constant value to a dataset or add two datasets together. add works on grid and polydata type of dataset. The result dataset is changed.

  • Grid: The two datasets must have the same grid dimensions.
  • Polydata: The two datasets must have the same number of points. For polydata the target for the adding operation can be any of the xyz coordinates and scalar values.
  • Adding two datasets together: The dataset in active is added to the dataset in hiname. The result data is placed in active if the lo argument is used, and in the workspace hiname if the hi argument is used.

Tip

The command Function is an alternative for mathematical operations on single datasets. Look inside the Geocap Toolbox for commands.

Arguments

hi hiname

Add dataset in active and hiname and the result data will be placed in workspace hiname.

lo hiname

Add dataset in active and hiname and the result data will be placed in active workspace.

value

Add value and result data will be placed in the active workspace.

hi | lo hiname tes

Add two poly dataset together according to rules above and optionally test using the tes argument if xy coordinates are equal and then add only for equal coordinates.

x | y | sca value

Add value to x- or y- or scalar coordinates. The result data will be placed in the active workspace.

x | y | z | sca [value] xx | yy | zz [factor]

Add value to x or y or scalar coordinates. The result data will be placed in the active workspace. Add data coordinate axes together. Optionally use a value that will be added to the coordinates and/or a factor that will be multiplied with the coordinates. x | y | z |sca represents the first data coordinates and xx | yy | zz represents the second data coordinates. The result is always placed in the first coordinates.

Examples

Ex.1: Add a value to a dataset

# Add the value 15 to a dataset in active
add 15

Ex.2: Add two grids

# Add a grid in active to a grid in workspace named mygrid and place the result in active
add lo mygrid

Ex.3: Add coordinates

# Add together x and y data coordinates and place the result in x data coordinates.
add x yy

See also

sub - Subtract operation, mul - Multiply operation, div - Divide operation

 

  • No labels