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);
}
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));
}
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);
}
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));
}
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);
}
Aggregations