Search in sources :

Example 41 with Envelope

use of org.neo4j.gis.spatial.index.Envelope in project neo4j by neo4j.

the class SpaceFillingCurveTest method shouldCreateSimple3DHilbertCurveAtLevel6.

@Test
void shouldCreateSimple3DHilbertCurveAtLevel6() {
    Envelope envelope = new Envelope(new double[] { -8, -8, -8 }, new double[] { 8, 8, 8 });
    HilbertSpaceFillingCurve3D curve = new HilbertSpaceFillingCurve3D(envelope, 6);
    assertAtLevel(curve, envelope);
    assertRange(64, 0, curve, 0, 0, 0);
    assertRange(64, (long) Math.pow(8, 6) - 1, curve, 63, 0, 0);
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope) Test(org.junit.jupiter.api.Test)

Example 42 with Envelope

use of org.neo4j.gis.spatial.index.Envelope in project neo4j by neo4j.

the class SpaceFillingCurveTest method shouldCreateSimple2DZOrderCurveAtLevel3.

@Test
void shouldCreateSimple2DZOrderCurveAtLevel3() {
    Envelope envelope = new Envelope(-8, 8, -8, 8);
    assertAtLevel(new ZOrderSpaceFillingCurve2D(envelope, 3), envelope);
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope) Test(org.junit.jupiter.api.Test)

Example 43 with Envelope

use of org.neo4j.gis.spatial.index.Envelope in project neo4j by neo4j.

the class SpaceFillingCurveTest method shouldCreateSimple3DHilbertCurveAtLevel3.

@Test
void shouldCreateSimple3DHilbertCurveAtLevel3() {
    Envelope envelope = new Envelope(new double[] { -8, -8, -8 }, new double[] { 8, 8, 8 });
    HilbertSpaceFillingCurve3D curve = new HilbertSpaceFillingCurve3D(envelope, 3);
    assertAtLevel(curve, envelope);
    assertRange(8, 0, curve, 0, 0, 0);
    assertRange(8, (long) Math.pow(8, 3) - 1, curve, 7, 0, 0);
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope) Test(org.junit.jupiter.api.Test)

Example 44 with Envelope

use of org.neo4j.gis.spatial.index.Envelope in project neo4j by neo4j.

the class SpaceFillingCurveTest method shouldCreateSimple2DZOrderCurveAtLevelDefault.

@Test
void shouldCreateSimple2DZOrderCurveAtLevelDefault() {
    Envelope envelope = new Envelope(-8, 8, -8, 8);
    assertAtLevel(new ZOrderSpaceFillingCurve2D(envelope), envelope);
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope) Test(org.junit.jupiter.api.Test)

Example 45 with Envelope

use of org.neo4j.gis.spatial.index.Envelope in project neo4j by neo4j.

the class SpaceFillingCurveTest method assertRange.

private static void assertRange(int divisor, long value, HilbertSpaceFillingCurve3D curve, int... index) {
    Envelope range = getTileEnvelope(curve.getRange(), divisor, index);
    String message = Arrays.toString(index) + " should evaluate to " + value;
    assertRange(message, curve, range, value);
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope)

Aggregations

Envelope (org.neo4j.gis.spatial.index.Envelope)55 Test (org.junit.jupiter.api.Test)48 Config (org.neo4j.configuration.Config)1 SpaceFillingCurveSettings (org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettings)1