UnitConversionOperator Class
An operator that converts attribute values between different units.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CEOperators assembly)
Syntax
public class UnitConversionOperator : UnaryOperator
Remarks
This operator can be used to convert attribute values between different units. By setting the ConvertFrom and ConvertTo properties it is possible to make it perform a number of different conversions.
Additionally, the Factor and Offset properties make it possible to define custom conversions. The possibility to use indirect or keyed lookup for these properties makes UnitConversionOperator very versatile.
Two important uses of this operator are highlighted below.
Converting to the unit of the view coordinate reference system
By setting the ConvertTo property to ViewUnits, you can convert an attribute value from e.g. meters to the unit of the coordinate reference system used by the view. When used together with the length unit property of visualizers, this makes it much easier to make the attribute-controlled visualization independent of the reference system.
When performing the ViewUnits conversion, UnitConversionOperator uses the scale factors of the coordinate reference system at the center of each geographical feature.
Converting angles
UnitConversionOperator can convert attribute values between degrees, grads (gons) and radians. By setting the Factor property to -1 you can also convert between clockwise and counterclockwise rotation.
It is also possible to convert angles to azimuths and vice versa.
Converting feature coordinates
The operator will convert the z coordinates (the heights) of vector features if ConvertHeights is True. It cannot convert the x and y coordinates.
To convert cell values of rasters, you have to use the RasterConversionOperator instead.
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
Operator
UnaryOperator
UnitConversionOperator
Platforms
Windows, Linux, Android
UnitConversionOperator Members
The UnitConversionOperator type has the following members.
Constructors
Name | Description |
---|---|
UnitConversionOperator | Initializes a new instance of the UnitConversionOperator class. |
Properties
Name | Description |
---|---|
Attributes | Gets the list containing the names of the attributes whose units should be converted. |
ConvertFrom | Gets or sets the unit to convert from. |
ConvertHeights | Gets or sets a flag controlling whether heights (z coordinates) shall be converted. |
ConvertTo | Gets or sets the unit to convert to. |
CreateMissingAttributes | Gets or sets a flag controlling whether missing attributes shall be created. |
Description | Gets or sets a short description of the operator. Inherited from Operator |
DisplayName | Gets or sets a display name for the operator. Inherited from Operator |
Factor | Gets or sets a value that is multiplied with the converted attribute values. |
Input | Gets or sets the input operator, from which this operator reads features. Inherited from UnaryOperator |
IsDisposed | Gets a value that tells whether the current UnitConversionOperator has been disposed. Inherited from EngineObject |
IsoMetadataDocument | Gets or sets the path to an ISO 19139 metadata document for the operator. Inherited from Operator |
Name | Gets or sets the name of the operator. Inherited from Operator |
NativeHandle | Gets the native Carmenta Engine kernel object the current UnitConversionOperator represents. Inherited from EngineObject |
Offset | Gets or sets a value that is added to the converted attribute values. |
IUserProperties.UserProperties | Gets the AttributeSet that contains the user properties. Inherited from IUserProperties |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
FindChildObject | Overloaded. Finds the child object with the specified name. Inherited from Operator |
FlushCache | Marks the layer as flushed which will release cached resources during the next update. Inherited from Operator |
GetChildObjects | Overloaded. Gets the child objects of the current object. Inherited from Operator |
GetFeatures | Overloaded. Gets features from the operator chain. Inherited from Operator |
GetLocalizedDescription | Gets a localized version of the operator description in a specific language. Inherited from Operator |
GetLocalizedDisplayName | Gets a localized version of the operator display name in a specific language. Inherited from Operator |
GetLocalizedIsoMetadataDocument | Gets the path to an ISO 19139 metadata document for a specific language. Inherited from Operator |
GetRasterFeature | Overloaded. Gets raster features from the operator chain and merges them into a single raster. Inherited from Operator |
HasLocalizedDescription | Checks if a localized version of the operator description is available in a specific language. Inherited from Operator |
HasLocalizedDisplayName | Checks if a localized version of the operator display name is available in a specific language. Inherited from Operator |
HasLocalizedIsoMetadataDocument | Checks if an ISO 19139 metadata document is available for a specific language. Inherited from Operator |
SetLocalizedDescription | Sets a operator description in a specific language. Inherited from Operator |
SetLocalizedDisplayName | Sets a operator display name in a specific language. Inherited from Operator |
SetLocalizedIsoMetadataDocument | Sets the path to an ISO 19139 metadata document for the operator, for a specific language. Inherited from Operator |