public override Filter MakeFilter(SpatialArgs args) { var op = args.Operation; if (!SpatialOperation.Is(op, SpatialOperation.IsWithin, SpatialOperation.Intersects, SpatialOperation.BBoxWithin, SpatialOperation.BBoxIntersects)) throw new UnsupportedSpatialOperation(op); Shape shape = args.GetShape(); int detailLevel = grid.GetMaxLevelForPrecision(shape, args.GetDistPrecision()); return new RecursivePrefixTreeFilter(GetFieldName(), grid, shape, prefixGridScanLevel, detailLevel); }
public override Filter MakeFilter(SpatialArgs args) { SpatialOperation op = args.Operation; if ( !SpatialOperation.Is(op, SpatialOperation.IsWithin, SpatialOperation.Intersects, SpatialOperation.BBoxWithin, SpatialOperation.BBoxIntersects)) throw new UnsupportedSpatialOperation(op); Shape shape = args.GetShape(); int detailLevel = grid.GetMaxLevelForPrecision(shape, args.GetDistPrecision()); var cells = grid.GetNodes(shape, detailLevel, false); var filter = new TermsFilter(); foreach (Node cell in cells) { filter.AddTerm(new Term(GetFieldName(), cell.GetTokenString())); } return filter; }