Ellipsoid tesselation can produce overlapping tiles
When attempting to tesselate a zone containing at least two
non-connected regions,
the tiles generated independently for each region may overlap each
other,
even when the overlap width and length are set to negative values.
The following junit test (which uses the existing methods in EllipsoidTessellatorTest) fails:
@Test
public void testIslandJoining() throws OrekitException {
final EllipsoidTessellator tessellator =
new EllipsoidTessellator(ellipsoid, new ConstantAzimuthAiming(ellipsoid,
FastMath.toRadians(120.0)),
150000.0, 250000.0, -5000.0, -5000.0);
final List tiles = tessellator.tessellate(buildFrance());
checkTilesDontOverlap(tiles);
}
private void checkTilesDontOverlap(final List tiles) {
for (final Tile tile : tiles) {
final SphericalPolygonsSet quadrilateral =
new SphericalPolygonsSet(1.0e-10,
toS2Point(tile.getVertices()[0]),
toS2Point(tile.getVertices()[1]),
toS2Point(tile.getVertices()[2]),
toS2Point(tile.getVertices()[3]));
for (final Tile other : tiles) {
if (other != tile) {
for (final GeodeticPoint vertex : other.getVertices()) {
Assert.assertEquals("tiles overlap at: " + vertex,
Location.OUTSIDE, quadrilateral.checkPoint(toS2Point(vertex)));
}
}
}
}
}
private S2Point toS2Point(final GeodeticPoint point) {
return new S2Point(point.getLongitude(), 0.5 * FastMath.PI -
point.getLatitude());
}
Displaying the tiles show that as the tiles are rather long, the two
tiles built to
cover Corsica (orange in the attached image) overlap the tiles from
South-East continental
France (green in the attached image).
(from redmine: issue id 195, created on 2015-04-07, closed on 2016-02-10)