Example usage for org.hibernate.spatial SpatialRelation INTERSECTS

List of usage examples for org.hibernate.spatial SpatialRelation INTERSECTS

Introduction

In this page you can find the example usage for org.hibernate.spatial SpatialRelation INTERSECTS.

Prototype

int INTERSECTS

To view the source code for org.hibernate.spatial SpatialRelation INTERSECTS.

Click Source Link

Document

The first geometry intersects the second

Usage

From source file:org.niord.core.db.MySQLSpatialDialect.java

License:Apache License

@Override
public String getSpatialRelateSQL(String columnName, int spatialRelation) {
    switch (spatialRelation) {
    case SpatialRelation.WITHIN:
        return " ST_Within(" + columnName + ",?)";
    case SpatialRelation.CONTAINS:
        return " ST_Contains(" + columnName + ", ?)";
    case SpatialRelation.CROSSES:
        return " ST_Crosses(" + columnName + ", ?)";
    case SpatialRelation.OVERLAPS:
        return " ST_Overlaps(" + columnName + ", ?)";
    case SpatialRelation.DISJOINT:
        return " ST_Disjoint(" + columnName + ", ?)";
    case SpatialRelation.INTERSECTS:
        return " ST_Intersects(" + columnName + ", ?)";
    case SpatialRelation.TOUCHES:
        return " ST_Touches(" + columnName + ", ?)";
    case SpatialRelation.EQUALS:
        return " ST_Equals(" + columnName + ", ?)";
    default:/*from www .j  a v a2 s.  c  o  m*/
        throw new IllegalArgumentException("Spatial relation is not known by this dialect");
    }
}