use of org.apache.lucene.spatial.query.UnsupportedSpatialOperation in project elasticsearch by elastic.
the class GeoFilterIT method testRelationSupport.
protected static boolean testRelationSupport(SpatialOperation relation) {
if (relation == SpatialOperation.IsDisjointTo) {
// disjoint works in terms of intersection
relation = SpatialOperation.Intersects;
}
try {
GeohashPrefixTree tree = new GeohashPrefixTree(SpatialContext.GEO, 3);
RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(tree, "area");
Shape shape = SpatialContext.GEO.makePoint(0, 0);
SpatialArgs args = new SpatialArgs(relation, shape);
strategy.makeQuery(args);
return true;
} catch (UnsupportedSpatialOperation e) {
final SpatialOperation finalRelation = relation;
ESLoggerFactory.getLogger(GeoFilterIT.class.getName()).info((Supplier<?>) () -> new ParameterizedMessage("Unsupported spatial operation {}", finalRelation), e);
return false;
}
}
Aggregations