Forums » GAMMA Processing » DEM generation »
getting error while create DEM using SRTM data
Added by deepAI M over 5 years ago
Hi ,
I am trying to create DEM using SRTM data(1arcsec SRTM DEM tiles). I have used the following script but getting error, its saying area is not covered. can anyone suggest me how to solve the error.
I have attached area of sentinel image and corresponding dem area images. I got total 6 dem files and combine it using mosaic function.
gdal_translate -of ENVI srtm.tif srtm
#DEM in GeoTIFF can be separated in imagery, xml and hdr files
gdal_translate -of ENVI n39_w122_1arc_v3.tif srtm2
create_dem_par srtm.par
mosaic dem1 dem1.par dem2 dem2.par dem3 srtm_all srtm_all.par 0 3
#GAMMA uses a big endian. Thus, the data with little endian ordering has to be converted.
swap_bytes srtm_all srtm_all2 2
#GAMMA uses 0 as abnormal value. Thus, the data with 0 has to be replaced to 1.
replace_values srtm_all2 0 1 srtm_all3 width 0 4
#SRTM DEM uses -32768 as abnormal value. Those values has to be replaced to 0.
replace_values srtm_all3 -32768 0 srtm_dem4 width 0 4
gc_map 20190625.slc.mli.par - srtm_all.par srtm_temp4 EQA.dem_par EQA.dem masterimage.lt 2 2 masterimage.sim_sar
I am getting error. area is not covered.
Thank you
Screen Shot 2019-09-10 at 21.45.01.png (185 KB) Screen Shot 2019-09-10 at 21.45.01.png | sentinel image | ||
Screen Shot 2019-09-10 at 21.46.50.png (1.14 MB) Screen Shot 2019-09-10 at 21.46.50.png | dem area |
Replies (6)
getting error while create DEM using SRTM data - Added by Charles Werner over 5 years ago
Hello,
To get the corners of the required DEM in a scene use the Gamma program SLC_corners
Now check if the tif file actually covers the scene. n39 and w122 refer to the
lower left corner of the tile, I believe.
There is an open source python package called elevation where you can give the
lower left and upper right corner of the desired DEM segment (note this program
wants you to specify the lower left corner and upper right corner(!)) and it
will download and create the geotiff file for you....
https://pypi.org/project/elevation/
enjoy...
Cheers,
Charles
RE: getting error while create DEM using SRTM data - Added by deepAI M over 5 years ago
Hi Charles, Thanks for the clarification. I will check now.
RE: getting error while create DEM using SRTM data - Added by deepAI M over 5 years ago
Thanks you Charles,
I am working on 1st sub swath. The corners of the 1st sub swath is
upper left corner latitude, longitude (deg.): 39.80 -122.30
lower right corner latitude, longitude (deg.): 39.38 -121.16
I extracted DEM tiff file corresponding the above scene and got 4 DEM tiffs. I calculated srtm2dem for all tiff and applied mosaic function.
The matching is not good if I combined DEM 4 files (dis2ras pix_gamma0.bmp 20190625.slc.mli.bmp) but it matches looks good if i use individual DEM.
I guess I am doing wrong with mosaic function. I am using Mosaic 4 dem1 dem.par dem2 dem2.par dem3 dem3.par dem4 dem4.par demall demall.par).
May I know where am doing wrong. thanks in advance.
Best Regards,
Pradeep
RE: getting error while create DEM using SRTM data - Added by deepAI M over 5 years ago
HI Charles,
Hope you are busy. I tried elevation library also but saying dem is not cover. even changed the corners.
Do I need to give the correct order to Mosaic function?
RE: getting error while create DEM using SRTM data - Added by Charles Werner over 5 years ago
Hello,
To find out the coverage of the DEM tile as geotiff, use gdalinfo
The program dem_import in the gamma software can be used import individual DEM
tiles and put them together.
Alternately, there is a python package that will download all the tiles required
to cover a bounding box specified by the lower left corner and upper right
corner (not the usual...) but it works very well.
https://pypi.org/project/elevation/
Then you no longer need to mosaic dem tiles yourself.
To import the DEM into gamma, use the dem_import command to read the data and
convert the heights from geoidal to WGS84 ellipsoidal heights.
The newest version of SLC_corners will give the corners of the the bounding
rectangle lower left and upper right.
Also you can run ScanSAR_burst_corners to get the DEM bounds.
Best regards,
Charles
getting error while create DEM using SRTM data - Added by deepAI M over 5 years ago
Thank you very much for you time and valuable suggestions.