4

I have rendered a TIFF file, which is on the Mars2000, simple cyllindrical projection format. I want to upload the file to MapBox, and thus need a GeoTiff file.

How can I use GDAL, or similar, to convert the TIFF file to a GeoTIFF?

The image is on the exact same format and resolution as Mars MGS MOLA, as this was the base image for the render, which looks like this: Mars Render

I used GDAL with the command gdal_translate -of GTiff -a_srs .\format.wkt input.tif output.tif (which worked without errors) however when I upload to MapBox I get the following error Error creating Mapnik Datasource: could not read georeferencing , so I suspect the format is still corrupt somehow.

user2856
  • 65,736
  • 6
  • 115
  • 196
Rudi
  • 71
  • 5
  • 1
    what is the disk file size of the TIFF, have you tried using this online converter? https://mygeodata.cloud/converter/img-to-geotiff – Yogesh Chavan Feb 23 '22 at 15:41
  • @Yogi It's 4GB, so that might be an option. If I understood their pricing correctly I would have to purchase a premium plan though. – Rudi Feb 23 '22 at 15:47
  • It's free for the first few conversions though. But not sure if the browser limit will allow you to get it uploaded. Give it a try. – Yogesh Chavan Feb 23 '22 at 15:57
  • It's only free for 5 MB, I would have to purchase the most expensive plan to convert all 4GB unfortunately – Rudi Feb 23 '22 at 16:03
  • 1
    oops! then might have to see other options. There are other ways around it besides making it too expensive. Do you have any GIS desktop apps? https://gis.stackexchange.com/questions/87642/convert-tif-with-tfw-to-a-geotiff https://stackoverflow.com/questions/10956818/how-to-use-gdal-to-create-geotiff-from-tiff-and-4-corners-latitude-and-longitude – Yogesh Chavan Feb 23 '22 at 16:04
  • Yes, I have ArcGIS Pro. I'll try the GDAL solution, however I'm unsure of what to specify in the coordinate system argument as the mars2000 format is not very common – Rudi Feb 23 '22 at 17:49
  • 1
    Instead of adding the solution to your question body, it would be more useful to create an an answer and accept it as correct. – Matt Feb 25 '22 at 09:48
  • @Matt Noted. Answer added. – Rudi Mar 03 '22 at 07:58

1 Answers1

2

The solution was to do an inspection of the original TIFF (using gdalinfo) to figure out the corner coordinates of the projection, and copying the projection format to a file named format.wkt. The correct metadata was then assigned using gdal_translate -of GTiff -a_srs .\format.wkt -a_ullr -10669675.197 5334837.599 10669675.197 -5334837.599 input.tif output.tif

Rudi
  • 71
  • 5