use of org.apache.jena.query.spatial.DatasetGraphSpatial in project jena by apache.
the class SpatialOperationPFBase method chooseTextIndex.
protected SpatialIndex chooseTextIndex(ExecutionContext execCxt, DatasetGraph dsg) {
Object obj = dsg.getContext().get(SpatialQuery.spatialIndex);
if (obj != null) {
try {
return (SpatialIndex) obj;
} catch (ClassCastException ex) {
Log.warn(SpatialOperationWithCircleBase.class, "Context setting '" + SpatialQuery.spatialIndex + "'is not a SpatialIndex");
}
}
if (dsg instanceof DatasetGraphSpatial) {
DatasetGraphSpatial x = (DatasetGraphSpatial) dsg;
return x.getSpatialIndex();
}
Log.warn(SpatialOperationWithCircleBase.class, "Failed to find the spatial index : tried context and as a spatial-enabled dataset");
return null;
}
Aggregations