Package com.ibm.geolib

Provides a location service that allows to create geometry objects that represent geographic locations and compute functions on these objects.

See: Description

  • Interface Summary 
    Interface Description
    SpatialService
    Location service API
  • Class Summary 
    Class Description
    GeoSpatialService
    Geographic implementation of the spatial service

Package com.ibm.geolib Description

Provides a location service that allows to create geometry objects that represent geographic locations and compute functions on these objects.

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.

Decision Server Insights

© Copyright IBM 2017