Custom azimuthal equidistant projection wrong? (Reprojection Module)

Hi,

when performing range doppler terrain correction (from GRD Data) with reprojection to a customized azimuthal equidistant projection (+proj=aeqd +lat_0=53 +lon_0=24 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs) the resulting coordinates are off by about 400m from where they should be (eastward shift, latitude seems to be fine). No false easting is specified.
The proj4 string as displayed by gdal is correct and what I expected.
It doesn’t matter whether the output format is BEAM-DIMAP or GeoTiff.

To reproduce:
The map projection is defined in the terrain correction module by selecting “Azimuthal Equidistant” (WGS84) and specifying the projection parameters: Latitude of origin = 53.0 and Central meridian= 24.0
Here’s an example graph: terraincorrect_aeqd.xml (3.7 KB)
And an example scene: S1A_IW_GRDH_1SDV_20141004T044317_20141004T044342_002675_002FBB_9677

When viewing the image in SNAP it looks fine relative to Sentinel 2 imagery for example.
However viewing it in any other GIS (QGIS; ENVI; GRASS) results in the wrong offset.
Also, if I run gdalwarp on it and reproject back to LatLong the offset remains.
Reprojecting to LatLong within SNAP results in a correctly projected image.

So either SNAP knows something GDAL or ENVI don’t (I couldn’t think of what that might be) or the transformation in SNAP is wrong (albeit consistently wrong, since the back transform to LatLong works fine)

Any ideas?
Benjamin

Here’s what it looks like in QGIS (red tones are LatLong, and verified correct, blue tones are originally AEQD projected by SNAP and then reprojected to LatLong by gdalwarp):

After some more back and forth transformations the issue appears to be in the reprojection module itself and not in the terrain correction.
I created a small test raster (available here) and used SNAP to project it forward to the AEQD projection described above and then used either gdalwarp or SNAP to project it back to LatLong.
Only with the SNAP reprojection did it end up on the same location as the original LatLong image (orange rectangle below).

Of course it could also be GDAL which is wrong here, but I suspect that since both GDAL and ENVI agree, they are correct (?).

While doing this I also noticed that the second projection in SNAP works only if the first projection was saved as BEAM-DIMAP. It would not let me select a tif as intermediary product for reprojection (although it had not problems opening and displaying tifs).

There is an issue with the current implementation of the azimuthal equidistant projection. It is only computed on a sphere.
There is already a discussion about it.


It will be fixed in the next major release of SNAP.

Great. Thanks for the info.