Esempio n. 1
0
        protected internal override void AssertSameDerivedValue(PointValue p1, PointValue p2)
        {
            ConfiguredSpaceFillingCurveSettingsCache settingsFactory = new ConfiguredSpaceFillingCurveSettingsCache(Config.defaults());
            SpaceFillingCurveSettings spaceFillingCurveSettings      = settingsFactory.ForCRS(CoordinateReferenceSystem.WGS84);
            SpaceFillingCurve         curve = spaceFillingCurveSettings.Curve();

            assertEquals(curve.DerivedValueFor(p1.Coordinate()), curve.DerivedValueFor(p2.Coordinate()));
        }
Esempio n. 2
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));
        }