Package uk.ac.rdg.resc.edal.dataset
Class PRTreeFeatureIndexer
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.PRTreeFeatureIndexer
-
- All Implemented Interfaces:
Serializable
,MBRConverter<FeatureIndexer.FeatureBounds>
,FeatureIndexer
public class PRTreeFeatureIndexer extends Object implements FeatureIndexer, MBRConverter<FeatureIndexer.FeatureBounds>
This uses aPRTree
to index features spatially. All features within thisPRTree
have their positions specified in WGS84 with longitudes in the range (-180:180] - this is guaranteed by theaddFeatures(java.util.List<uk.ac.rdg.resc.edal.dataset.FeatureIndexer.FeatureBounds>)
method.- Author:
- Guy Griffiths
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface uk.ac.rdg.resc.edal.dataset.FeatureIndexer
FeatureIndexer.FeatureBounds
-
-
Constructor Summary
Constructors Constructor Description PRTreeFeatureIndexer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFeatures(List<FeatureIndexer.FeatureBounds> features)
Adds features to this indexer.Collection<String>
findFeatureIds(BoundingBox horizontalExtent, Extent<Double> verticalExtent, Extent<org.joda.time.DateTime> timeExtent, Collection<String> variableIds)
Finds the IDs of features with the given spatio-temporal constraints.Set<String>
getAllFeatureIds()
int
getDimensions()
double
getMax(int axis, FeatureIndexer.FeatureBounds bounds)
Get the maximum coordinate value for the given tdouble
getMin(int axis, FeatureIndexer.FeatureBounds bounds)
Get the minimum coordinate value for the given t.
-
-
-
Method Detail
-
addFeatures
public void addFeatures(List<FeatureIndexer.FeatureBounds> features)
Description copied from interface:FeatureIndexer
Adds features to this indexer. Features are defined in terms ofFeatureIndexer.FeatureBounds
objects which define the spatial boundaries of point features- Specified by:
addFeatures
in interfaceFeatureIndexer
-
findFeatureIds
public Collection<String> findFeatureIds(BoundingBox horizontalExtent, Extent<Double> verticalExtent, Extent<org.joda.time.DateTime> timeExtent, Collection<String> variableIds)
Description copied from interface:FeatureIndexer
Finds the IDs of features with the given spatio-temporal constraints. If any constraint isnull
it is considered to be unconstrained in that dimension.- Specified by:
findFeatureIds
in interfaceFeatureIndexer
- Parameters:
horizontalExtent
- TheBoundingBox
which features must have positions in.verticalExtent
- The vertical range which features must have positions in.timeExtent
- The time range which features must have positions in.variableIds
- The variable IDs which features must contain- Returns:
- A
Collection
of IDs for features which match all of the given constraints
-
getAllFeatureIds
public Set<String> getAllFeatureIds()
- Specified by:
getAllFeatureIds
in interfaceFeatureIndexer
- Returns:
- All feature IDs present in this
FeatureIndexer
-
getDimensions
public int getDimensions()
- Specified by:
getDimensions
in interfaceMBRConverter<FeatureIndexer.FeatureBounds>
- Returns:
- the number of dimensions this converter cares about
-
getMax
public double getMax(int axis, FeatureIndexer.FeatureBounds bounds)
Description copied from interface:MBRConverter
Get the maximum coordinate value for the given t- Specified by:
getMax
in interfaceMBRConverter<FeatureIndexer.FeatureBounds>
- Parameters:
axis
- the axis to get the max value forbounds
- the object to get the mbr ordinate for- Returns:
- the max value for the given axis
-
getMin
public double getMin(int axis, FeatureIndexer.FeatureBounds bounds)
Description copied from interface:MBRConverter
Get the minimum coordinate value for the given t.- Specified by:
getMin
in interfaceMBRConverter<FeatureIndexer.FeatureBounds>
- Parameters:
axis
- the axis to get the min value forbounds
- the object to get the mbr ordinate for- Returns:
- the min value for the given axis
-
-