public class FeatureGroupFilter
extends java.lang.Object
implements java.lang.Cloneable
FeatureGroupFilter
filters a set of Feature
objects
using a grouping concept. Features are grouped by an attribute value they
have in common -- in the case of point features that represent measurements
made over time, this could by the ID of the platform making the measurement.
The group is then filtered by only selecting the single feature in the
group whose attribute value is closest to a specified value. For example,
suppose that we have features with "id" and "time" attributes as follows:
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Integer> |
nameMap
The map to use to translate name to index for attributes.
|
Constructor and Description |
---|
FeatureGroupFilter(java.lang.String groupAttName,
java.util.Map<java.lang.String,java.lang.Integer> nameMap,
java.lang.String filterAttName,
java.lang.Object targetAttValue)
Creates a new group filter with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
java.util.List<Feature> |
filter(java.util.List<Feature> features)
Filters a collection of features using the algorithm in this filter for
matching.
|
java.lang.String |
getFilterAttribute()
Gets the filter attribute name.
|
java.lang.String |
getGroupAttribute()
Gets the grouping attribute name.
|
java.lang.Object |
getTargetValue()
Gets the target value.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
void |
setFilterAttribute(java.lang.String filterAttName)
Sets the filtering attribute.
|
void |
setGroupAttribute(java.lang.String groupAttName)
Sets the grouping attribute.
|
void |
setTargetValue(java.lang.Object targetAttValue)
Sets the target attribute value The target value is used to filter each
feature group.
|
java.lang.String |
toString() |
protected java.util.Map<java.lang.String,java.lang.Integer> nameMap
public FeatureGroupFilter(java.lang.String groupAttName, java.util.Map<java.lang.String,java.lang.Integer> nameMap, java.lang.String filterAttName, java.lang.Object targetAttValue)
groupAttName
- the name of the attribute to use for creating groups
of features.nameMap
- the name to index mapping.filterAttName
- the name of the attribute to use for filtering.targetAttValue
- the target attribute value to filter for.public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.List<Feature> filter(java.util.List<Feature> features)
features
- the features to filter.public void setGroupAttribute(java.lang.String groupAttName)
groupAttName
- the name of the grouping attribute to use while filtering.public java.lang.String getGroupAttribute()
setGroupAttribute(java.lang.String)
public void setFilterAttribute(java.lang.String filterAttName)
filterAttName
- the name of the filtering attribute to use.public java.lang.String getFilterAttribute()
setFilterAttribute(java.lang.String)
public void setTargetValue(java.lang.Object targetAttValue)
targetAttValue
- the target value to use for measuring distance.public java.lang.Object getTargetValue()
setTargetValue(java.lang.Object)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception