GetTestQueries() public static method

public static GetTestQueries ( SpatialArgsParser parser, SpatialContext ctx, string name, Stream @in ) : IEnumerator
parser Lucene.Net.Spatial.Queries.SpatialArgsParser
ctx Spatial4n.Core.Context.SpatialContext
name string
@in Stream
return IEnumerator
Example #1
0
        protected virtual IEnumerator <SpatialTestQuery> getTestQueries(String testQueryFile, SpatialContext ctx)
        {
            Stream @in = GetType().getResourceAsStream(RESOURCE_PATH + testQueryFile);

            return(SpatialTestQuery.GetTestQueries(
                       argsParser, ctx, testQueryFile, @in));//closes the InputStream
        }
Example #2
0
        public virtual void TestQueries()
        {
            String name = StrategyTestCase.RESOURCE_PATH + StrategyTestCase.QTEST_Cities_Intersects_BBox;

            Stream         @in = GetType().getResourceAsStream(name);
            SpatialContext ctx = SpatialContext.GEO;
            IEnumerator <SpatialTestQuery> iter = SpatialTestQuery.GetTestQueries(
                new SpatialArgsParser(), ctx, name, @in);//closes the InputStream
            IList <SpatialTestQuery> tests = new JCG.List <SpatialTestQuery>();

            while (iter.MoveNext())
            {
                tests.Add(iter.Current);
            }
            assertEquals(3, tests.size());

            SpatialTestQuery sf = tests[0];

            // assert
            assertEquals(1, sf.ids.size());
            assertTrue(sf.ids[0].Equals("G5391959", StringComparison.Ordinal));
            assertTrue(sf.args.Shape is IRectangle);
            assertEquals(SpatialOperation.Intersects, sf.args.Operation);
        }