예제 #1
0
        // EXACT

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testExact()
        public virtual void TestExact()
        {
            AssertExactPredicate("string");
            AssertExactPredicate(1);
            AssertExactPredicate(1.0);
            AssertExactPredicate(true);
            AssertExactPredicate(new long[] { 1L });
            AssertExactPredicate(Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6));
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandlePoints()
        internal virtual void ShouldHandlePoints()
        {
            // Given
            PointValue    pointValue = Values.pointValue(CoordinateReferenceSystem.Cartesian, 11d, 12d);
            PrettyPrinter printer    = new PrettyPrinter();

            // When
            pointValue.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("{geometry: {type: \"Point\", coordinates: [11.0, 12.0], " + "crs: {type: link, properties: " + "{href: \"http://spatialreference.org/ref/sr-org/7203/\", code: " + "7203}}}}"));
        }
예제 #3
0
        // EXISTS

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testExists()
        public virtual void TestExists()
        {
            ExistsPredicate p = IndexQuery.Exists(_propId);

            assertTrue(Test(p, "string"));
            assertTrue(Test(p, 1));
            assertTrue(Test(p, 1.0));
            assertTrue(Test(p, true));
            assertTrue(Test(p, new long[] { 1L }));
            assertTrue(Test(p, Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6)));

            assertFalse(Test(p, null));
        }
예제 #4
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));
        }
예제 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnMatchingEntriesForRangePredicateWithInclusiveStartAndInclusiveEnd() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReturnMatchingEntriesForRangePredicateWithInclusiveStartAndInclusiveEnd()
        {
            // given
            IndexEntryUpdate <IndexDescriptor>[] updates = valueCreatorUtil.generateAddUpdatesFor(new Value[] { Values.pointValue(WGS84, -90, -90), Values.pointValue(WGS84, -70, -70), Values.pointValue(WGS84, -50, -50), Values.pointValue(WGS84, 0, 0), Values.pointValue(WGS84, 50, 50), Values.pointValue(WGS84, 70, 70), Values.pointValue(WGS84, 90, 90) });
            ShouldReturnMatchingEntriesForRangePredicateWithInclusiveStartAndInclusiveEnd(updates);
        }
예제 #6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void mustHandleMultipleNestedQueries() throws Exception
        public override void MustHandleMultipleNestedQueries()
        {
            // It ok to not use random values here because we are only testing nesting of queries
            //noinspection unchecked
            IndexEntryUpdate <IndexDescriptor>[] updates = valueCreatorUtil.generateAddUpdatesFor(new Value[] { Values.pointValue(WGS84, -90, -90), Values.pointValue(WGS84, -70, -70), Values.pointValue(WGS84, -50, -50), Values.pointValue(WGS84, 0, 0), Values.pointValue(WGS84, 50, 50), Values.pointValue(WGS84, 70, 70), Values.pointValue(WGS84, 90, 90) });
            MustHandleMultipleNestedQueries(updates);
        }