Search in sources :

Example 11 with QuadPrefixTree

use of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree in project lucene-solr by apache.

the class HeatmapFacetCounterTest method testLucene7291Dateline.

@Test
public void testLucene7291Dateline() throws IOException {
    // only 2, and we wind up with some big leaf cells
    grid = new QuadPrefixTree(ctx, 2);
    strategy = new RecursivePrefixTreeStrategy(grid, getTestClass().getSimpleName());
    adoc("0", ctx.makeRectangle(-102, -83, 43, 52));
    commit();
    // HM crosses dateline
    validateHeatmapResultLoop(ctx.makeRectangle(179, -179, 62, 63), 2, 100);
}
Also used : QuadPrefixTree(org.apache.lucene.spatial.prefix.tree.QuadPrefixTree) Test(org.junit.Test)

Example 12 with QuadPrefixTree

use of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree in project lucene-solr by apache.

the class HeatmapFacetCounterTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    cellsValidated = cellValidatedNonZero = 0;
    ctx = SpatialContext.GEO;
    grid = new QuadPrefixTree(ctx, randomIntBetween(1, 8));
    strategy = new RecursivePrefixTreeStrategy(grid, getTestClass().getSimpleName());
    if (rarely()) {
        ((PrefixTreeStrategy) strategy).setPointsOnly(true);
    }
}
Also used : QuadPrefixTree(org.apache.lucene.spatial.prefix.tree.QuadPrefixTree) Before(org.junit.Before)

Aggregations

QuadPrefixTree (org.apache.lucene.spatial.prefix.tree.QuadPrefixTree)12 SpatialPrefixTree (org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree)5 Test (org.junit.Test)5 RecursivePrefixTreeStrategy (org.apache.lucene.spatial.prefix.RecursivePrefixTreeStrategy)4 GeohashPrefixTree (org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree)4 SpatialContext (org.locationtech.spatial4j.context.SpatialContext)4 ArrayList (java.util.ArrayList)3 TermQueryPrefixTreeStrategy (org.apache.lucene.spatial.prefix.TermQueryPrefixTreeStrategy)3 SpatialContextFactory (org.locationtech.spatial4j.context.SpatialContextFactory)3 RectangleImpl (org.locationtech.spatial4j.shape.impl.RectangleImpl)3 ParametersFactory (com.carrotsearch.randomizedtesting.annotations.ParametersFactory)2 Document (org.apache.lucene.document.Document)2 Field (org.apache.lucene.document.Field)2 PackedQuadPrefixTree (org.apache.lucene.spatial.prefix.tree.PackedQuadPrefixTree)2 SerializedDVStrategy (org.apache.lucene.spatial.serialized.SerializedDVStrategy)2 Point (org.locationtech.spatial4j.shape.Point)2 Shape (org.locationtech.spatial4j.shape.Shape)2 StoredField (org.apache.lucene.document.StoredField)1 StringField (org.apache.lucene.document.StringField)1 TextField (org.apache.lucene.document.TextField)1