1

I have a DEM with a spatial resolution of 2 meters with a lot of areas with no data. I want to fill those gaps in order to use the whole DEM. I used the 'close gaps' tool in QGIS (it's a SAGA tool) after resampling (because I don't need a 2 meters resolution). I tried the various methods to close gaps that the software offers but I always have the same result.

For every image I get, I have some artefacts appearing (see image below in the red circle). I know that those artefacts are due to sparse pixels.

Picture number 1 is my raw DEM, number 2 is after resampling and closing gaps and number 3 is the same with after hillshading. The artefacts look like volcanoes.

Picture number 1 is my raw DEM, number 2 is after resampling and closing gaps and number 3 is the same with after hillshading. The artefacts look like volcanoes.

My question is, do you know any filter that could remove those small pixels or if there is any way that I get a DEM without the artefacts ? So far I didn't get anything with the filters that I used ('Gaussian filter', 'Remove small pixel clumps'...).

Edit

Here is my data : class : RasterLayer dimensions : 7740, 7228, 55944720 (nrow, ncol, ncell) resolution : 2, 2 (x, y) extent : 312798, 327254, 5072488, 5087968 (xmin, xmax, ymin, ymax) coord. ref. : +proj=utm +zone=32 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 data source : C:\Users\charlie.serrano\Desktop\Cartographie_risques\MNT_Alpes\Test\mnt_test.tif names : mnt_test values : 582.6512, 3323.351 (min, max) No data values : nan

I have no error messages, the filter works to the end but nothing has been filtered.

My workflow is quite simple I load the raster into QGIS and then apply directly the filter on it before resempling it.

My aim is to fill the blank areas with data without big artefacts.

C.Serrano
  • 86
  • 8
  • If you have not done so yet, will you try Erosion, before closing gaps? I think you can find it in SAGA - Morphological Filter (there are several variations according to which project that algorithm came from). Erosion is originally for binary (b/w) data to remove salt noise, and when it is applied to grey-scale image it is (sometimes) called minimum filter. – Kazuhito Oct 15 '18 at 10:02
  • First I should have said that I am applying the filter before any resampling or anything else. So I tried also the 'Erosion' tool and it is not changing anything. My output raster is exaclty the same as my input raster. – C.Serrano Oct 15 '18 at 15:26
  • Your question was relatively simple and straightforward: you requested potentially capable filters. But as far as I can see, none of those you had tried had any appreciable effect on the data. As you can surmise, it would not be an issue of filter selection. Please edit your question and add information; need to fully examine your data, error messages (if any), and your workflow. – Kazuhito Oct 16 '18 at 12:13
  • Thanks! Could you also add nodata setting? – Kazuhito Oct 17 '18 at 10:50
  • I edited it with the no data. – C.Serrano Oct 17 '18 at 11:44
  • Can you find number assigned for No-Data in the Layer Properties | Information tab | Bands section, perhaps? – Kazuhito Oct 17 '18 at 11:48
  • There is no number assigned to the No data (not a number). These are areas with no values. – C.Serrano Oct 17 '18 at 12:14
  • aah, sorry...yes, so it is nan as string. I am not sure SAGA can handle it correctly. If it is at all possible, will you try Reclassify tool? No guarantee, but it may worth a try... – Kazuhito Oct 17 '18 at 12:26
  • So you mean reclasify the no data in order to have a number instead of the nan data right ? – C.Serrano Oct 17 '18 at 13:12
  • Yes, nan to any number such as -99999 which helps SAGA to understand it is NoData. But Reclassify in SAGA Tool may not work. Only solution I could find in this site is GDAL: How to replace NaN pixel values in GeoTIFF, which used gdal_calc. – Kazuhito Oct 17 '18 at 13:21
  • The SAGA tool is not working indeed. I am not sure to understand how reclassifying the no data values would help me though. – C.Serrano Oct 19 '18 at 06:52

0 Answers0