SNAP can't read the projection of an image created programatically with GDAL and Python

Hi,

I created an image programatically using GDAL and Python (Numpy).
This image has the following projection (output with gdalinfo):

Driver: GTiff/GeoTIFF
Files: C:\data\test.tif
Size is 2410, 1488
Coordinate System is:
GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4326”]]
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 1488.0)
Upper Right ( 2410.0, 0.0)
Lower Right ( 2410.0, 1488.0)
Center ( 1205.0, 744.0)
Band 1 Block=2410x1 Type=Float32, ColorInterp=Gray

But in SNAP the projection isn’t recognized (no Lat and Lon values in the bottom status bar).

Is this projection (the standard WGS84) supported by SNAP (or is there maybe something wrong inside the projection itself)?

Thanks.

The coordinates should not be in pixel-coordinates but in lat/lon.
So yes, something must be wrong in your file.
Maybe you missed the ModelTransformationTag.
Attached is one geotif file which has a correct geo-information.

If you don’t know it yet, this is the official GeoTiff spec. page.

Thanks for your response.

I’ve just made a simple test on the Terrain-Corrected SAR image I’m copying the projection from.

So, I printed:

  • The output from the python-GDAL method (i.e. dataset.GetProjection()):

‘GEOGCS[“WGS 84”,DATUM[“World Geodetic System 1984”,SPHEROID[“WGS 84”,6378137.0,298.257223563,AUTHORITY[“EPSG”,“7030”]],AUTHORITY[“EPSG”,“6326”]],PRIMEM[“Greenwich”,0.0,AUTHORITY[“EPSG”,“8901”]],UNIT[“degree”,0.0174532925199433],A
XIS[“Geodetic longitude”,EAST],AXIS[“Geodetic latitude”,NORTH],AUTHORITY[“EPSG”,“4326”]]’

  • And the output from gdalinfo:

Driver: ENVI/ENVI .hdr Labelled
Files: C:\Data\Tewkesbury-LiDAR\stack-lidar.data\Sigma0_HH_slv2_22Jul2008.img
C:\Data\Tewkesbury-LiDAR\stack-lidar.data\Sigma0_HH_slv2_22Jul2008.hdr
Size is 2410, 1488
Coordinate System is:
GEOGCS[“WGS 84”,
DATUM[“World Geodetic System 1984”,
SPHEROID[“WGS 84”,6378137.0,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0.0,
AUTHORITY[“EPSG”,“8901”]],
UNIT[“degree”,0.0174532925199433],
AXIS[“Geodetic longitude”,EAST],
AXIS[“Geodetic latitude”,NORTH],
AUTHORITY[“EPSG”,“4326”]]
Origin = (-2.176220588230444,52.004344989487926)
Pixel Size = (0.000012114940005,-0.000012114940005)
Metadata:
Band_1=Sigma0_HH_slv2_22Jul2008
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( -2.1762206, 52.0043450)
Lower Left ( -2.1762206, 51.9863180)
Upper Right ( -2.1470236, 52.0043450)
Lower Right ( -2.1470236, 51.9863180)
Center ( -2.1616221, 51.9953315)
Band 1 Block=2410x1 Type=Float32, ColorInterp=Undefined
Description = Sigma0_HH_slv2_22Jul2008

As you can notice in the first output (with dataset.GetProjection()), the Corner Coordinates mentioned in you last message is missing. I’ll try to investigate that further.

You were right, dataset.SetGeoTransform(geocoordinates) solved the problem I had with the geo-coordinates that were not displayed in SNAP.