0

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:

Zoomed-out layer with no artifacts

But if I zoom in, I start seeing artifacts and gaps in the tiles that move as I continue to zoom in:

Artifacts when zooming in

Artifacts move and change with continuing zoom

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:

Artifact 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):

Gap across entire X < 0

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:

Same region (Russia and Alaska) in the style preview

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):

No artifacts in EPSG:4326 (but need a basemap to match)

  • 2
    Just by looking at the tiles, I'm gonna guess that it's a problem on the Geoserver side of things, when requesting tiles with a X coordinate of zero. Could you please use your web browser inspector/developer tools to see the URLs for the failing tiles? After doing that, request one such tile manually (i.e. copy-paste the tile URL into your browser), and see if there's something funky going on. – IvanSanchez Mar 15 '18 at 8:09
  • @IvanSanchez I've added some details and a tile sample. They occur both around X = 0 and around the X minimum (about X = -20 000 km ). They def occur when requesting a tile manually. – rensa Mar 16 '18 at 0:54
  • Also noted that forcing EPSG:4326 works fine – rensa Mar 16 '18 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.