How to reproject the IMS 1km or 4 km GeoTIFFs to geographic latitude/longitude
If you need to reproject the IMS 1 km or 4 km GeoTIFFs to geographic latitude/longitude, we recommend using the Geospatial Data Abstraction Library (GDAL). Instructions for downloading and installing it can be found here:
https://gdal.org/download.html
Below are instructions for using GDAL directly in the command line or in a python script.
Command Line
- Open a terminal and navigate to the folder where the GeoTIFFs you want to reproject are located.
- Issue the following command to reproject and save the output as a new GeoTIFF:
gdal_warp -t_srs EPSG:4326 -te -180 -90 180 90 -srcnodata 0 -r near -of GTiff -co COMPRESS=deflate -wo NUM_THREADS=4 <input GeoTIFF> <output GeoTIFF>
For example, if you wanted to reproject the 1 km GeoTIFF 'ims_2020335_1km_GIS_v1.3.tif' and save it as 'out.tif':
gdal_warp -t_srs EPSG:4326 -te -180 -90 180 90 -srcnodata 0 -r near -of GTiff -co COMPRESS=deflate -wo NUM_THREADS=4 ims2020335_1km_GIS_v1.3.tif out.tif
Python
Below is some example python code for reprojecting a 1km GeoTIFF:
from osgeo import gdal
input_file = 'ims_2020335_1km_GIS_v1.3.tif'
output_file = 'out.tif'
gdal.Warp(output_file, input_file,
options='-t_srs EPSG:4326 '
'-te -180 -90 180 90 '
'-srcnodata {} '.format(0) +
'-r near '
'-of GTiff '
'-co COMPRESS=deflate '
'-wo NUM_THREADS=4')