Adding to the investigation, here is what happens when you take a Sentinel-1 GRD product (S1A_IW_GRDH_1SDV_20230418T045710_20230418T045735_048146_05C9DA_636F.SAFE
), open it in SNAP and without any processing save it as BEAM-DIMAP:
For the GeoTIFF files in *.SAFE/measurements/
the listgeo
tool lists the GCPs as follows:
Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
ModelTiepointTag (420,3):
0 0 0
26.8451672983579 66.486390503476 172.991735818796
...
26611 16668 0
20.3371741685618 65.495580215619 299.978554510511
End_Of_Tags.
Keyed_Information:
GTModelTypeGeoKey (Short,1): ModelTypeGeographic
GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
GTCitationGeoKey (Ascii,25): "Geo-referenced SAR image"
GeographicTypeGeoKey (Short,1): GCS_WGS_84
GeogCitationGeoKey (Ascii,7): "WGS 84"
GeogLinearUnitsGeoKey (Short,1): Linear_Meter
GeogAngularUnitsGeoKey (Short,1): Angular_Degree
GeogEllipsoidGeoKey (Short,1): proj_create_from_database: ellipsoid not found
Unknown-4326
GeogSemiMajorAxisGeoKey (Double,1): 6378137
GeogSemiMinorAxisGeoKey (Double,1): 6356752.314245
GeogInvFlatteningGeoKey (Double,1): 298.25722356049
ProjLinearUnitsGeoKey (Short,1): Linear_Meter
End_Of_Keys.
End_Of_Geotiff.
proj_create_from_database: ellipsoid not found
GCS: 4326/WGS 84
Datum: 6326/World Geodetic System 1984
proj_create_from_database: ellipsoid not found
Ellipsoid: 4326/(unknown) (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E)
Projection Linear Units: 9001/metre (1.000000m)
Corner Coordinates:
... unable to transform points between pixel/line and PCS space
In the corresponding *.dim
file, the new tie point grids are defined as follows:
<Tie_Point_Grid_Info>
<TIE_POINT_GRID_INDEX>0</TIE_POINT_GRID_INDEX>
<TIE_POINT_DESCRIPTION />
<PHYSICAL_UNIT>deg</PHYSICAL_UNIT>
<TIE_POINT_GRID_NAME>latitude</TIE_POINT_GRID_NAME>
<DATA_TYPE>float32</DATA_TYPE>
<NCOLS>21</NCOLS>
<NROWS>10</NROWS>
<OFFSET_X>0.5</OFFSET_X>
<OFFSET_Y>0.5</OFFSET_Y>
<STEP_X>1330.6</STEP_X>
<STEP_Y>1852.111111111111</STEP_Y>
<CYCLIC discontinuity="0">false</CYCLIC>
</Tie_Point_Grid_Info>
Note that OFFSET_X
and OFFSET_Y
are both set to 0.5 , so the first GCP in the grid should be located at pixel position (0.5,0.5), which I can only assume to be the center of the first pixel.
Extracting the latitude and longitude coordinates of the first GCP from *.data/tie_point_grids/{latitude,longitude}.img
, the first GCP has longitude 26.845167 and latitude 66.48639, matching the first GCP in the GeoTiff (with a bit loss of precision).
So from the BEAM-DIMAP files, I have the suspicion that the first GCP in the GeoTIFF also should have been located at the center of the first pixel and either should have been listed as row=0.5, col=0.5
or the GeoTIFF should have raster type PixelIsPoint
instead.
For completeness, here’s the first GCP as listed in the *.SAFE/annotations/*.xml
files:
<geolocationGridPoint>
<azimuthTime>2023-04-18T04:57:10.257157</azimuthTime>
<slantRangeTime>5.337481673596213e-03</slantRangeTime>
<line>0</line>
<pixel>0</pixel>
<latitude>6.648639050347597e+01</latitude>
<longitude>2.684516729835792e+01</longitude>
<height>1.729917358187959e+02</height>
<incidenceAngle>2.967662079378803e+01</incidenceAngle>
<elevationAngle>2.646322582002259e+01</elevationAngle>
</geolocationGridPoint>
Again, it is not clear to me here, whether the line and pixel attributes refer to the upper left corner or the center of the indexed pixels. The Sentinel-1 product specification just lists:
Name |
Description |
Data Type |
Cardinality |
line |
Reference image MDS line to which this geolocation grid point applies. |
uint32 |
1 |
pixel |
Reference image MDS sample to which this geolocation grid point applies. |
uint32 |
1 |