I'm trying to display some data using arctic ice extent data (projected in EPSG:3413, NSIDC Polar Stereographic North). I have processed the distributed images using gdal2tiles with the following command: gdal2tiles -p raster -s EPSG:3413 -z '0-5' -e -n tmp.vrt (tmp.vrt is the RGB-ified file I created from the TIFF using gdal_translate)

When I try to display the tiles with Leaflet (or with OpenLayers, for that matter), at zoom=0 the page has a line of oddly curved versions of my tiles, flat along the top but looking like they've had big circular bites taken out of them along the bottom. Zooming in causes the proper tiles to mostly appear, but there is still the line of curved ones cutting across it, obscuring a large area of the actual images.

I assume this is some kind of projection issue, and I have tried correcting it using a Proj4Leaflet CRS, but all that does is leave the oddly-shaped tiles and badly rearrange those few tiles it displays sensibly.

I'm fairly new to this, and can't figure out if the issue is in the way I've processed the tiles with GDAL, or in the way I'm trying to display them with Leaflet.

Here is a screenshot of the display at zoom=0: zoom 0

And at zoom=2

zoom 2

Here's the level-0 image the page is trying to read from. All other tiles are just rectangular slices of this image: 0.png

And the relevant code:

  var map = new L.map('map').setView([90,0], 0);

  L.tileLayer('data/20170112/{z}/{x}/{y}.png', {
    tms: true,
    nowrap: true,
    attribution: "Map data courtesy University of Bremen",
    maxZoom: 5

In case this is the problem, here's my entire "processing chain", such as it is:

$ wget http://www.iup.uni-bremen.de:8084/amsr2data/asi_daygrid_swath/n3125/2017/jan/Arctic3125/asi-AMSR2-n3125-20170112-v5.tif
$ gdal_translate -of vrt -expand rgb asi-AMSR2-n3125-20170112-v5.tif tmp.vrt
$ gdal2tiles -p raster -s EPSG:3413 -z '0-5' -e -n tmp.vrt 20170112
  • please add a picture of what you see and the shortest code example that shows the issue – Ian Turton Jan 16 '17 at 10:36
  • It would help to see a couple of the tiles, preferably the low-zoom-level ones. – IvanSanchez Jan 16 '17 at 10:36
  • My guess is that the tiles are ending up in 4326, 3857 or another "rectangular" CRS. TMS does support a "Local" option, but I don't know if gdal2tiles does. – mkennedy Jan 16 '17 at 19: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.