Class TLcdOGCVendorSpecificFunctions

java.lang.Object
com.luciad.ogc.filter.model.TLcdOGCVendorSpecificFunctions

public final class TLcdOGCVendorSpecificFunctions extends Object

This class contains the documentation of all the custom, vendor-specific TLcdOGCFunctions that are supported in Luciad's OGC Filter implementation. These functions can be used in querying a model, in TLcdOGCFilter and in SLD.

Geometric functions

Name Arguments Result Description
"minBoundsSize" minX: numerical TLcdOGCLiteral
minY: numerical TLcdOGCLiteral
Boolean Can be used to discard objects that are too small to see when zoomed out.
Returns true if the object is larger than either of the given sizes, false if it is smaller.
"geometryType" geometry: TLcdOGCPropertyName representing a geometry String Returns the type of the geometry as a string. May be Point, MultiPoint, LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, MultiLinearRing, GeometryCollection
"startAngle" geometry: TLcdOGCPropertyName representing a geometry Double Returns the start angle of the geometry, measured in degrees clockwise from the direction at 12 o'clock. An example use case within OGC SLD is to rotate a graphic according to the start angle of a geometry.
"endAngle" geometry: TLcdOGCPropertyName representing a geometry Double Returns the end angle of the geometry, measured in degrees clockwise from the direction at 12 o'clock. An example use case within OGC SLD is to rotate a graphic according to the end angle of a geometry.
"startPoint" geometry: TLcdOGCPropertyName representing a geometry ILcdPoint Returns the start point of the geometry. An example use case within OGC SLD is the ability to define a point symbolizer for the start point of a geometry.
"endPoint" geometry: TLcdOGCPropertyName representing a geometry ILcdPoint Returns the end point of the geometry. An example use case within OGC SLD is the ability to define a point symbolizer for the end point of a geometry.
"interiorPoint" geometry: TLcdOGCPropertyName representing a geometry ILcdPoint Returns a point that is interior to the geometry in case of a polygon, or sitting on its boundary otherwise. An example use case within OGC SLD is the ability to define an icon or label inside an area.
"vertices" geometry: TLcdOGCPropertyName representing a geometry Array of ILcdPoint instances Returns the points of a geometry. An example use case within OGC SLD is the ability to style the points of a polyline with an icon.

Comparison functions

Name Arguments Result Description
"in2", "in3", ..., "in10" candidate: the object to compare
v1: the first object to compare with
v2: the second object to compare with
... v10: the tenth object to compare with
Boolean Returns true if candidate is equal to one of the v1, v2, ... , v10 values. The function name indicates how many values the function expects.
For example "in5" expects 6 arguments: 1 candidate, and 5 values to compare with.

String functions

Name Arguments Result Description
"strLength" string: a string
Integer Returns the length of the string.
"strSubstring" string: a string
begin: an Integer representing the begin index
end: an Integer representing the end index
String Returns a new string that is a substring of the input string. The substring begins at the specified begin index, and extends to the character at index end-1. The indices are zero-based.
"strSubstringStart" string: a string
begin: an Integer representing the begin index
String Returns a new string that is a substring of the input string. The substring begins at the specified begin index, and extends to the last character of the string. The indices are zero-based.
"strToLowerCase" string: a string
String Returns the lower case version of the input string.
"strToUpperCase" string: a string
String Returns the upper case version of the input string.
"strTrim" string: a string
String Returns a version of the input string with leading and trailing spaces removed.

Parsing and formatting functions

Name Arguments Result Description
"dateFormat" format: a string indicating the date format according to the SimpleDateFormat syntax
date: a TLcdOGCPropertyName representing a date
String Returns the formatted date according to the provided format.
"dateParse" format: a string indicating the date format according to the SimpleDateFormat syntax
dateString: a TLcdOGCPropertyName representing a date encoded as a string
Date Returns the parsed date.

Transformation functions

