Class GroupAsPolylineOperation
java.lang.Object
org.apache.sis.feature.AbstractIdentifiedType
org.apache.sis.feature.AbstractOperation
org.apache.sis.internal.storage.gpx.GroupAsPolylineOperation
- All Implemented Interfaces:
Serializable,BiFunction<AbstractFeature,,org.opengis.parameter.ParameterValueGroup, Object> Deprecable
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classThe attribute resulting from execution if theGroupAsPolylineOperation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringName of the property to follow in order to get the geometries to add to a polyline.private static final org.opengis.parameter.ParameterDescriptorGroupThe parameter descriptor for the "Group polylines" operation, which does not take any parameter.private final DefaultAttributeType<?>The expected result type to be returned bygetResult().private static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.feature.AbstractIdentifiedType
DEFINITION_KEY, DEPRECATED_KEY, DESCRIPTION_KEY, DESIGNATION_KEY, NAME_KEY -
Constructor Summary
ConstructorsConstructorDescriptionGroupAsPolylineOperation(Map<String, ?> identification, String association, DefaultAttributeType<?> result) Creates a new operation which will look for geometries in the given feature association. -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectapply(AbstractFeature feature, org.opengis.parameter.ParameterValueGroup parameters) Executes the operation on the specified feature with the specified parameters.org.opengis.parameter.ParameterDescriptorGroupReturns an empty parameter descriptor group.final DefaultAttributeType<?>Returns the expected result type.(package private) static <G> DefaultAttributeType<? extends G>getResult(Geometries<G> geometries) Creates theresultargument for the constructor.Methods inherited from class org.apache.sis.feature.AbstractOperation
equals, getDependencies, hashCode, toStringMethods inherited from class org.apache.sis.feature.AbstractIdentifiedType
getDefinition, getDescription, getDesignation, getName, getRemarks, isDeprecatedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThen
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
EMPTY_PARAMS
private static final org.opengis.parameter.ParameterDescriptorGroup EMPTY_PARAMSThe parameter descriptor for the "Group polylines" operation, which does not take any parameter. -
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
The expected result type to be returned bygetResult().
-
-
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 bygetResult().
-
-
Method Details
-
getResult
Creates theresultargument for the constructor. This creation is provided in a separated method because the same instance will be shared by manyGroupAsPolylineOperationinstances.- 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:
getParametersin classAbstractOperation- Returns:
- description of the input parameters.
-
getResult
Returns the expected result type.- Specified by:
getResultin classAbstractOperation- Returns:
- the type of the result, or
nullif 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:
applyin interfaceBiFunction<AbstractFeature,org.opengis.parameter.ParameterValueGroup, Object> - Specified by:
applyin classAbstractOperation- Parameters:
feature- the feature on which to execute the operation. Can benullif the operation does not need feature instance.parameters- the parameters to use for executing the operation. Can benullif the operation does not take any parameters.- Returns:
- the operation result, or
nullif this operation does not produce any result.
-