Search in sources :

Example 11 with Envelope

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

the class SpaceFillingCurveTest method shouldCreate3DHilbertCurveWithNonCenteredEnvelope.

@Test
void shouldCreate3DHilbertCurveWithNonCenteredEnvelope() {
    Envelope envelope = new Envelope(new double[] { 2, 2, 2 }, new double[] { 7, 7, 7 });
    assertAtLevel(new HilbertSpaceFillingCurve3D(envelope), envelope);
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope) Test(org.junit.jupiter.api.Test)

Example 12 with Envelope

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

the class SpaceFillingCurveTest method shouldGet3DSearchTilesForLevel3.

@Test
void shouldGet3DSearchTilesForLevel3() {
    Envelope envelope = new Envelope(new double[] { -8, -8, -8 }, new double[] { 8, 8, 8 });
    HilbertSpaceFillingCurve3D curve = new HilbertSpaceFillingCurve3D(envelope, 3);
    assertTiles(curve.getTilesIntersectingEnvelope(new Envelope(new double[] { -8, -8, -8 }, new double[] { -7, -7, -7 })), new SpaceFillingCurve.LongRange(0, 0));
    assertTiles(curve.getTilesIntersectingEnvelope(new Envelope(new double[] { 7, -8, -8 }, new double[] { 8, -7, -7 })), new SpaceFillingCurve.LongRange(511, 511));
    assertTiles(curve.getTilesIntersectingEnvelope(new Envelope(new double[] { -8, -8, -8 }, new double[] { 7, 7, 7 })), new SpaceFillingCurve.LongRange(0, 511));
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope) Test(org.junit.jupiter.api.Test)

Example 13 with Envelope

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

the class SpaceFillingCurveTest method shouldCreateSimple3DHilbertCurveAtLevelDefault.

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

Example 14 with Envelope

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

the class SpaceFillingCurveTest method shouldGet2DHilbertSearchTilesForLevel3.

@Test
void shouldGet2DHilbertSearchTilesForLevel3() {
    Envelope envelope = new Envelope(-8, 8, -8, 8);
    HilbertSpaceFillingCurve2D curve = new HilbertSpaceFillingCurve2D(envelope, 3);
    assertTiles(curve.getTilesIntersectingEnvelope(new Envelope(-8, -7, -8, -7)), new SpaceFillingCurve.LongRange(0, 0));
    assertTiles(curve.getTilesIntersectingEnvelope(new Envelope(0, 1, 0, 1)), new SpaceFillingCurve.LongRange(32, 32));
    assertTiles(curve.getTilesIntersectingEnvelope(new Envelope(7, 8, -8, -1)), new SpaceFillingCurve.LongRange(48, 49), new SpaceFillingCurve.LongRange(62, 63));
}
Also used : Envelope(org.neo4j.gis.spatial.index.Envelope) Test(org.junit.jupiter.api.Test)

Example 15 with Envelope

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

the class SpaceFillingCurveTest method shouldCreateSimple3DHilbertCurveAtLevel7.

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

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