public AbstractPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel) { this.m_queryShape = queryShape; this.m_fieldName = fieldName; this.m_grid = grid; this.m_detailLevel = detailLevel; }
public IntersectsPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel, int prefixGridScanLevel, bool hasIndexedLeaves) : base(queryShape, fieldName, grid, detailLevel, prefixGridScanLevel) { this.hasIndexedLeaves = hasIndexedLeaves; }
protected AbstractPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel) // LUCENENET: CA1012: Abstract types should not have constructors (marked protected) { this.m_queryShape = queryShape; this.m_fieldName = fieldName; this.m_grid = grid; this.m_detailLevel = detailLevel; }
public PointPrefixTreeFieldCacheProvider(SpatialPrefixTree grid, string shapeField , int defaultSize) : base(shapeField, defaultSize) { // this.grid = grid; }
protected readonly int m_prefixGridScanLevel;//at least one less than grid.getMaxLevels() public AbstractVisitingPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel, int prefixGridScanLevel) : base(queryShape, fieldName, grid, detailLevel) { this.m_prefixGridScanLevel = Math.Max(0, Math.Min(prefixGridScanLevel, grid.MaxLevels - 1)); Debug.Assert(detailLevel <= grid.MaxLevels); }
protected AbstractPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel) // LUCENENET: CA1012: Abstract types should not have constructors (marked protected) { // LUCENENET specific - added guard clauses this.m_queryShape = queryShape ?? throw new ArgumentNullException(nameof(queryShape)); this.m_fieldName = fieldName ?? throw new ArgumentNullException(nameof(fieldName)); this.m_grid = grid ?? throw new ArgumentNullException(nameof(grid)); this.m_detailLevel = detailLevel; }
public PrefixTreeStrategy(SpatialPrefixTree grid, string fieldName, bool simplifyIndexedCells ) : base(grid.SpatialContext, fieldName) { // [ 0 TO 0.5 ] this.grid = grid; this.simplifyIndexedCells = simplifyIndexedCells; }
public AbstractPrefixTreeFilter(Shape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel) { //not in equals/hashCode since it's implied for a specific field this.queryShape = queryShape; this.fieldName = fieldName; this.grid = grid; this.detailLevel = detailLevel; }
public Filter ToFilter(SpatialContext spatialContext, SpatialPrefixTree tree) { var strategy = new RecursivePrefixTreeStrategy(tree, GeoFieldName); var spatialArgs = new SpatialArgs(SpatialOperation.Intersects, spatialContext.MakeRectangle(this.MinX, this.MaxX, this.MinY, this.MaxY)); return(strategy.MakeFilter(spatialArgs)); }
public Filter ToFilter(SpatialContext spatialContext, SpatialPrefixTree tree) { var strategy = new RecursivePrefixTreeStrategy(tree, GeoFieldName); var spatialArgs = new SpatialArgs(SpatialOperation.Intersects, spatialContext.MakeCircle(X, Y, DistanceUtils.Dist2Degrees(this.Distance, DistanceUtils.EARTH_MEAN_RADIUS_KM))); return(strategy.MakeFilter(spatialArgs)); }
public RecursivePrefixTreeFilter(String fieldName, SpatialPrefixTree grid, Shape queryShape, int prefixGridScanLevel, int detailLevel) { this.fieldName = fieldName; this.grid = grid; this.queryShape = queryShape; this.prefixGridScanLevel = Math.Max(1, Math.Min(prefixGridScanLevel, grid.GetMaxLevels() - 1)); this.detailLevel = detailLevel; Debug.Assert(detailLevel <= grid.GetMaxLevels()); }
private void InitSpatial() { if (_spatialContext == null) { _spatialContext = SpatialContext.GEO; int maxLevels = 11; _tree = new GeohashPrefixTree(_spatialContext, maxLevels); } }
public virtual void SetupGeohashGrid(int maxLevels) { this.ctx = SpatialContext.GEO; //A fairly shallow grid, and default 2.5% distErrPct if (maxLevels == -1) { maxLevels = randomIntBetween(1, 3);//max 16k cells (32^3) } this.grid = new GeohashPrefixTree(ctx, maxLevels); this.strategy = new RecursivePrefixTreeStrategy(grid, GetType().Name); }
public Filter ToFilter(SpatialContext spatialContext, SpatialPrefixTree tree) { var strategy = new RecursivePrefixTreeStrategy(tree, GeoFieldName); var spatialArgs = new SpatialArgs(SpatialOperation.Intersects, spatialContext.MakeBufferedLineString( this.Points.Select(p => (IPoint) new Point(p[0], p[1], spatialContext)).ToList(), DistanceUtils.Dist2Degrees(this.Distance, DistanceUtils.EARTH_MEAN_RADIUS_KM))); return(strategy.MakeFilter(spatialArgs)); }
public AbstractVisitingPrefixTreeFilter(Shape queryShape , string fieldName, SpatialPrefixTree grid, int detailLevel, int prefixGridScanLevel ) : base(queryShape, fieldName, grid, detailLevel) { //Historical note: this code resulted from a refactoring of RecursivePrefixTreeFilter, // which in turn came out of SOLR-2155 //at least one less than grid.getMaxLevels() this.prefixGridScanLevel = Math.Max(0, Math.Min(prefixGridScanLevel, grid.MaxLevels - 1)); Debug.Assert(detailLevel <= grid.MaxLevels); }
private readonly IShape bufferedQueryShape;//if null then the whole world /// <summary> /// See <see cref="AbstractVisitingPrefixTreeFilter.AbstractVisitingPrefixTreeFilter(IShape, string, SpatialPrefixTree, int, int)"/>. /// <c>queryBuffer</c> is the (minimum) distance beyond the query shape edge /// where non-matching documents are looked for so they can be excluded. If /// -1 is used then the whole world is examined (a good default for correctness). /// </summary> public WithinPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel, int prefixGridScanLevel, double queryBuffer) : base(queryShape, fieldName, grid, detailLevel, prefixGridScanLevel) { if (queryBuffer == -1) { bufferedQueryShape = null; } else { bufferedQueryShape = BufferShape(queryShape, queryBuffer); } }
private void SetupQuadGrid(int maxLevels) { //non-geospatial makes this test a little easier (in gridSnap), and using boundary values 2^X raises // the prospect of edge conditions we want to test, plus makes for simpler numbers (no decimals). FakeSpatialContextFactory factory = new FakeSpatialContextFactory(); factory.geo = false; factory.worldBounds = new Rectangle(0, 256, -128, 128, null); this.ctx = factory.NewSpatialContext(); //A fairly shallow grid, and default 2.5% distErrPct if (maxLevels == -1) { maxLevels = randomIntBetween(1, 8);//max 64k cells (4^8), also 256*256 } this.grid = new QuadPrefixTree(ctx, maxLevels); this.strategy = new RecursivePrefixTreeStrategy(grid, GetType().Name); }
/// <summary> /// See /// <see cref="AbstractVisitingPrefixTreeFilter">AbstractVisitingPrefixTreeFilter.AbstractVisitingPrefixTreeFilter(Shape, string, Lucene.Net.Spatial.Prefix.Tree.SpatialPrefixTree, int, int) /// </see> /// . /// <code>queryBuffer</code> /// is the (minimum) distance beyond the query shape edge /// where non-matching documents are looked for so they can be excluded. If /// -1 is used then the whole world is examined (a good default for correctness). /// </summary> public WithinPrefixTreeFilter(Shape queryShape, string fieldName , SpatialPrefixTree grid, int detailLevel, int prefixGridScanLevel, double queryBuffer ) : base(queryShape, fieldName, grid, detailLevel, prefixGridScanLevel) { //TODO LUCENE-4869: implement faster algorithm based on filtering out false-positives of a // minimal query buffer by looking in a DocValues cache holding a representative // point of each disjoint component of a document's shape(s). //if null then the whole world if (queryBuffer == -1) { bufferedQueryShape = null; } else { bufferedQueryShape = BufferShape(queryShape, queryBuffer); } }
protected virtual SpatialStrategy MakeSpatialStrategy(Config config, IDictionary <string, string> configMap, SpatialContext ctx) { //A factory for the prefix tree grid SpatialPrefixTree grid = SpatialPrefixTreeFactory.MakeSPT(configMap, /*null,*/ ctx); // LUCENENET TODO: What is this extra param? RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategyAnonymousHelper(grid, SPATIAL_FIELD, config); int prefixGridScanLevel = config.Get("query.spatial.prefixGridScanLevel", -4); if (prefixGridScanLevel < 0) { prefixGridScanLevel = grid.MaxLevels + prefixGridScanLevel; } strategy.PrefixGridScanLevel = prefixGridScanLevel; double distErrPct = config.Get("spatial.distErrPct", .025);//doc & query; a default strategy.DistErrPct = distErrPct; return(strategy); }
public RecursivePrefixTreeStrategy(SpatialPrefixTree grid, string fieldName) : base(grid, fieldName) { prefixGridScanLevel = grid.GetMaxLevels() - 4;//TODO this default constant is dependent on the prefix grid size }
public RecursivePrefixTreeStrategyAnonymousHelper(SpatialPrefixTree grid, string fieldName, Config config) : base(grid, fieldName) { this.m_pointsOnly = config.Get("spatial.docPointsOnly", false); }
protected double m_distErrPct = SpatialArgs.DEFAULT_DISTERRPCT; // [ 0 TO 0.5 ] protected PrefixTreeStrategy(SpatialPrefixTree grid, string fieldName, bool simplifyIndexedCells) // LUCENENET: CA1012: Abstract types should not have constructors (marked protected) : base(grid.SpatialContext, fieldName) { this.m_grid = grid; this.m_simplifyIndexedCells = simplifyIndexedCells; }
private readonly SpatialPrefixTree grid; // public PointPrefixTreeFieldCacheProvider(SpatialPrefixTree grid, string shapeField, int defaultSize) : base(shapeField, defaultSize) { // LUCENENT specific - added guard clause this.grid = grid ?? throw new ArgumentNullException(nameof(grid)); }
public RecursivePrefixTreeStrategyThatSupportsWithin(SpatialPrefixTree grid, string fieldName) : base(grid, fieldName) { _prefixGridScanLevel = grid.GetMaxLevels() - 4; }
public RecursivePrefixTreeStrategy(SpatialPrefixTree grid, string fieldName) : base(grid, fieldName, true) //simplify indexed cells { prefixGridScanLevel = grid.MaxLevels - 4; //TODO this default constant is dependent on the prefix grid size }
public ContainsPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel, bool multiOverlappingIndexedShapes) : base(queryShape, fieldName, grid, detailLevel) { this.multiOverlappingIndexedShapes = multiOverlappingIndexedShapes; }
protected readonly int m_prefixGridScanLevel;//at least one less than grid.getMaxLevels() protected AbstractVisitingPrefixTreeFilter(IShape queryShape, string fieldName, SpatialPrefixTree grid, int detailLevel, int prefixGridScanLevel) // LUCENENET: CA1012: Abstract types should not have constructors (marked protected) : base(queryShape, fieldName, grid, detailLevel) { this.m_prefixGridScanLevel = Math.Max(0, Math.Min(prefixGridScanLevel, grid.MaxLevels - 1)); if (Debugging.AssertsEnabled) { Debugging.Assert(detailLevel <= grid.MaxLevels); } }
public TermQueryPrefixTreeStrategy(SpatialPrefixTree grid, string fieldName) : base(grid, fieldName, false)//do not simplify indexed cells { }
protected double distErrPct = SpatialArgs.DEFAULT_DISTERRPCT; // [ 0 TO 0.5 ] protected PrefixTreeStrategy(SpatialPrefixTree grid, String fieldName) : base(grid.GetSpatialContext(), fieldName) { this.grid = grid; }
public TermQueryPrefixTreeStrategy(SpatialPrefixTree grid, string fieldName) : base(grid, fieldName) { }