0

I was able to convert my GeoTIFF images (from the SpaceNet dataset) to JPEGs using gdal_translate but I would like to know how to convert the JPEGs back to GeoTIFF. I've noticed that gdal_translate also creates an auxillary file with extension jpg.aux.xml when I do the conversion. Is this to be used for the conversion from JPEG to GeoTIFF? If so, how can this be done?

1

As the manual says, you can translate a raster image to GeoTIFF by specifying the appropriate driver:

gdal_translate -of GTiff in.ext out.tif

Note: In this particular case, ensure that the jpg.aux.xml file that was created when converting from geotiff to jpg is present in the same directory as the image you want to convert. This auxiliary file contains the all the necessary geospatial info and is used by gdal when converting back to geotiff.

  • I did previously try that. But the resulting tif image defaults to the 'World' coordinate system (CRS EPSG:4326 - WGS 84), whereas my original image was in EPSG:32616. The coordinates of both images don't match up. i tried using the -a_srs parameter to forcibly change the projection but it didn't work. Is there a way to get it back to that original format? I think it involves projection onto the correct coordinate system, but I'm new to working with satellite images so I'm not entirely sure on the process. – Ashwin Nair Feb 20 at 10:07
  • 1
    @AshwinNair Please Edit your question to contain details like this. – Vince Feb 20 at 12:31
  • 1
    My bad! The jpg.aux.xml file contains the necessary info to do the conversion. I was placing those files elsewhere. Simply put, gdal_translate will in fact do the trick. You just have to ensure the jpg.aux.xml file is located in the same directory. I'll just add this to @bugmenot123's answer to make it clearer. – Ashwin Nair Feb 20 at 13:14

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.