1

I have a problem with creating tiles from from Mars HiRISE images using gdal/gda2tiles. Can't find info regarding this topic, so, maybe someone already faced that issue?

Image looks like this

enter image description here

Final goal is to show this tiles on the top of CesiumJS, but for now Leaflet/OL/etc map would be also fine.

Input source file has following parameters:

enter image description here

What worries me a bit here is the fact, that

enter image description here

Datum is unknown. Maybe this is the source of all my problems with further processing, but this is just my guess.

QGIS show following SRS:

enter image description here

For tiles generation I use gda2tiles utility.

If I try to run gdal2tiles directly from Python like this

minZoomLevel = 8
maxZoomLevel = 12
options = {'zoom': (minZoomLevel, maxZoomLevel)}
gdal2tiles.generate_tiles(sourceImagePath, outputTilesFolder, **options)

I got following output:

enter image description here

So, for sure something is wrong.

I tried different resampling values, tried to provide also source Spatial reference, but that didn't help.

After googling I also tried before calling gdal2tiles to wrap original image and only then call gdal2tiles. So, I tried

gdalwarp -co TILED=YES -co COMPRESS=DEFLATE -t_srs EPSG:3857 -ot Int16 -r cubic /MarsData/esp_057760_2025_red.jp2 /MarsData/warped.tif

and then call gda2tiles for warped.tif, but that didn't help.

I also tried to provide input file SRS for wrapping (took it from QGIS)

gdalwarp -co TILED=YES -co COMPRESS=DEFLATE -s_srs '+proj=eqc +lat_ts=0 +lat_0=20 +lon_0=180 +x_0=0 +y_0=0 +a=3393833.2607584 +b=3393833.2607584 +units=m +no_defs' -t_srs EPSG:3857 -ot Int16 -r cubic /MarsData/esp_057760_2025_red.jp2 /MarsData/warped.tif

But this also didn't help. I still see the same output tiles.

Can someone point me where is my problem and how to solve it?

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.