WorldWindJava
WorldWindJava copied to clipboard
WMS Tile artefacts when using flat 2d map
I am not sure if this is seen as a bug or enhancement.
We are using WMS-Layers via WMSTiledImageLayer / TiledImageLayer with a flat earth (2d map / FlatGlobe). At the borders of our viewport sometimes tiles with a lower level compared with rest of the viewport. This is something you would not expect for classical 2D map. It depends on the zoom level. When the zoom is changed slightly everything is fine again.
See attached picture (artefact at the right border) for an example.
After some research I assume this is related to the fact, that in TiledImageLayer.needToSplit the eyeDistance is calculated via Sector.computeCornerPoints, FlatEarth.computePointFromPosition which is inherited from EllipsoidalGlobe and using the min distance to corners and the center. Perhaps not using the min distance (only one reference point) could eliminate the artefacts or for 2D maps perhaps using just the height of the eye position instead of the sector - eye distance could help. I tried the second approach and at least for a pure 2d map this seems to work fine.
@helgekoch thanks for pointing this out. As you found, tile level is determined by calculating the distance from the eye position to the tile. Your solution of using just an eye altitude for 2D cases has merit. I'll raise it to our development team for discussion.