Search in sources :

Example 1 with DatasetGraphSpatial

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;
}
Also used : SpatialIndex(org.apache.jena.query.spatial.SpatialIndex) DatasetGraphSpatial(org.apache.jena.query.spatial.DatasetGraphSpatial)

Aggregations

DatasetGraphSpatial (org.apache.jena.query.spatial.DatasetGraphSpatial)1 SpatialIndex (org.apache.jena.query.spatial.SpatialIndex)1