====== Attribute Formulas ====== ===== Formulas available via User Interface ===== Functions by default available via the Orbit user interface, see [[171:desktop:dataset:contents:index#rules|Attribute Rules]]. \\ All these functions use only one argument. === Object Functions === |< 100% 20% 10% 10% 60% >| ^ Formula ^ Datatype ^ Spatial type ^ Description ^ | CreationDate | String | All | Indicates the exact date the object was created | | CreationDateTime | String | All | Indicates the exact date and time the spatial object was created | | ObjectId | Integer | All | | | UniqueId | Integer | | === Spatial Functions === |< 100% 20% 10% 10% 60% >| ^ Formula ^ Datatype ^ Spatial type ^ Description ^ | Center | | CenterM | Integer | Point | Returns the user Defined **M**easurement from the point object (will be 0 if coordinatesystem is 2D or 3D or if there is no measurement). | | ::: | ::: | Line, Area | Shows the user Defined measurement from the center of the rectangle that surrounds the line or area object | | CenterX | Float | Point | Shows the X coordinate from the point object (value refers to the used [[180:technology:core:crs_theory|CRS]]). | | ::: | ::: | Line, Area | Shows the X coordinate from the center of the rectangle that surrounds the line or area object | | CenterY | Float | Point | Shows the Y coordinate from the point object (value refers to the used [[180:technology:core:crs_theory|CRS]]). | | ::: | ::: | Line, Area | Shows the Y coordinate from the center of the rectangle that surrounds the line or area object | | CenterZ | Float | Point | Shows the Z coordinate from the point object ([[171:desktop:dataset:contents:structure#coordinate|will be 0 if coordinatesystem is 2D or 2D M or if there is no heigh reference.]])| | ::: | ::: | Line, Area | Shows the Z coordinate from the center of the rectangle that surrounds the line or area object | | CoordinateCount | Integer | All | Shows the number of points that an object contains | | First | | FirstM | Float | Point | Shows the user Defined **M**easurement from the point object (will be 0 if coordinatesystem is 2D or 3D or if there is no measurement). | | ::: | ::: | Line, Area | Shows the user defined measurement from the first point/vertex of the line or area object. first indicates the first point that is placed when the object is drawn. | | FirstSegmentAngle | | FirstSegmentLength | | FirstTriangleHeight | | FirstX | Float | Point | | ::: | ::: | Line, Area | Shows the X coordinate from the first point/vertex of the line or area object. first indicates the first point that is placed when the object is drawn. | | FirstY | Float | Point | | ::: | ::: | Line, Area | Shows the Y coordinate from the first point/vertex of the line or area object. first indicates the first point that is placed when the object is drawn. | | FirstZ | Float | Point | | ::: | ::: | Line, Area | Shows the Z coordinate from the first point/vertex of the line or area object. first indicates the first point that is placed when the object is drawn.* | | IsClosed | String, Boolean | all | Returns true for a line object if the beginpoint and the endpoint are the same. Area and point objects are always closed, thus true. | | IsWellFormed | String, Boolean | All | Returns true if the geometry of the spatial object is well formed according the rules of the [[http://www.opengeospatial.org/|OGC]] | | Last | | LastM | Float | Point | | ::: | ::: | Line, Area | Shows the user defined measurement from the last point/vertex of the line or area object. Last indicates the last point that is placed when the object is drawn.* | | LastX | Float | Point | | ::: | ::: | Line, Area | Shows the X coordinate from the last point/vertex of the line or area object. Last indicates the last point that is placed when the object is drawn. | | LastY | Float | Point | | ::: | ::: | Line, Area | Shows the Y coordinate from the last point/vertex of the line or area object. Last indicates the last point that is placed when the object is drawn. | | LastZ | Float | Point | | ::: | ::: | Line, Area | Shows the Z coordinate from the last point/vertex of the line or area object. Lastt indicates the last point that is placed when the object is drawn.** | | Max | | MaxM | Float | Point | | ::: | ::: | Line, Area | Shows the user defined measurement from the right upper corner corner of the rectangle that surrounds the line or area object. | | MaxX | Float | Point | | ::: | ::: | Line, Area | Shows the X coordinate from the right upper corner corner of the rectangle that surrounds the line or area object. | | MaxY | Float | Point | | ::: | ::: | Line, Area | Shows the Y coordinate from the right upper corner corner of the rectangle that surrounds the line or area object. | | MaxZ | Float | Point | | ::: | ::: | Line, Area | Shows the Z coordinate from the right upper corner corner of the rectangle that surrounds the line or area object.* | | Min | | MinM | Float | Point | | ::: | ::: | Line, Area | Shows the user defined measurement from the left bottom corner corner of the rectangle that surrounds the line or area object. | | MinX | Float | Point | | ::: | ::: | Line, Area | Shows the X coordinate from the left bottom corner of the rectangle that surrounds the line or area object. | | MinY | Float | Point | | ::: | ::: | Line, Area | Shows the Y coordinate from the left bottom corner of the rectangle that surrounds the line or area object. | | MinZ | Float | Point | | ::: | ::: | Line, Area | Shows the Z coordinate from the left bottom corner of the rectangle that surrounds the line or area object. | | ObjectArea | Float | Line, Area | Calculates the area in square meter. Line objects will return 0.0 if they are not closed (cfr. IsClosed) | | ObjectLength | Float | Line, Area | Calculates the length in meter. | | PartCount | Integer | | Enumerates the amount of parts from which the object is build. | | PointCount | Integer | | Enumerates the amount of points from which the object is build. | | SpatialImage.SampleValue | | | === Mobile Mapping Functions === Mobile Mapping functions are only available for the Orbit MM desktop portfolio \\ These functions are calculated and updated when editing the object via a mobile mapping view. \\ Mobile Mapping functions calculating a distance, length or area are using the on the fly calculated projected coordinate system to achieve the exact metric result. |< 100% 20% 10% 10% 60% >| ^ Formula ^ Datatype ^ Spatial type ^ Description ^ | Measure Area XY | Float | Area |2D area, or area of projected 3D area with Z = 0 | | Measure Area XYZ | Float | Area |Area projected on best fit 3D plane through all measured vertices. This technique expects all vertices to be measured in approximately a single 3D plane. | | Measure Distance 2D| Float | Line | 2D length of straight line between start and end point, or length of the projected 3D distance with Z = 0. | | Measure Distance 3D | Float | Line | 3D length of straight line between start and end point. | | Measure Distance Error XY | Float | Line |Triangulation error for Measure Distance 2D | | Measure Distance Error XYZ | Float | Line | Triangulation error for Measure Distance 3D | | Measure Distance Error Z | Float | Line | Triangulation Z error for Measure Distance 3D | | Measure Distance X | Float | Line |absolute difference in X between start and end point of straight line | | Measure Distance Y | Float | Line |absolute difference in Y between start and end point of straight line | | Measure Distance Z | Float | Line |absolute difference in Z between start and end point of straight line | | Measure Length XY | Float | Line, Area | Summed 2D length of each line segment as distance XY. | | Measure Length XYZ | Float | Line, Area | Summed 3D length of each line segment as distance XYZ. | | Measure Point1 Distance to Ground | Float | Point | absolute difference in Z between Point1 and the Ground | | Measure Point1 Error XY | Float | Point |Triangulation error XY for Measure Point1 | | Measure Point1 Error XYZ | Float | Point | Triangulation error XYZ for Measure Point1 | | Measure Point1 Error Z | Float | Point | Triangulation error Z for Measure Point1 | | Measure Point1 X-Position | Float | Point | the x coordinate of Point1 | | Measure Point1 Y-Position | Float | Point | the y coordinate of Point1 | | Measure Point1 Z-Position | Float | Point | the z coordinate of Point1 | | Measure Point2 Distance to Ground | Float | Point | absolute difference in Z between Point2 and the Ground | | Measure Point2 Error XY | Float | Point | Triangulation error XY for Measure Point2 | | Measure Point2 Error XYZ | Float | Point | Triangulation error XYZ for Measure Point2 | | Measure Point2 Error Z | Float | Point | Triangulation error Z for Measure Point2 | | Measure Point2 X-Position | Float | Point | the x coordinate of Point2 | | Measure Point2 Y-Position | Float | Point | the y coordinate of Point2 | | Measure Point2 Z-Position | Float | Point | the z coordinate of Point2 | | Measure Distance over curve | Float | Lines |3D length over catenary curve | | Measure Span | Float | Lines | Catenary curve: Closest distance between 2 connection points | | Measure Clearance | Float | Lines | Catenary curve: Minimum distance from cable to ground | ===== Formulas available via Configuration ===== Functions available via ord file editing, see [[180:technology:supported_formats:other:ord|]]. \\ These functions may use one ore multiple arguments. Attribute argument references can only be used within the same Attribute Set. The syntax is straightforward but must be exact : * Function : Function() * Arguments in function comma separated : Function(Argument1,Argument2,...) * Attribute reference by using [ ] : Function([Atribute1],[Atribute2],Argument3,...) * Decimal character is dot : Function([Atribute1],[Atribute2],3.1457,Argument4,...) === Generic Standard Functions === |< 100% 20% 10% 10% 60% >| ^ Function ^ Arguments ^ Datatype ^ Description ^ | Abs | | Double | | | ACos | | Double | | | Add | | Double | | | And | | Boolean | | | ArgumentAt | | | | | ArgumentCount | | | | | ArgumentsAt | | | | | ASin | | Double | | | ATan | | Double | | | ATan2 | | Double | | | Between | | Boolean | | | Char | (A) | String | Add a character with a specific code \\ e.g. : Char(9) results in a 'TAB' character \\ e.g. : Char(13,10) results in a DOS newline sequence | | Concat | | String | Combines one or more strings, attributevalues or functions \\ e.g. Concat([KERKHOFCODE],”_”,[ZONECODE],”_”,[RIJCODE],”_”,[GRAF]) | | Cos | | Double | | | Decimals | | String | | | DegToRad | | Double | | | Divide | | Double | | | Double | | Double | | | Equal | | Boolean | | | Exp | | Double | | | FirstArgument | | | | | FirstUpperCase | | String | | | Hypot2D | (A,B,C) | Double | http://en.wikipedia.org/wiki/Hypotenuse | | Hypot3D | (A,B,C) | Double | http://en.wikipedia.org/wiki/Hypotenuse | | If | | Any | | | In | | Boolean | | | IndexOf | (A,B) | Integer | Displays the numeric position of a substring \\ e.g. : IndexOf(“The last emperor”,”emperor”) results in 9 | | Int | | Double | | | IsNull | | Boolean | | | Larger | | Boolean | | | LargerOrEqual | | | | | LastArgument | | | | | LastIndexOf | (A,B) | Integer | Displays the last numeric position of a substring \\ e.g. : LastIndexOf(“C:\temp\my.map\file.txt”,”.”) results in 19 | | Left | | String | Takes a part of a string, starting from the left position. The second parameter determines the number of characters. \\ e.g.Left([Attribute],7) | | Length | ([Attribute]) | | Calculates string length of the attribute. | | Log | | Double | | | Long | | | | | LowerCase | | String | | | LPad | (A,B,C) | String | Left pad a value with a pad character to the requested size \\ e.g. : LPad(“123”,6,”0”) results in 000123 \\ e.g. : LPad(“de”,3,”+”) results in +de | | LTrim | | String | | | Max | | String | | | Min | | String | | | Multiply | | Double | e.g. multiply([Attribute],3.28083) (from meters to feet) | | NewLine | | String | | | Not | | Boolean | | | NowDate | | String | | | NowDateTime | | String | | | NowTime | | String | | | Or | | Boolean | | | PatternMatch | (A,B) | String | Determines whether a particular pattern occurs \\ e.g. : PatternMatch(“255.17.23”,”*.17.*”) results in 'true' | | Pi | | Double | | | Power | | Double | | | Printf | | String | | | RadToDeg | | Double | | | Random | | Double | | | Replace | (A,B,C) | String | Replaces a substring by another \\ e.g. : Replace(“the last emperor”,”last”,”first) results in “the first emperor” | | Right | | String | | | RPad | (value,size,pad) | String | Right pad a value with a pad character to the requested size \\ e.g. : RPad(“123”,6,”0”) results in 123000 \\ e.g. : RPad(“de”,3,”+”) results in de+ | | RTrim | | String | | | Sin | | Double | | | Smaller | | Boolean | | | SmallerOrEqual | | Boolean | | | Split | (A,B) | String | Split a string in different parts \\ e.g. : Split(“127.B.3”,”.”) results in “127” “B” and “3” | | Sqrt | | Double | | | SubString | () | String | Returns a substring from string A, starting at index position B with length C. | | SubString2 | (A,B,C) | String | Returns a substring from string A, starting at index position B til, index position C. | | Subtract | | Double | | | Tan | | Double | | | Trim | | String | | | UpperCase | | String | | === Spatial Functions === |< 100% 20% 10% 10% 60% >| ^ Formula ^ Datatype ^ Spatial type ^ Description ^ | Angle | Float | All | | | Center | Float | All | | | Distance2D | Float | All | | | Distance3D | Float | All | | | DistanceZ | Float | All | | | First | Float | All | | | GetM | Float | All | | | GetX | Float | All | | | GetY | Float | All | | | GetZ | Float | All | | | Last | Float | All | | | Max | Float | All | | | Min | Float | All | | | NewPoint2D | Float | All | | | NewPoint2DM | Float | All | | | NewPoint3D | Float | All | | | NewPoint3DM | Float | All | | | PerpendicularLine | Float | All | | | PointInterpolation | | Point | Float | All | | | ProjectPointOnLine | Float | All | | === Mobile Mapping functions === Mobile Mapping functions are only available for the Orbit MM desktop portfolio \\ |< 100% 20% 10% 70% >| ^ Formula ^ Datatype ^ Description / Arguments^ | PanFromDirectionAndUp() | Float | ([Direction_Easting],[Direction_Northing],[Direction_Elevation],[Up_Easting],[Up_Northing],[Up_Elevation]) | | TiltFromDirectionAndUp() | Float | ([Direction_Easting],[Direction_Northing],[Direction_Elevation],[Up_Easting],[Up_Northing],[Up_Elevation]) | | RollFromDirectionAndUp() | Float | ([Direction_Easting],[Direction_Northing],[Direction_Elevation],[Up_Easting],[Up_Northing],[Up_Elevation]) | | PanFromRotationYXZ | Float | ([rotation_y],[rotation_x],[rotation_z]) | | TiltFromRotationYXZ | Float | ([rotation_y],[rotation_x],[rotation_z]) | | RollFromRotationYXZ | Float | ([rotation_y],[rotation_x],[rotation_z]) | | PanFromOmegaPhiKappa | Float | ([Omega],[Phi],[Kappa]) | | TiltFromOmegaPhiKappa | Float | ([Omega],[Phi],[Kappa]) | | RollFromOmegaPhiKappa | Float | ([Omega],[Phi],[Kappa]) | === Example use formulas === AttributeConstraint= ModelId=1 AttributeSetName=Attributes AttributeName=Oppervlakte Rule=expression Expression=ObjectArea() AttributeName=Perimeter Rule=expression Expression=Spatial.Length AddFunctionAttribute= ModelId=1 AttributeSetName=Attributes AddAttribute= AttributeName=Oppervlakte_hm AttributeType=FLOAT AttributeExpression=Add(100,Divide([Oppervlakte],1000))