Java Code Examples for org.elasticsearch.common.geo.ShapeRelation#INTERSECTS

The following examples show how to use org.elasticsearch.common.geo.ShapeRelation#INTERSECTS . 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: GeoUtils.java    From elasticsearch-sql with MIT License 6 votes vote down vote up
public static ShapeRelation parseGeoRelation(int relation){
    switch (relation){
        case ElasticsearchParser.WITHIN:{
            return ShapeRelation.WITHIN;
        }
        case ElasticsearchParser.DISJOINT:{
            return ShapeRelation.DISJOINT;
        }
        case ElasticsearchParser.CONTAINS:{
            return ShapeRelation.CONTAINS;
        }
        default:
        case ElasticsearchParser.INTERSECTS:{
            return ShapeRelation.INTERSECTS;
        }
    }
}
 
Example 2
Source File: ElasticsearchIndex.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private ShapeRelation toSpatialOp(String relation) {
	if (GEOF.SF_INTERSECTS.stringValue().equals(relation)) {
		return ShapeRelation.INTERSECTS;
	}
	if (GEOF.SF_DISJOINT.stringValue().equals(relation)) {
		return ShapeRelation.DISJOINT;
	}
	if (GEOF.EH_COVERED_BY.stringValue().equals(relation)) {
		return ShapeRelation.WITHIN;
	}
	return null;
}