Some information: I must not re-sample the image, the pixels are rotated, and the image opens in ArcMap just fine.
now, there are 15 GCPs on the raster (which make the pixels rotate)

1.When I first try to use gdallocationinfo I get:
ERROR 6: No translation for an empty SRS to PROJ.4 format is known.

2.I use gdal_edit -ro -a_srs epsg:4326 "Image", this creates a .aux.xml file with the same name as my image, GDAL now reads them both together, image still works on ArcMap. Then I use gdallocationinfo again and get:

ERROR 1: Cannot get geotransform

3.I use gcps2wld "Image" to get the geotransformation parameters, and insert it to the .aux.xml file via Python GDAL dataset.SetGeoTransform

now ArcMap can't read the image, and when I use gdalinfo, I get the following:

Corner Coordinates: Upper Left ( 0.0000360, -0.0000277) ( 0d 0' 0.13"E, 0d 0' 0.10"S)
Lower Left ( -0.145, 887589.718) ( 0d 8'43.59"W,Invalid angle)
Upper Right ( -0.068,-1152505.040) ( 0d 4' 3.91"W,Invalid angle)
Lower Right ( -0.213, -264915.321) ( 0d12'47.63"W,Invalid angle)
Center ( -0.107, -132457.661) ( 0d 6'23.75"W,Invalid angle)

and if I Ignore that and use gdallocationinfo, coordinates that are supposed to be in the image give me errors for being outside the image borders.

I tried using gdal_edit -a_ullr to set the corner coordinates, but that just norths up the image (no rotation).

How do I set up the image right (without resampling) so I can get the right pixels in the right coordinates?

1 Answer 1


Okay, I found the cause of the problem. I got the order of the geotransformation parameters wrong.

the georeferencing transform takes the following form :

adfGeoTransform[0] /* top left x */
adfGeoTransform[1] /* w-e pixel resolution */
adfGeoTransform[2] /* 0 */
adfGeoTransform[3] /* top left y */
adfGeoTransform[4] /* 0 */
adfGeoTransform[5] /* n-s pixel resolution (negative value) */

I hope this helps anyone!

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.