public class GeoDocFilter extends DocFilter
Geographic document filter which filters records and documents by intersecting their coordinates with a simple geographic area. This method uses either a bounding box or a center point and radius to construct an area to check.
Since documents do not include geographic coordinates, this class currently returns false for the matchDoc() method. In the future, this class might incorporate a GeoLocator to determine the location of geographic key terms.
Constructor and Description |
---|
GeoDocFilter(java.lang.String fieldName,
GeoCoord centerCoord,
double radiusInKm)
Create a geographic DocFilter which checks coordinates in the given
field to see if they are within a particular distance of the center
point.
|
GeoDocFilter(java.lang.String fieldName,
GeoCoord lowerLeft,
GeoCoord upperRight)
Create a geographic filter using a bounding box as the region of
interest.
|
GeoDocFilter(java.lang.String fieldName,
GeoCoord centerCoord,
Measure radMeasure)
Create a geographic DocFilter which checks coordinates in the given
field to see if they are within a particular distance of the center
point.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(DataRecord record)
Check the data record to see if the coordinate field matches this
filter.
|
protected boolean |
matchDoc(DocData doc)
Return whether the represented document is accepted by this filter.
|
accept, filterDocuments, getTag, setTag
filterRecords
public GeoDocFilter(java.lang.String fieldName, GeoCoord centerCoord, double radiusInKm)
fieldName
- the name of the coordinate fieldcenterCoord
- the center coordinateradiusInKm
- radius to check, in kilometerspublic GeoDocFilter(java.lang.String fieldName, GeoCoord lowerLeft, GeoCoord upperRight)
fieldName
- name of the coordinate fieldlowerLeft
- the lower left (southwest) corner of the bounding boxupperRight
- the upper right (northeast) corner of the bounding boxpublic GeoDocFilter(java.lang.String fieldName, GeoCoord centerCoord, Measure radMeasure)
fieldName
- the name of the coordinate fieldcenterCoord
- the center coordinateradMeasure
- radius to check, as a Measure of Lengthpublic boolean accept(DataRecord record)
accept
in class DataFilter
record
- the data record to match.protected boolean matchDoc(DocData doc)