I'm serving a set of NetCDF layers to a Leaflet map over WMS. The netCDFs are native EPSG:4326, and Leaflet requests them in EPSG:3857. They look great zoomed out:
But if I zoom in, I start seeing artifacts and gaps in the tiles that move as I continue to zoom in:
EDIT: some more details on the artifacts. When they start appearing at zoom 4, they occur in the 'left-most tiles' (whichever ones have a lower-left X value of about -20 000 km) and in the tiles directly to the left of X = 0 (but in the top-left this time). For example, this is over Scotland:
The width has been variable with zoom, but they generally get taller until there's just a continuous strip at higher zooms.
This image suggests that there's some problems going across the entire X < 0 space even though artifacts are only visible on the left-most tile (aligned with its right edge) and the right-most tile (aligned with its left edge):
I note that the gaps between tiles appear transparent, just as my regions with no data (NaN) do. In other regions, I can see the tile boundaries shifting on both sides (so no gap appears) when I zoom in.
The artifacts appear in regions that otherwise wouldn't have any data, and they appear as whatever the lowest-valued colour in my style is, regardless of the style I use.
This behaviour appears in all of the NetCDFs I've tested (a set of about 30 files), which are all produced through the same process. However, if I use the style preview when editing a style (which looks like a different projection to my eye), I don't see any artifacts:
This makes me wonder if some sort of error is occurring in the projection to EPSG:3857, either on Geoserver's part or on Leaflet's in requesting the tiles.
I note that the artifacts also appear in the requested tiles when checking the individual requests; this isn't a problem with their rendering in the browser. I've tested this both on a local installation of Geoserver 2.12.1 on macOS and on a Tomcat 7 installation of Geoserver 2.12.2 on CentOS.
EDIT: forcing Geoserver to serve EPSG:4326 by including
srs: 'EPSG4326' in my layer request also seems to fix this (which could work for me, especially as GBIF hosts basemaps in EPSG:4326):