See: Description
| Interface | Description |
|---|---|
| SpatialService |
Location service API
|
| Class | Description |
|---|---|
| GeoSpatialService |
Geographic implementation of the spatial service
|
The geographic geometry objects represent location of various geometric shapes (e.g., point, line string, polygon)
To get a reference to the location service instance:
SpatialService spatialService = GeoSpatialService.getService();
Use geometry factory API to create geometry objects:
GeometryFactory geometryFactory = spatialService.getGeometryFactory();
Point point1 = geometryFactory.getPoint(32.2513, 23.0522);
Point point2 = geometryFactory.getPoint(32.2534, 23.0533);
The service can be used to call spatial functions over geometry objects:
double distance = spatialService.getDistance(point1, point2, LengthUnit.METER);
The default coordinate system for location object creation is the geographic coordinate system, EPSG:4326 (longitude, latitude, WGS84). See http://spatialreference.org/ref/epsg/4326/ for more details.
In case another coordinate system is required, the coordinate reference system factory method can be used.
© Copyright IBM 2017