Class GroupAsPolylineOperation

All Implemented Interfaces:
Serializable, BiFunction<AbstractFeature,org.opengis.parameter.ParameterValueGroup,Object>, Deprecable

final class GroupAsPolylineOperation extends AbstractOperation
Creates a single (Multi)Polyline instance from a sequence of points or polylines stored in another property. This base class expects a sequence of Point or Polyline instances as input. The single (Multi)Polyline instance is re-computed every time this property is requested.
Examples:

Polylines created from points: a boat that record it's position every hour. The list of all positions is stored in an attribute with [0 … ∞] multiplicity. This class will extract each position and create a line as a new attribute. Any change applied to the positions will be visible on the line.

Polylines created from other polylines: a boat that record track every hour. The list of all tracks is stored in an attribute with [0 … ∞] multiplicity. This class will extract each track and create a polyline as a new attribute. Any change applied to the tracks will be visible on the polyline.

Since:
0.8
Version:
0.8
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • EMPTY_PARAMS

      private static final org.opengis.parameter.ParameterDescriptorGroup EMPTY_PARAMS
      The parameter descriptor for the "Group polylines" operation, which does not take any parameter.
    • association

      private final String association
      Name of the property to follow in order to get the geometries to add to a polyline. This property shall be a feature association, usually with [0 … ∞] multiplicity.
    • result

      private final DefaultAttributeType<?> result
      The expected result type to be returned by getResult().
  • Constructor Details

    • GroupAsPolylineOperation

      GroupAsPolylineOperation(Map<String,?> identification, String association, DefaultAttributeType<?> result)
      Creates a new operation which will look for geometries in the given feature association.
      Parameters:
      identification - name and other information to be given to this operation.
      association - name of the property to follow in order to get the geometries to add to a polyline.
      result - the expected result type to be returned by getResult().
  • Method Details

    • getResult

      static <G> DefaultAttributeType<? extends G> getResult(Geometries<G> geometries)
      Creates the result argument for the constructor. This creation is provided in a separated method because the same instance will be shared by many GroupAsPolylineOperation instances.
      Parameters:
      geometries - accessor to the geometry implementation in use (Java2D, ESRI or JTS).
    • getParameters

      public org.opengis.parameter.ParameterDescriptorGroup getParameters()
      Returns an empty parameter descriptor group.
      Specified by:
      getParameters in class AbstractOperation
      Returns:
      description of the input parameters.
    • getResult

      public final DefaultAttributeType<?> getResult()
      Returns the expected result type.
      Specified by:
      getResult in class AbstractOperation
      Returns:
      the type of the result, or null if none.
    • apply

      public final Object apply(AbstractFeature feature, org.opengis.parameter.ParameterValueGroup parameters)
      Executes the operation on the specified feature with the specified parameters. If the geometries have changed since last time this method has been invoked, the result will be recomputed.
      Specified by:
      apply in interface BiFunction<AbstractFeature,org.opengis.parameter.ParameterValueGroup,Object>
      Specified by:
      apply in class AbstractOperation
      Parameters:
      feature - the feature on which to execute the operation. Can be null if the operation does not need feature instance.
      parameters - the parameters to use for executing the operation. Can be null if the operation does not take any parameters.
      Returns:
      the operation result, or null if this operation does not produce any result.