Esempio n. 1
0
        private void SetupCtx2D(SpatialContext ctx)
        {
            if (!ctx.IsGeo)
            {
                ctx2D = ctx;
            }
            //A non-geo version of ctx.
            SpatialContextFactory ctxFactory = new SpatialContextFactory
            {
                IsGeo       = false,
                WorldBounds = ctx.WorldBounds
            };

            ctx2D = ctxFactory.CreateSpatialContext();
        }
Esempio n. 2
0
        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).
            SpatialContextFactory factory = new SpatialContextFactory
            {
                IsGeo       = false,
                WorldBounds = new Rectangle(0, 256, -128, 128, null)
            };

            this.ctx = factory.CreateSpatialContext();
            //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);
        }