public interface GeospatialPointDatabase<E extends GeospatialPoint> extends Collection<E>
Modifier and Type | Method and Description |
---|---|
List<E> |
getAllNeighborsWithinDistance(GeospatialPoint queryPoint,
double maxDistance)
Returns a list of all points within a given distance to a query point.
|
List<E> |
getAllNeighborsWithinDistance(GeospatialPoint queryPoint,
double maxDistance,
SearchCriteria<E> searchCriteria)
Returns a list of all points within a given distance to a query point
that meet a set of search criteria.
|
List<E> |
getAllPointsInBoundingBox(double west,
double east,
double north,
double south)
Returns a list of all points in the database within the given bounding
"box." A point is considered to be inside the box if its latitude falls
between the given north and south limits (inclusive) and its longitude
falls between the east and west limits (inclusive).
|
List<E> |
getAllPointsInBoundingBox(double west,
double east,
double north,
double south,
GeospatialPoint orderingPoint)
Returns a list of all points in the database within the given bounding
"box." A point is considered to be inside the box if its latitude falls
between the given north and south limits (inclusive) and its longitude
falls between the east and west limits (inclusive).
|
List<E> |
getAllPointsInBoundingBox(double west,
double east,
double north,
double south,
SearchCriteria<E> otherCriteria)
Returns a list of all points in the database within the given bounding
"box" that also satisfy the given search criteria.
|
List<E> |
getAllPointsInBoundingBox(double west,
double east,
double north,
double south,
SearchCriteria<E> otherCriteria,
GeospatialPoint orderingPoint)
Returns a list of all points in the database within the given bounding
"box" that also satisfy the given search criteria.
|
E |
getNearestNeighbor(GeospatialPoint queryPoint)
Returns the nearest neighbor to the given query point.
|
E |
getNearestNeighbor(GeospatialPoint queryPoint,
double maxDistance)
Returns the nearest neighbor to the given query point so long as the
nearest neighbor is within the given maximum distance.
|
E |
getNearestNeighbor(GeospatialPoint queryPoint,
double maxDistance,
SearchCriteria<E> searchCriteria)
Returns the nearest neighbor to the query point that satisfies the given
search criteria so long as that point falls within the given maximum
distance from the query point.
|
E |
getNearestNeighbor(GeospatialPoint queryPoint,
SearchCriteria<E> searchCriteria)
Returns the nearest neighbor to the given query point that satisfies the
given search criteria.
|
List<E> |
getNearestNeighbors(GeospatialPoint queryPoint,
int maxResults)
Returns a list of the nearest neighbors to a given query point.
|
List<E> |
getNearestNeighbors(GeospatialPoint queryPoint,
int maxResults,
double maxDistance)
Returns a list of the nearest neighbors to a given query point and
within a given maximum distance.
|
List<E> |
getNearestNeighbors(GeospatialPoint queryPoint,
int maxResults,
double maxDistance,
SearchCriteria<E> searchCriteria)
Returns a list of the nearest neighbors to a given query point and
within a given maximum distance.
|
List<E> |
getNearestNeighbors(GeospatialPoint queryPoint,
int maxResults,
SearchCriteria<E> searchCriteria)
Returns a list of the nearest neighbors to a given query point that
satisfy the given search criteria.
|
E getNearestNeighbor(GeospatialPoint queryPoint)
queryPoint
- the point for which to find the nearest neighbornull
if the
database contains no pointsE getNearestNeighbor(GeospatialPoint queryPoint, double maxDistance)
queryPoint
- the point for which to find the nearest neighbormaxDistance
- the maximum allowable distance from the query point in metersnull
if the
database contains no points within maxDistance
meters of
the query pointE getNearestNeighbor(GeospatialPoint queryPoint, SearchCriteria<E> searchCriteria)
queryPoint
- the point for which to find the nearest neighborsearchCriteria
- the criteria to apply to potential nearest neighborsnull
if the
database contains no points that satisfy the given search
criteriaE getNearestNeighbor(GeospatialPoint queryPoint, double maxDistance, SearchCriteria<E> searchCriteria)
queryPoint
- the point for which to find the nearest neighbormaxDistance
- the maximum allowable distance from the query point in meterssearchCriteria
- the criteria to apply to potential nearest neighborsnull
if no
points matching the given search criteria were found within
maxDistance
meters of the query pointList<E> getNearestNeighbors(GeospatialPoint queryPoint, int maxResults)
Returns a list of the nearest neighbors to a given query point. The returned list is sorted by increasing distance from the query point.
This returned list will contain at most maxResults
elements
(and may contain fewer if maxResults
is larger than the number of
points in the database). If multiple points have the same distance from
the query point, the order in which they appear in the returned list is
undefined. By extension, if multiple points have the same distance from
the query point and those points would "straddle" the end of the returned
list, which points are included in the list and which are cut off is not
prescribed.
queryPoint
- the point for which to find neighborsmaxResults
- the maximum length of the returned listList<E> getNearestNeighbors(GeospatialPoint queryPoint, int maxResults, SearchCriteria<E> searchCriteria)
Returns a list of the nearest neighbors to a given query point that satisfy the given search criteria. The returned list is sorted by increasing distance from the query point.
This returned list will contain at most maxResults
elements
(and may contain fewer if maxResults
is larger than the number of
points in the database). If multiple points have the same distance from
the query point, the order in which they appear in the returned list is
undefined. By extension, if multiple points have the same distance from
the query point and those points would "straddle" the end of the returned
list, which points are included in the list and which are cut off is not
prescribed.
queryPoint
- the point for which to find neighborsmaxResults
- the maximum length of the returned listsearchCriteria
- the search criteria to be met by all returned pointsList<E> getNearestNeighbors(GeospatialPoint queryPoint, int maxResults, double maxDistance)
Returns a list of the nearest neighbors to a given query point and within a given maximum distance. The returned list is sorted by increasing distance from the query point.
This returned list will contain at most maxResults
elements
(and may contain fewer if maxResults
is larger than the number of
points in the database or if fewer than maxResults
points were
found within the given maximum distance). If multiple points have the
same distance from the query point, the order in which they appear in the
returned list is undefined. By extension, if multiple points have the
same distance from the query point and those points would "straddle" the
end of the returned list, which points are included in the list and which
are cut off is not prescribed.
queryPoint
- the point for which to find neighborsmaxResults
- the maximum length of the returned listmaxDistance
- the maximum allowable distance, in meters, from the query
point; points farther away than maxDistance
will not
be included in the returned listList<E> getNearestNeighbors(GeospatialPoint queryPoint, int maxResults, double maxDistance, SearchCriteria<E> searchCriteria)
Returns a list of the nearest neighbors to a given query point and within a given maximum distance. The returned list is sorted by increasing distance from the query point.
This returned list will contain at most maxResults
elements
(and may contain fewer if maxResults
is larger than the number of
points in the database or if fewer than maxResults
points were
found within the given maximum distance). If multiple points have the
same distance from the query point, the order in which they appear in the
returned list is undefined. By extension, if multiple points have the
same distance from the query point and those points would "straddle" the
end of the returned list, which points are included in the list and which
are cut off is not prescribed.
queryPoint
- the point for which to find neighborsmaxResults
- the maximum length of the returned listmaxDistance
- the maximum allowable distance, in meters, from the query
point; points farther away than maxDistance
will not
be included in the returned listsearchCriteria
- the search criteria to be met by all returned pointsList<E> getAllNeighborsWithinDistance(GeospatialPoint queryPoint, double maxDistance)
queryPoint
- the point for which to find neighborsmaxDistance
- the maximum allowable distance, in meters, from the query
point; points farther away than maxDistance
will not
be included in the returned listList<E> getAllNeighborsWithinDistance(GeospatialPoint queryPoint, double maxDistance, SearchCriteria<E> searchCriteria)
queryPoint
- the point for which to find neighborsmaxDistance
- the maximum allowable distance, in meters, from the query
point; points farther away than maxDistance
will not
be included in the returned listsearchCriteria
- the search criteria to be met by all points in the returned
listList<E> getAllPointsInBoundingBox(double west, double east, double north, double south)
west
- the western limit of the bounding box in degreeseast
- the eastern limit of the bounding box in degreesnorth
- the northern limit of the bounding box in degreessouth
- the southern limit of the bounding box in degreesIllegalArgumentException
- if the north or south limits fall outside of the range -90 to
+90 (inclusive) or if the northern limit is south of the
southern limit (or vice versa)List<E> getAllPointsInBoundingBox(double west, double east, double north, double south, GeospatialPoint orderingPoint)
west
- the western limit of the bounding box in degreeseast
- the eastern limit of the bounding box in degreesnorth
- the northern limit of the bounding box in degreessouth
- the southern limit of the bounding box in degreesorderingPoint
- a point to use for sorting the list of results by distance;
may be null
if no ordering is requiredorderingPoint
IllegalArgumentException
- if the north or south limits fall outside of the range -90 to
+90 (inclusive) or if the northern limit is south of the
southern limit (or vice versa)List<E> getAllPointsInBoundingBox(double west, double east, double north, double south, SearchCriteria<E> otherCriteria)
west
- the western limit of the bounding box in degreeseast
- the eastern limit of the bounding box in degreesnorth
- the northern limit of the bounding box in degreessouth
- the southern limit of the bounding box in degreesotherCriteria
- a set of additional search criteria to apply to points that
lie within the bounding box; may be null
if no
additional criteria are to be appliedIllegalArgumentException
- if the north or south limits fall outside of the range -90 to
+90 (inclusive) or if the northern limit is south of the
southern limit (or vice versa)List<E> getAllPointsInBoundingBox(double west, double east, double north, double south, SearchCriteria<E> otherCriteria, GeospatialPoint orderingPoint)
west
- the western limit of the bounding box in degreeseast
- the eastern limit of the bounding box in degreesnorth
- the northern limit of the bounding box in degreessouth
- the southern limit of the bounding box in degreesotherCriteria
- a set of additional search criteria to apply to points that
lie within the bounding box; may be null
if no
additional criteria are to be appliedorderingPoint
- a point to use for sorting the list of results by distance;
may be null
if no ordering is requiredorderingPoint
IllegalArgumentException
- if the north or south limits fall outside of the range -90 to
+90 (inclusive) or if the northern limit is south of the
southern limit (or vice versa)jeospatial is an open-source library hosted at https://github.com/jchambers/jeospatial.