Class StyleExpressionFactory

java.lang.Object
com.luciad.layers.styles.expressions.StyleExpressionFactory

public final class StyleExpressionFactory extends Object
This factory allows you to create style expressions that can be used when styling data.

Example:

 if (value1 < value2) {
   return "Color(255, 55, 55, 127)";
 else {
   return "Color(55, 255, 55, 127)";
 }
 
can be converted to an expression:

    StyleExpression<Color> expression = StyleExpressionFactory.ifThenElse(
        StyleExpressionFactory.lt(StyleExpressionFactory.constant(value1), StyleExpressionFactory.constant(value2)), // comparison
        StyleExpressionFactory.constant(color(255, 55, 55, 127)),   // then
        StyleExpressionFactory.constant(color(55, 255, 55, 127)));  // else
  • Method Details

    • constant

      @NotNull public static <T> StyleExpression<T> constant(@NotNull T value)
      Creates an expression that represents a 'constant' value.
      Type Parameters:
      T - the type of the constant: java.lang.Double, java.lang.Boolean, Coordinate or android.graphics.Color.
      Parameters:
      value - a value for the constant.
      Returns:
      an expression that represents a constant value.
    • parameter

      @NotNull public static <T> StyleExpression<T> parameter(@NotNull Observable<T> observable)
      Creates a parameter expression that is a style expression that can be changed at runtime.

      When it is changed, the styling will be updated to reflect the new value without having to re-create the expressions in which it is used. This makes it possible to make changes to the styling with almost-zero overhead.

      Type Parameters:
      T - the type of the constant: java.lang.Double, java.lang.Boolean, Coordinate or android.graphics.Color.
      Parameters:
      observable - an object that represents a mutable value. Users can hold on to this Observable in order to change the parameter value.
      Returns:
      a new parameter expression
    • mix

      @NotNull public static <T> StyleExpression<T> mix(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second, @NotNull StyleExpression<Double> fraction)
      Creates an expression that calculates an interpolated or extrapolated result between the result of first and second based on the result of fraction.
      Type Parameters:
      T - the type of the value to mix. Can be java.lang.Double, Coordinate or android.graphics.Color.
      Parameters:
      first - the first expression that is mixed
      second - the second expression that is mixed
      fraction - the mixing fraction. In range [0, 1] for interpolation. May also be a value outside that interval for extrapolation.
      Returns:
      an expression that calculates an interpolated or extrapolated result between the result of first and second based on the result of the fraction expression. Results in a double, point or color depending on the type of the operands.
    • acos

      @NotNull public static <T> StyleExpression<T> acos(@NotNull StyleExpression<T> operand)
      Creates an expression that takes the arccosine of another expression.
      Type Parameters:
      T - the type of the operand. Can be java.lang.Double, Coordinate.
      Parameters:
      operand - the expression of which to take the arccosine. For Coordinate, the function is applied to the individual element values.
      Returns:
      an expression that takes the arccosine of another expression, in radians. Results in a double, Coordinate.
    • asin

      @NotNull public static <T> StyleExpression<T> asin(@NotNull StyleExpression<T> operand)
      Creates an expression that takes the arcsine of another expression.
      Type Parameters:
      T - the type of the operand. Can be java.lang.Double, Coordinate.
      Parameters:
      operand - the expression of which to take the arcsine. For Coordinate, the function is applied to the individual element values.
      Returns:
      an expression that takes the arcsine of another expression, in radians. Results in a double, Coordinate.
    • atan

      @NotNull public static <T> StyleExpression<T> atan(@NotNull StyleExpression<T> operand)
      Creates an expression that takes the arcsine of another expression.
      Type Parameters:
      T - the type of the operand. Can be java.lang.Double, Coordinate.
      Parameters:
      operand - the expression of which to take the arctangent. For Coordinate, the function is applied to the individual element values.
      Returns:
      an expression that takes the arctangent of another expression, in radians. Results in a double, Coordinate.
    • cos

      @NotNull public static <T> StyleExpression<T> cos(@NotNull StyleExpression<T> operand)
      Creates an expression that takes the cosine of another expression.
      Type Parameters:
      T - the type of the operand. Can be double or Coordinate.
      Parameters:
      operand - the expression of which to take the cosine. For Coordinate, the function is applied to the individual element values. Values assumed to be in radians.
      Returns:
      an expression that takes the cosine of another expression. Results in a double, Coordinate.
    • sin

      @NotNull public static <T> StyleExpression<T> sin(@NotNull StyleExpression<T> operand)
      Creates an expression that takes the sine of another expression.
      Type Parameters:
      T - the type of the operand. Can be java.lang.Double, Coordinate.
      Parameters:
      operand - the expression of which to take the sine. For Coordinate, the function is applied to the individual element values. Values assumed to be in radians.
      Returns:
      an expression that takes the sine of another expression. Results in a double, Coordinate.
    • tan

      @NotNull public static <T> StyleExpression<T> tan(@NotNull StyleExpression<T> operand)
      Creates an expression that takes the tangent of another expression.
      Type Parameters:
      T - the type of the operand. Can be java.lang.Double, Coordinate.
      Parameters:
      operand - the expression of which to take the tangent. For Coordinate, the function is applied to the individual element values. Values assumed to be in radians.
      Returns:
      an expression that takes the tangent of another expression. Results in a double, Coordinate.
    • pow

      @NotNull public static <T> StyleExpression<T> pow(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
      Creates an expression that returns the result of the first expression raised to the power of the result of the second expression.

      The type of the operands should be the same. The (elements of the) first argument must not be less than 0 and if it is 0, the (corresponding elements of the) second argument must be greater than 0.

      Type Parameters:
      T - the type of the expressions: java.lang.Double, Coordinate.
      Parameters:
      first - The first expression to evaluate. Should result in a double, Coordinate or android.graphics.Color.
      second - The second expression to evaluate. Should result in the same type as first.
      Returns:
      An expression that returns the result of the first expression to the power of the result of the second expression. Results in a double, Coordinate depending on the type of the operands.
    • log

      @NotNull public static <T> StyleExpression<T> log(@NotNull StyleExpression<T> operand)
      Creates an expression that takes the natural logarithm of another expression.
      Type Parameters:
      T - the type of the operand expression: java.lang.Double, Coordinate.
      Parameters:
      operand - The expression of which to take the natural logarithm. Should result in a double, Coordinate.
      Returns:
      an expression that takes the natural logarithm of another expression.
    • min

      @NotNull public static <T, U> StyleExpression<T> min(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
      Creates an expression that returns the minimum of the given expressions.
      Type Parameters:
      T - the type of the first expression: java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of the second expression. Must be equal to T, or java.lang.Double.
      Parameters:
      first - The first expression to evaluate. Should result in a double, point or color.
      second - The second expression to evaluate. Should result in the same type as first or a double.
      Returns:
      an expression that resolves to the minimum of the two provided expressions. When a double is used with another type, the operation is applied to the individual element values and the result is of the other type (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).
    • max

      @NotNull public static <T, U> StyleExpression<T> max(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
      Creates an expression that returns the maximum of the given expressions.
      Type Parameters:
      T - the type of the first expression: java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of the second expression. Must be equal to T, or java.lang.Double.
      Parameters:
      first - The first expression to evaluate. Should result in a double, point or color.
      second - The second expression to evaluate. Should result in the same type as first or a double.
      Returns:
      an expression that resolves to the maximum of the two provided expressions. When a double is used with another type, the operation is applied to the individual element values and the result is of the other type (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).
    • add

      @NotNull public static <T, U> StyleExpression<T> add(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
      Creates an expression that adds the values of the two provided expressions.

      If both expressions are of the same type, the values are added as expected. If the first expression is of type Coordinate or android.graphics.Color, and second expression is of type double, then the value of second expression is added to every sub element of the first expression (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).

      Type Parameters:
      T - the type of the value of the first expression. Can be java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of the value of the second expression. Can be the same as T, or java.lang.Double.
      Parameters:
      first - the first expression to be added
      second - the second expression to be added
      Returns:
      an expression of the same type as first.
    • subtract

      @NotNull public static <T, U> StyleExpression<T> subtract(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
      Creates an expression that subtracts the value of the second expression from the value of the first expression.

      If both expressions are of the same type, the values are subtracted as expected. If the first expression is of type Coordinate or android.graphics.Color, and second expression is of type double, then the value of second expression is subtracted from every sub element of the first expression (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).

      Type Parameters:
      T - the type of the value of the first expression. Can be java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of the value of the second expression. Can be the same as T, or java.lang.Double.
      Parameters:
      first - the expression to be subtracted from
      second - the expression to be subtracted
      Returns:
      an expression of the same type as first.
    • multiply

      @NotNull public static <T, U> StyleExpression<T> multiply(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
      Creates an expression that multiplies the values of the two provided expressions.

      If both expressions are of the same type, the values are multiplied component by component. If the first expression is of type Coordinate or android.graphics.Color, and second expression is of type double, then the value of second expression is multiplied with every sub element of the first expression (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).

      Type Parameters:
      T - the type of the value of the first expression. Can be java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of the value of the second expression. Can be the same as T, or java.lang.Double.
      Parameters:
      first - the first expression to be multiplied
      second - the second expression to be multiplied
      Returns:
      an expression of the same type as first.
    • divide

      @NotNull public static <T, U> StyleExpression<T> divide(@NotNull StyleExpression<T> first, @NotNull StyleExpression<U> second)
      Creates an expression that divides the value of the first expression by the value of the second expression.

      If both expressions are of the same type, the values are divided component by component. If the first expression is of type Coordinate or android.graphics.Color, and second expression is of type double, then every sub element of the first expression is divided by the value of second expression (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).

      Type Parameters:
      T - the type of the value of the first expression. Can be java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of the value of the second expression. Can be the same as T, or java.lang.Double.
      Parameters:
      first - the dividend expression
      second - the divisor expression
      Returns:
      an expression of the same type as first.
    • fraction

      @NotNull public static <T, U> StyleExpression<T> fraction(@NotNull StyleExpression<T> operand, @NotNull StyleExpression<U> lowerBound, @NotNull StyleExpression<U> upperBound)
      Creates an expression that calculates the fraction of the given operand in the range [lowerBound, upperBound] evaluates to (operand - lowerBound) / (upperBound - lowerBound).

      For values of operand outside the range [lowerBound, upperBound], the results will lie outside the range [0, 1]. If the operand is of type Coordinate or android.graphics.Color and the bounds are of type double, the result will be of the same type as the operand with fraction being applied on each component (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).

      Type Parameters:
      T - the type of the operand: java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of lowerBound and upperBound. Must be equal to T, or java.lang.Double.
      Parameters:
      operand - the operand to evaluate
      lowerBound - the lowerBound to evaluate.
      upperBound - the upperBoundBound to evaluate.
      Returns:
      an expression of the same type as operand
    • clamp

      @NotNull public static <T, U> StyleExpression<T> clamp(@NotNull StyleExpression<T> operand, @NotNull StyleExpression<U> lowerBound, @NotNull StyleExpression<U> upperBound)
      Creates an expression that limits an operand to a range.

      The type of the bounds has to be the same. For Coordinate or android.graphics.Color, the clamping is applied to each component independently, either using the corresponding component in the bound (if of the same type as operand) or the bound value if double (note that for android.graphics.Color, each component is treated as a normalized value ([0, 1])).

      Type Parameters:
      T - the type of the operand: java.lang.Double, Coordinate or android.graphics.Color.
      U - the type of lowerBound and upperBound. Must be equal to T, or java.lang.Double.
      Parameters:
      operand - the operand to evaluate. Should result in a double, point or color.
      lowerBound - a double expression representing the lowerBound
      upperBound - a double expression representing the upperBound
      Returns:
      an expression (of the same type as operand) that limits the value of range to the range [lowerBound, upperBound]. If operand is a android.graphics.Color or Coordinate and bounds are doubles, the operation is applies to the individual element values.
    • eq

      @NotNull public static <T> StyleExpression<Boolean> eq(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
      Creates an expression that evaluates whether the two given expression evaluate to the same value.

      Note: in most cases, it is advised to use a threshold when comparing values. This can be done using the eq method that also takes a threshold expression as parameter.

      Type Parameters:
      T - the type of the value of both expressions. Can be java.lang.Boolean, java.lang.Double, Coordinate or android.graphics.Color.
      Parameters:
      first - the first expression to be compared
      second - the second expression to be compared
      Returns:
      a boolean expression that evaluates to true if and only if both expressions evaluate to the same value.
    • neq

      @NotNull public static <T> StyleExpression<Boolean> neq(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
      Creates an expression that evaluates whether the two given expression do not evaluate to the same value.
      Type Parameters:
      T - the type of the value of both expressions. Can be java.lang.Boolean, java.lang.Double, Coordinate or android.graphics.Color.
      Parameters:
      first - the first expression to be compared
      second - the second expression to be compared
      Returns:
      a boolean expression that evaluates to true if and only if the expressions evaluate to different values
    • ifThenElse

      @NotNull public static <T> StyleExpression<T> ifThenElse(@NotNull StyleExpression<Boolean> condition, @NotNull StyleExpression<T> thenExpression, @NotNull StyleExpression<T> elseExpression)
      Creates an expression that implements if-then-else logic.
      Type Parameters:
      T - the type of the value of thenExpression and elseExpression. Can be java.lang.Boolean, java.lang.Double, Coordinate or android.graphics.Color.
      Parameters:
      condition - the expression that decides which of the other expressions to take
      thenExpression - the expression whose result will be returned if condition is true
      elseExpression - the expression whose result will be returned if condition is false
      Returns:
      an expression that return the result of one of the other expressions, based on the condition
    • cases

      @NotNull public static <T> StyleExpression<T> cases(@NotNull StyleExpression<T> defaultExpression, @NotNull List<StyleExpression<Boolean>> conditions, @NotNull List<StyleExpression<T>> expressions)
    • dotProduct

      @NotNull public static <T> StyleExpression<Double> dotProduct(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
      Creates an expression that calculates the dot product of the given expressions.

      The type of the result of the two given expressions should be the same. You can take the dot product of doubles or Coordinate. Coordinates interpreted as vectors for this operation.

      Type Parameters:
      T - the type of the first and second expressions: double, Coordinate.
      Parameters:
      first - The first expression to evaluate. Should result in a double, Coordinate.
      second - The second expression to evaluate. Should result in the same type as first.
      Returns:
      An expression that calculates the dot product of the given expressions. Results in a double.
    • map

      @NotNull public static <T> StyleExpression<T> map(@NotNull StyleExpression<Double> indexExpression, @NotNull List<StyleExpression<T>> values, @NotNull StyleExpression<T> defaultExpression)
    • mixMap

      @NotNull public static <T> StyleExpression<T> mixMap(@NotNull StyleExpression<Double> fraction, @NotNull List<StyleExpression<T>> values)
    • distance

      @NotNull public static <T> StyleExpression<Double> distance(@NotNull StyleExpression<T> first, @NotNull StyleExpression<T> second)
      Creates an expression that calculates the Euclidean distance between two expressions representing points.

      The distance is defined as follows for the following supported types:

      • double: the distance between the double values: abs(second - first).
      • Coordinate: the regular cartesian distance: sqrt(x*x + y*y + z*z).
      Type Parameters:
      T - the type of expressions: java.lang.Double, Coordinate.
      Parameters:
      first - the first expression
      second - the second expression
      Returns:
      an expression that calculates the Euclidean distance between two expressions.
    • abs

      @NotNull public static StyleExpression<Double> abs(@NotNull StyleExpression<Double> value)
      Creates an expression that returns an expression with the absolute value.
      Parameters:
      value - the input for the abs function
      Returns:
      the absolute value of the given expression
    • andOp

      @NotNull public static StyleExpression<Boolean> andOp(@NotNull StyleExpression<Boolean> value1, @NotNull StyleExpression<Boolean> value2)
      Creates an expression that is the boolean 'and' of its parts.
      Parameters:
      value1 - the first expression to which the 'and' operator is applied
      value2 - the second expression to which the 'and' operator is applied
      Returns:
      an expression that is the boolean 'and' of the given expressions
    • orOp

      @NotNull public static StyleExpression<Boolean> orOp(@NotNull StyleExpression<Boolean> value1, @NotNull StyleExpression<Boolean> value2)
      Creates an expression that is the boolean 'or' of its parts.
      Parameters:
      value1 - the first expression to which the 'or' operator is applied
      value2 - the second expression to which the 'or' operator is applied
      Returns:
      an expression that is the boolean 'or' of the given expressions
    • notOp

      @NotNull public static StyleExpression<Boolean> notOp(@NotNull StyleExpression<Boolean> value)
      Creates an expression that is the boolean 'not' of the given expression.
      Parameters:
      value - a boolean expression
      Returns:
      an expression that is the boolean 'not' of the given expression
    • doubleAttribute

      @NotNull public static StyleExpression<Double> doubleAttribute(@NotNull String attributeName)
      Creates an attribute expression that represents a double.

      Expressions are evaluated for certain objects. Those object may have attributes ascribed to them. This expression allows access to those attributes by name. Which attributes are available depends on the evaluator of the expression, and on the data itself.

      For example, for OGC 3D tiles point cloud data, there is no fixed set of available attributes, but data files can define certain attributes, like 'color' or 'intensity' for each of the points in the point cloud. When these attributes are known up-front, you can use them as part of the style expression, for example to give each point its actual color, or to create a color based on the intensity value.

      You can discover which attributes you can use in the documentation of the model decoder of the format that is used. For example:

      When you display 3D tiles data, the layer only loads a subset of the available attributes in memory by default. To make sure that all required attributes are loaded, you must specify which attributes are used in the style expressions.

      Parameters:
      attributeName - the name of the attribute.
      Returns:
      a double expression that represents the value for the given attribute
    • coordinateAttribute

      @NotNull public static StyleExpression<Coordinate> coordinateAttribute(@NotNull String attributeName)
      Creates an attribute expression that represents a coordinate.

      Expressions are evaluated for certain objects. Those object may have attributes ascribed to them. This expression allows access to those attributes by name. Which attributes are available depends on the evaluator of the expression, and on the data itself.

      For example, for OGC 3D tiles point cloud data, there is no fixed set of available attributes, but data files can define certain attributes, like 'color' or 'intensity' for each of the points in the point cloud. When these attributes are known up-front, you can use them as part of the style expression, for example to give each point its actual color, or to create a color based on the intensity value.

      You can discover which attributes you can use in the documentation of the model decoder of the format that is used. For example:

      When you display 3D tiles data, the layer only loads a subset of the available attributes in memory by default. To make sure that all required attributes are loaded, you must specify which attributes are used in the style expressions.

      Parameters:
      attributeName - the name of the attribute.
      Returns:
      a coordinate expression that represents the value for the given attribute
    • colorAttribute

      @NotNull public static StyleExpression<android.graphics.Color> colorAttribute(@NotNull String attributeName)
      Creates an attribute expression that represents a color.

      Expressions are evaluated for certain objects. Those object may have attributes ascribed to them. This expression allows access to those attributes by name. Which attributes are available depends on the evaluator of the expression, and on the data itself.

      For example, for OGC 3D tiles point cloud data, there is no fixed set of available attributes, but data files can define certain attributes, like 'color' or 'intensity' for each of the points in the point cloud. When these attributes are known up-front, you can use them as part of the style expression, for example to give each point its actual color, or to create a color based on the intensity value.

      You can discover which attributes you can use in the documentation of the model decoder of the format that is used. For example:

      When you display 3D tiles data, the layer only loads a subset of the available attributes in memory by default. To make sure that all required attributes are loaded, you must specify which attributes are used in the style expressions.

      Parameters:
      attributeName - the name of the attribute.
      Returns:
      a color expression that represents the value for the given attribute
    • positionAttribute

      @NotNull public static StyleExpression<Coordinate> positionAttribute()
      Creates an expression that represents the position of the data that is styled.

      For example, for point clouds it represents for the position of an individual point in that point cloud. This for example makes it possible to adapt the transparency of points of a point cloud depending on their distance from an other location.

      Returns:
      a coordinate expression that represents the position of the data that is being styled.
    • lt

      @NotNull public static StyleExpression<Boolean> lt(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
      Creates an expression that evaluates whether the result of the first expression is strictly less than the result of the second expression.
      Parameters:
      first - the first double expression to be compared
      second - the second double expression to be compared
      Returns:
      a boolean expression that evaluates to true if and only if first evaluates to a double less than second
    • lte

      @NotNull public static StyleExpression<Boolean> lte(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
      Creates an expression that evaluates whether the result of the first expression is less than or equal to the result of the second expression.
      Parameters:
      first - the first double expression to be compared
      second - the second double expression to be compared
      Returns:
      a boolean expression that evaluates to true if and only if first evaluates to a double less than or equal to second
    • gt

      @NotNull public static StyleExpression<Boolean> gt(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
      Creates an expression that evaluates whether the result of the first expression is strictly greater than the result of the second expression.
      Parameters:
      first - the first double expression to be compared
      second - the second double expression to be compared
      Returns:
      a boolean expression that evaluates to true if and only if first evaluates to a double greater than second
    • gte

      @NotNull public static StyleExpression<Boolean> gte(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second)
      Creates an expression that evaluates whether the result of the first expression is greater than or equal to the result of the second expression.
      Parameters:
      first - the first double expression to be compared
      second - the second double expression to be compared
      Returns:
      a boolean expression that evaluates to true if and only if first evaluates to a double greater than or equal to second
    • eq

      @NotNull public static StyleExpression<Boolean> eq(@NotNull StyleExpression<Double> first, @NotNull StyleExpression<Double> second, @NotNull StyleExpression<Double> threshold)
      Creates an expression that evaluates whether the two given expression evaluate to close values, given some threshold.

      The size of the threshold depends on the values you want to compare:

      • when you want to compare floating point values, you need to take into account that during rendering the values are represented as 32-bit floating point (float) values. So the size of the threshold depends on the magnitude of the values that are used, and the float precision.
      • when you want to compare values that represent integers, this method should be used with a threshold of 0.5.
      Parameters:
      first - The first expression to evaluate
      second - The second expression to evaluate
      threshold - The Expression describing the maximum threshold before considering both values too far from each other.
      Returns:
      An expression that evaluates to true if the two expressions evaluate to close values, given the maximum threshold.
    • between

      @NotNull public static StyleExpression<Boolean> between(@NotNull StyleExpression<Double> lowerBound, @NotNull StyleExpression<Double> upperBound, @NotNull StyleExpression<Double> value)
      Creates an expression that evaluates whether the result of the operand is between a lower and upper bound (inclusive).

      In other words, this expression checks whether operand is in the range [lowerBound, upperBound].

      Parameters:
      lowerBound - a double expression representing the lowerBound
      upperBound - a double expression representing the upperBound
      value - the double expression to test
      Returns:
      an expression that evaluates to true if and only if value is in the range [lowerBound, upperBound].
    • crossProduct

      @NotNull public static StyleExpression<Coordinate> crossProduct(@NotNull StyleExpression<Coordinate> first, @NotNull StyleExpression<Coordinate> second)
      Creates an expression that calculates the cross product of two expressions representing Coordinate.
      Parameters:
      first - The first expression to evaluate.
      second - The second expression to evaluate.
      Returns:
      An expression that calculates the cross product of the given expressions. Results in a Coordinate (vector).
    • defaultColor

      @NotNull public static StyleExpression<android.graphics.Color> defaultColor()
      Creates an expression representing the default color that is applied to a mesh.

      The result depends on what is available in the data. It can be the color of a texture, a color attribute, a constant color default, etc.

      This type of expression is only supported for mesh styling expressions used by TileSet3DLayer.

      Returns:
      an expression representing the default color that is applied to a mesh.
    • frontFacing

      @NotNull public static StyleExpression<Boolean> frontFacing()
      Creates an expression that determines whether a part of a mesh is facing to or away from the camera.

      You can for example use it in a color expression to distinguish front-facing from back-facing pixels, and render those differently. This type of expression is only supported for mesh styling expressions used by TileSet3DLayer.

      The facing is determined based on triangle winding.

      If you simply wish to hide back-faced triangles, use MeshStyle.Builder#facetCulling with FacetCullingType#BackfaceCulling as parameter.

      Returns:
      an expression that determines whether a part of a mesh is facing to or away from the camera.
    • normalize

      @NotNull public static StyleExpression<Coordinate> normalize(@NotNull StyleExpression<Coordinate> operand)
      Creates an expression that normalizes a Coordinate.
      Parameters:
      operand - The expression to evaluate.
      Returns:
      an expression the computes the normalized Coordinate.
    • length

      @NotNull public static StyleExpression<Double> length(@NotNull StyleExpression<Coordinate> operand)
      Creates an expression that calculates the length of a Coordinate.
      Parameters:
      operand - The expression to evaluate.
      Returns:
      an expression that computes the length as a number.