Back-Geocoding fails with “Entire image is outside of SRTM valid area” when using Copernicus 30 m DEM in esa_snappy

I’m trying to run Back-Geocoding in Python using snappy (SNAP 12.0) with the Copernicus 30 m Global DEM, but I keep getting this error:

RuntimeError: org.esa.snap.core.gpf.OperatorException:
Entire image is outside of SRTM valid area.
Please use another DEM.

However, the AOI is in northern Norway (around Alta, 69° N) — well within Copernicus DEM coverage.

Here’s the relevant Python snippet:

from esa_snappy import GPF, HashMap

coreg_params = HashMap()
coreg_params.put(“DEMName”, “Copernicus 30m Global DEM”)
coreg_params.put(“DEMResamplingMethod”, “BILINEAR_INTERPOLATION”)
coreg_params.put(“ResamplingType”, “BILINEAR_INTERPOLATION”)
coreg_params.put(“MaskOutAreaWithoutElevation”, True)
coreg_params.put(“OutputDerampAndDemodPhase”, False)
coreg_params.put(“DisableReramp”, False)

coreg = GPF.createProduct(“Back-Geocoding”, coreg_params, [orbit_2, orbit_1])

SNAP desktop work as expected.

Thanks in advance!
Pritimoy Podder

@dolaf, could you please have a look?

Hi,

I doubt that this issue is related to the use of Python or esa_snappy.

To reproduce and investigate the problem, could you please provide a bit more information:

  • your full Python script to better understand, e.g., what is orbit_2, orbit_1?
  • the input product(s) you are using
  • What is the corresponding workflow in SNAP desktop which you say ‘works as expected’?

Many thanks,
Olaf

1 Like

Hello,
I have the same issue with a few Sentinel 2 images (for example: S2A_MSIL1C_20170622T104021_N0500_R00T32WPS_20231012T033537.SAFE)
this is the python script invoking snappy.

(coordinates used for polygon were: minlon : 12.212123, maxlon 12.317597 , minlat : 64.773622, maxlat: 64.818538)

product = ProductIO.readProduct(input_file)

params = HashMap()
params.put(“targetResolution”, JInt(res))
params.put(“upsampling”, “Nearest”)
params.put(“downsampling”, “Mean”)
params.put(“flagDownsampling”, “First”)
params.put(“resampleOnPyramidLevels”, False)

resampled = GPF.createProduct(“Resample”, params, product)

params_subset = HashMap()

params_subset.put(“geoRegion”,
"POLYGON((%f %f, %f %f, %f %f, %f %f, %f (minlon, maxlat, maxlon, maxlat, maxlon, minlat, minlon, minlat, minlon, maxlat))

subset = GPF.createProduct(“Subset”, params_subset, resampled)

params_ide = HashMap()
params_ide.put(‘copyToaReflectances’,False)
params_ide.put(‘computeMountainShadow’,True)
params_ide.put(‘computeCloudShadow’,False)
ide = GPF.createProduct(‘Idepix.S2’,params_ide,subset)

ProductIO.writeProduct(ide, output_nc,“NetCDF4-BEAM”)

I think the SRTM DEM covers only areas between 60 degree north latitude and 56 degree south latitude. Your S2 product is not in this region. You can Copernicus 30m or 90m global DEM which covers your product.

1 Like