IBM Streams 4.2

Java Native Functions: com.ibm.streams.geospatial.st

This page documents native functions that can be invoked from SPL, including the SPL interfaces that can be used to invoke each of the native functions.

Functions

<string T> public float64 area(T geom)

Computes the area of the provided geometry, is always 0.0 for 0-d and 1-d objects. Area is computed on the spherical earth model for 2-d geometries. In case of an exception, -1 will be returned and the exception logged.

<string T> public float64 azimuth(T point1, T point2)

Computes the azimuth between two points expressed in WGS84 coordinates, the input points are in WKT format. Any other format will return -999 and log the exception.

<string T> public boolean contains(T geom1, T geom2)

Determines if the first geometry contains the second geometry, geometries are specified in WKT format. In case of an exception, false will be returned and the exception logged.

<string T> public float64 distance(T geom1, T geom2)

Computes the shortest distance in meters between given geometries in WKT format on the spherical earth model. In case of an exception, -1 will be returned and the exception logged.

<string T> public boolean intersects(T geom1, T geom2)

Computes if the two geometries intersect, resulting in either true/false as the output. The input geometries are in WKT format. The operation is commutative. In case of an exception, false will be returned and the exception logged.

<string T> public boolean isValid(T geom)

Validates the given input geometry, the input is in WKT format and the output is a true/false

<string T> public T toGeoJSON(T geom)

Convert the given WKT formatted geometry to a GeoJSON format. The output is a GeoJSON string.

<string T> public boolean within(T geom1, T geom2)

Returns true if the first geometry is within the second. In case of an exception, false will be returned and the exception logged.