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