Exemple #1
0
 private void RememberSettings(ConfiguredSpaceFillingCurveSettingsCache globalSettings, IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> expectedSpecificSettings, params CoordinateReferenceSystem[] crss)
 {
     foreach (CoordinateReferenceSystem crs in crss)
     {
         expectedSpecificSettings[crs] = globalSettings.ForCRS(crs);
     }
 }
Exemple #2
0
        private void ShouldGetSettingsFor(Config config, CoordinateReferenceSystem crs, int dimensions, int maxBits, Envelope envelope)
        {
            ConfiguredSpaceFillingCurveSettingsCache configuredSettings = new ConfiguredSpaceFillingCurveSettingsCache(config);
            SpaceFillingCurveSettings settings = configuredSettings.ForCRS(crs);

            assertThat("Expected " + dimensions + "D for " + crs.Name, settings.Dimensions, equalTo(dimensions));
            int maxLevels = maxBits / dimensions;

            assertThat("Expected maxLevels=" + maxLevels + " for " + crs.Name, settings.MaxLevels, equalTo(maxLevels));
            assertThat("Should have normal geographic 2D extents", settings.IndexExtents(), equalTo(envelope));
        }
Exemple #3
0
        public static Pair <PointValue, PointValue> PointsWithSameValueOnSpaceFillingCurve(Config config)
        {
            ConfiguredSpaceFillingCurveSettingsCache configuredCache = new ConfiguredSpaceFillingCurveSettingsCache(config);
            SpaceFillingCurveSettings spaceFillingCurveSettings      = configuredCache.ForCRS(CoordinateReferenceSystem.WGS84);
            SpaceFillingCurve         curve = spaceFillingCurveSettings.Curve();

            double[] origin = new double[] { 0.0, 0.0 };
            long?    spaceFillingCurveMapForOrigin = curve.DerivedValueFor(origin);

            double[]   centerPointForOriginTile = curve.CenterPointFor(spaceFillingCurveMapForOrigin.Value);
            PointValue originValue      = Values.pointValue(CoordinateReferenceSystem.WGS84, origin);
            PointValue centerPointValue = Values.pointValue(CoordinateReferenceSystem.WGS84, centerPointForOriginTile);

            assertThat("need non equal points for this test", origin, not(equalTo(centerPointValue)));
            return(Pair.of(originValue, centerPointValue));
        }
Exemple #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldReadMultipleSettings()
        internal virtual void ShouldReadMultipleSettings()
        {
            // given
            ConfiguredSpaceFillingCurveSettingsCache globalSettings = new ConfiguredSpaceFillingCurveSettingsCache(Config.defaults());
            IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> expectedSpecificSettings = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>();

            RememberSettings(globalSettings, expectedSpecificSettings, WGS84, WGS84_3D, Cartesian);
            IndexSpecificSpaceFillingCurveSettingsCache specificSettings = new IndexSpecificSpaceFillingCurveSettingsCache(globalSettings, expectedSpecificSettings);
            SpaceFillingCurveSettingsWriter             writer           = new SpaceFillingCurveSettingsWriter(specificSettings);

            sbyte[] bytes = new sbyte[Org.Neo4j.Io.pagecache.PageCache_Fields.PAGE_SIZE];
            writer.Accept(new ByteArrayPageCursor(bytes));

            IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> readExpectedSettings = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>();
            SpaceFillingCurveSettingsReader reader = new SpaceFillingCurveSettingsReader(readExpectedSettings);

            // when
            reader.Read(ByteBuffer.wrap(bytes));

            // then
            assertEquals(expectedSpecificSettings, readExpectedSettings);
        }
 public IndexSpecificSpaceFillingCurveSettingsCache(ConfiguredSpaceFillingCurveSettingsCache globalConfigCache, IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> specificIndexConfigCache)
 {
     this._globalConfigCache = globalConfigCache;
     this._specificIndexConfigCache.putAll(specificIndexConfigCache);
 }