Name Arguments Result Description
"Recode" property: a TLcdOGCPropertyName representing the property for which you want to transform the values.
inputValue1: the first property value you want to map to another value
outputValue1: the output value mapping for the first input value if the property matches that input value
...
vx: the x-th input / output value mapping to which the property will be compared.
Object Transforms a set of discrete property values into another set of values. Use it to map property values to other values.
Returns a string with the new property value.
For example, map the state names in a STATE_NAME property to colors using the state name as input value and a Hex color code as output value.
Since:
2017.0
  • Field Details

    • MIN_BOUNDS_SIZE_FUNCTION_NAME

      public static final String MIN_BOUNDS_SIZE_FUNCTION_NAME
      The "minBoundsSize" function evaluates a minimum size filter on geometries, excluding point geometries. The minimum size is checked against the bounds of the "main" geometry. You can use this for example to discard objects that are too small to see when zoomed out.

      Arguments

      • minX: the minimum size in the X direction. This is a numerical TLcdOGCLiteral representing model units of the target model, for example meters. For geodetic references, the unit is degrees.
      • minY: the minimum size in the Y direction. This is a numerical TLcdOGCLiteral representing model units of the target model, for example meters. For geodetic references, the unit is degrees.

      Return value

      A Boolean: true if the object is larger than either of the given sizes, false if it is smaller. If the result can't be calculated, it also evaluates to true.

      Example

      Example of how to use this in an OGC filter using the factory:
      
         new TLcdOGCFilter(function(MIN_BOUNDS_SIZE_FUNCTION_NAME, literal(150), literal(150)));
       
      Or, using TLcdOGCFilterFactory.minBoundsSize(double, double):
      
         new TLcdOGCFilter(minBoundsSize(150, 150));
       
      See Also:
    • GEOMETRY_TYPE_FUNCTION_NAME

      public static final String GEOMETRY_TYPE_FUNCTION_NAME
      The "geometryType" function returns the geometry type of an object as a String (Point, MultiPoint, LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, MultiLinearRing, GeometryCollection). You can use this for example in SLD to define a rule per geometry type.

      Arguments

      Return value

      A String representing the geometry type, or null when the geometry type could not be determined. Possible string return values are Point, MultiPoint, LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, MultiLinearRing, GeometryCollection.

      Example

      Example which retrieves all points:
          TLcdOGCFilter filter =
              new TLcdOGCFilter(eq(function(GEOMETRY_TYPE_FUNCTION_NAME, property("Geometry")), literal("Point")
              ));
      
      See Also:
    • START_ANGLE_FUNCTION_NAME

      public static final String START_ANGLE_FUNCTION_NAME
      The "startAngle" function returns the start angle of a geometry.

      Arguments

      Return value

      A Double representing the angle in degrees clockwise from the direction at 12 o'clock, or null when the geometry type could not be determined.

      Example

      Example which retrieves all geometries with a start angle between 0 and 180 degrees:
          TLcdOGCFilter filter =
              new TLcdOGCFilter(between(function(START_ANGLE_FUNCTION_NAME, property("Geometry")), literal(0), literal(180.0)
              ));
      
      Since:
      2019.1.01
      See Also:
    • END_ANGLE_FUNCTION_NAME

      public static final String END_ANGLE_FUNCTION_NAME
      The "endAngle" function returns the end angle of a geometry.

      Arguments

      Return value

      A Double representing the angle in degrees clockwise from the direction at 12 o'clock, or null when the geometry type could not be determined.

      Example

      Example which retrieves all geometries with an end angle between 0 and 180 degrees:
          TLcdOGCFilter filter =
              new TLcdOGCFilter(between(function(END_ANGLE_FUNCTION_NAME, property("Geometry")), literal(0), literal(180.0)
              ));
      
      Since:
      2019.1.01
      See Also:
    • START_POINT_FUNCTION_NAME

      public static final String START_POINT_FUNCTION_NAME
      The "startPoint" function returns the start point of a geometry.

      Arguments

      Return value

      An ILcdPoint representing the start point, or null when the geometry type could not be determined.

      Example

      Example which retrieves all geometries with an equal start and end point:
          TLcdOGCFilter filter =
              new TLcdOGCFilter(eq(function(START_POINT_FUNCTION_NAME, property("Geometry")), function(END_POINT_FUNCTION_NAME, property("Geometry"))
              ));
      
      Since:
      2019.1.01
      See Also:
    • END_POINT_FUNCTION_NAME

      public static final String END_POINT_FUNCTION_NAME
      The "endPoint" function returns the end point of a geometry.

      Arguments

      Return value

      An ILcdPoint representing the end point, or null when the geometry type could not be determined.

      Example

      See START_POINT_FUNCTION_NAME.
      Since:
      2019.1.01
      See Also:
    • INTERIOR_POINT_FUNCTION_NAME

      public static final String INTERIOR_POINT_FUNCTION_NAME
      The "interiorPoint" function returns a point that is interior to the geometry in case of a polygon, or sitting on its boundary otherwise.

      Arguments

      Return value

      An ILcdPoint representing a point that is interior to the geometry in case of a polygon, or sitting on its boundary otherwise. If the geometry type could not be determined, null is returned.
      Since:
      2022.0
      See Also:
    • VERTICES_FUNCTION_NAME

      public static final String VERTICES_FUNCTION_NAME
      The "vertices" function returns all points of a geometry.

      Arguments

      Return value

      An array of ILcdPoint instances representing the points of a geometry. If the geometry type could not be determined, null is returned.
      Since:
      2022.0
      See Also:
    • RECODE_FUNCTION_NAME

      public static final String RECODE_FUNCTION_NAME
      The "Recode" function transforms a set of discrete property values into another set of values.

      Arguments

      • property: a TLcdOGCPropertyName representing the property for which the values need to be transformed
      • inputValue1: the first input value to which the property will be compared
      • outputValue1: the output value if the property matches the first input value
      • ...
      • vx: the x-th input / output value to which the property will be compared.

      Return value

      An Object representing the new value for the property, or null when a new value could not be determined.

      Example

      This function is primarily used within OGC SLD / SE to compute styling parameters from property values in a concise way. An example use case is the computation of a color based on a property value. The following example illustrating this for a US states dataset, by defining a different fill color for each state:
          TLcdOGCFunction function = function(RECODE_FUNCTION_NAME, property("STATE_NAME"), literal("Washington"), literal("#6495ED"), literal("New York"), literal("#B0C4DE"));
      
      Since:
      2021.0
      See Also:
    • STRING_LENGTH_FUNCTION_NAME

      public static final String STRING_LENGTH_FUNCTION_NAME
      The string length function returns the length of the input string.

      Arguments

      Return value

      The length of the string as an Integer, or 0 when the input string is null.

      Example

      Example which selects objects where a certain string property has length 5:
      
         new TLcdOGCFilter(eq(function(STRING_LENGTH_FUNCTION_NAME, property("roadType")), literal(5)));
       
      See Also:
    • STRING_SUBSTRING_FUNCTION_NAME

      public static final String STRING_SUBSTRING_FUNCTION_NAME
      The substring function returns a substring of an input string. The range of the substring is defined by the specified start and end indices: the substring begins at the specified begin index, and extends to the character at index endIndex-1. The indices are zero-based.

      Arguments

      Return value

      The substring, or null when the indices or the input string are null. The function will also return null when the indices are outside the valid range for the input string.

      Example

      Example which selects the first 3 characters of a string and compares it with a hardcoded value "foo":
      
         new TLcdOGCFilter(eq(function(STRING_SUBSTRING_FUNCTION_NAME, property("name"), literal(0), literal(2)), literal("foo")));
       
      See Also:
    • STRING_SUBSTRING_START_FUNCTION_NAME

      public static final String STRING_SUBSTRING_START_FUNCTION_NAME
      The substring start function returns a substring of an input string. The range of the substring is defined by the specified start index: the substring begins at the specified begin index, and extends to the last character of the string. The indices are zero-based.

      Arguments

      Return value

      The substring, or null when the index or the input string are null. The function will also return null when the index is outside the valid range for the input string.

      Example

      Example which selects a substring from index 2 until the end, and compares it with a hardcoded value "foo":
      
         new TLcdOGCFilter(eq(function(STRING_SUBSTRING_START_FUNCTION_NAME, property("name"), literal(2)), literal("foo")));
       
      See Also:
    • STRING_TO_LOWER_CASE_FUNCTION_NAME

      public static final String STRING_TO_LOWER_CASE_FUNCTION_NAME
      The to lower case function returns a lower case version of an input string.

      Arguments

      Return value

      A string which is the lower case version of the input string, or null when the input string is null.

      Example

      Example which compares a property with a hard-coded lower case string
      
         new TLcdOGCFilter(eq(function(STRING_TO_LOWER_CASE_FUNCTION_NAME, property("name")), literal("lucy")));
       
      See Also:
    • STRING_TO_UPPER_CASE_FUNCTION_NAME

      public static final String STRING_TO_UPPER_CASE_FUNCTION_NAME
      The to upper case function returns a upper case version of an input string.

      Arguments

      Return value

      A string which is the upper case version of the input string, or null when the input string is null.

      Example

      Example which compares a property with a hard-coded upper case string
      
         new TLcdOGCFilter(eq(function(STRING_TO_LOWER_CASE_FUNCTION_NAME, property("name")), literal("LUCY")));
       
      See Also:
    • STRING_TRIM_FUNCTION_NAME

      public static final String STRING_TRIM_FUNCTION_NAME
      The string trim function returns a version of an input string with leading and trailing spaces removed.

      Arguments

      Return value

      A string that is the trimmed version of the input string, or null when the input string is null.

      Example

      Example which compares a property with a string without spaces
      
         new TLcdOGCFilter(eq(function(STRING_TRIM_FUNCTION_NAME, property("name")), literal("Lucy")));
       
      Since:
      2021.0
      See Also:
    • STRING_REPLACE_FUNCTION_NAME

      public static final String STRING_REPLACE_FUNCTION_NAME
      The string replace function returns the string with the pattern replaced with the given replacement text.

      Arguments

      • inputString: TLcdOGCPropertyName representing a String property
      • pattern: a string representing the pattern to be replaced (typically an TLcdOGCLiteral)
      • replacement: a string representing the pattern's replacement (typically an TLcdOGCLiteral)
      • global: a boolean indicating whether all occurrences need to be replaced (true) or only the first (false) (typically an TLcdOGCLiteral)

      Return value

      The input string with the pattern replaced with the given replacement text or null when the input string is null.
      Since:
      2023.0
      See Also:
    • IN_2_FUNCTION_NAME

      public static final String IN_2_FUNCTION_NAME
      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      Arguments

      • candidate: an object which will be compared against the values
      • v1: the first value object to which the candidate will be compared
      • v2: the second value object to which the candidate will be compared
      • ...
      • vx: the x-th value object to which the candidate will be compared.

      Return value

      A Boolean indicating whether the candidate object matches "primary", "secondary" or "trunk".

      Example

      Example which compares whether a road type matches any of the types from a predefined set:
      
         new TLcdOGCFilter(
           eq(function(IN_3_FUNCTION_NAME, property("type"), literal("primary"), literal("secondary"), literal("trunk")),
              literal(true)
             )
         );
       
      Since:
      2018.0
      See Also:
    • IN_3_FUNCTION_NAME

      public static final String IN_3_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • IN_4_FUNCTION_NAME

      public static final String IN_4_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • IN_5_FUNCTION_NAME

      public static final String IN_5_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • IN_6_FUNCTION_NAME

      public static final String IN_6_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • IN_7_FUNCTION_NAME

      public static final String IN_7_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • IN_8_FUNCTION_NAME

      public static final String IN_8_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • IN_9_FUNCTION_NAME

      public static final String IN_9_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • IN_10_FUNCTION_NAME

      public static final String IN_10_FUNCTION_NAME

      The in_x function checks whether a candidate equals to at least one of a number of values. The number in the function name indicates how many possible values the function expects.

      See the documentation of IN_2_FUNCTION_NAME for more details.
      Since:
      2018.0
      See Also:
    • DATE_FORMAT_FUNCTION_NAME

      public static final String DATE_FORMAT_FUNCTION_NAME
      The dateFormat function formats a date property according to the provided format.

      Arguments

      Return value

      The formatted date as a String, or null when the date property is null.
      Since:
      2022.1
      See Also:
    • DATE_PARSE_FUNCTION_NAME

      public static final String DATE_PARSE_FUNCTION_NAME
      The dateParse function parses a date from a String property to a Date.

      Arguments

      Return value

      The parsed date as a Date, or null when the dateString property is null.
      Since:
      2022.1
      See Also: