public interface SpatialService
Location service API
LocationService provides both methods for creating objects that represent location of various shape (e.g. point, line, polygon), and computational functions on these objects.
The coordinate system used to refer geographic locations is EPSG:4326 (longitude, latitude, WGS84). See http://spatialreference.org/ref/epsg/4326/ for more details.
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.util.Collection<? extends Spatial> containers,
Spatial contained)
Check if any of the spatial objects in the collection contains the specified object.
|
boolean |
contains(Spatial container,
Spatial contained)
Check if the given spatial object contains another spatial object
|
<T extends Spatial> |
getContained(Spatial container,
java.util.Collection<T> all)
Find objects contained in the specified spatial object.
|
<T extends Spatial> |
getContainers(Spatial contained,
java.util.Collection<T> all)
Find objects containing the specified spatial object.
|
CoordinateReferenceSystemFactory |
getCoordinateReferenceSystemFactory()
Get a coordinate reference system factory that is used to get defined coordinate reference system or to create a new one
|
double |
getDistance(Spatial from,
Spatial to,
LengthUnit units)
Compute distance between two spatial objects.
|
GeometryFactory |
getGeometryFactory()
Get a geometry factory that is used to create new geometries
|
<T extends Spatial> |
getNearestNeighbor(Spatial source,
java.util.Collection<T> all)
Find the nearest neighbor of the given spatial object among a specified collection of spatial objects
|
<T extends Spatial> |
getWithinDistance(Spatial source,
java.util.Collection<T> all,
double maxDistance,
LengthUnit units)
Find objects located within the specified distance from the source object
|
boolean |
intersects(Spatial object1,
Spatial object2)
Check if two spatial objects intersect
|
<T extends Spatial> |
sortByProximity(Spatial source,
java.util.Collection<T> all)
Sort a collection of spatial objects based on their proximity to the given source object
|
double getDistance(Spatial from, Spatial to, LengthUnit units)
from - source objectto - target objectunits - specifies unit for measuring distance.boolean contains(Spatial container, Spatial contained)
container - contained - <T extends Spatial> T getNearestNeighbor(Spatial source, java.util.Collection<T> all)
source - object for which the nearest neighbor to be foundall - - a collection of spatial objects to look for the nearest neighbor<T extends Spatial> java.util.List<T> getWithinDistance(Spatial source, java.util.Collection<T> all, double maxDistance, LengthUnit units)
source - all - a collection of spatial objects to filter based on the proximity to the sourcemaxDistance - - maximal distance at which returned object must be to the sourceunits - - distance unitsboolean contains(java.util.Collection<? extends Spatial> containers, Spatial contained)
containers - contained - <T extends Spatial> java.util.List<T> sortByProximity(Spatial source, java.util.Collection<T> all)
source - object that should be used to measure distance to from any object of collectionall - spatial objects to sort<T extends Spatial> java.util.Collection<T> getContained(Spatial container, java.util.Collection<T> all)
container - the containing objectall - possible contained objects.<T extends Spatial> java.util.Collection<T> getContainers(Spatial contained, java.util.Collection<T> all)
contained - a spatial object which containers should be looked upall - possible containing objectsboolean intersects(Spatial object1, Spatial object2)
object1 - object2 - GeometryFactory getGeometryFactory()
CoordinateReferenceSystemFactory getCoordinateReferenceSystemFactory()
© Copyright IBM 2017