Java Code Examples for com.esri.core.geometry.ogc.OGCGeometry#crosses()

The following examples show how to use com.esri.core.geometry.ogc.OGCGeometry#crosses() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GeoFunctions.java    From presto with Apache License 2.0 5 votes vote down vote up
@SqlNullable
@Description("Returns TRUE if the supplied geometries have some, but not all, interior points in common")
@ScalarFunction("ST_Crosses")
@SqlType(BOOLEAN)
public static Boolean stCrosses(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right)
{
    if (!envelopes(left, right, Envelope::intersect)) {
        return false;
    }
    OGCGeometry leftGeometry = deserialize(left);
    OGCGeometry rightGeometry = deserialize(right);
    verifySameSpatialReference(leftGeometry, rightGeometry);
    return leftGeometry.crosses(rightGeometry);
}