1

I have a GeoTIFF that appears to have a broken proj4 K value. When I run the command: gdalsrsinfo -o proj4 <Filename> I get the output: +proj=stere +lat_0=-90 +lon_0=0 +k=0 +x_0=0 +y_0=0 +R=1737400 +units=m +no_defs

My understanding is that k should never be 0. I assume the author of this GeoTIFF intended for it to be 1.

I tried using following command to set k with no luck: gdal_translate -projwin_srs "+proj=stere +lat_0=-90 +lon_0=0 +k=1 +x_0=0 +y_0=0 +R=1737400 +units=m +no_defs" <input file> <output file>

How can I update the proj4 k value of my GeoTIFF? Is the proj4 string something that can be changed directly?

1
  • I can't speak to whether that parameter is valid, but you may want to try gdal_edit. There's a description of generally accepted SRS definitions here which includes proj4 strings
    – mikewatt
    Commented Mar 17, 2020 at 17:25

1 Answer 1

1

The gdal_translate documentation https://gdal.org/programs/gdal_translate.html documents also the right option for your use case.

-a_srs Override the projection for the output file. The may be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a file containing the WKT. No reprojection is done.

You can also correct the wrong metadata in place with gdal_edit https://gdal.org/programs/gdal_edit.html but it is a Python script and you must have a working Python environment for GDAL.

Usage:

python gdal_edit.py -a_srs "+proj=stere +lat_0=-90 +lon_0=0 +k=1 +x_0=0 +y_0=0 +R=1737400 +units=m +no_defs" your_tif.tif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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