1

I am using Python and QGIS. I have obtained - purchased - a 1m DSM photogrammetry data file - a TIFF. I could purchase a DTM from the same company, but they are 5m grid, and so they lose some data I wish to keep. I am looking to define glacial sediment mounds which can be fairly small and quite low. I am trying to find - or develop - an algorithm that can be executed for small regions in the TIFF file, such as wooded areas, or buildings, and that reduce the size (both elevation and extent) of features that represent a jump in height that does not fit with the topography. Thus features are recognisable within the 1m grid by a jump in elevation of 1m or more. And thus I can - and am willing to - assume the land elevation under the feature is similar to the land elevation each side of the feature. At present I am reading areas of the TIFF file and processing these parts cell by cell using Python and numpy.

2
  • Did you have a look at the raster calculator (both the native QGIS as well as SAGA raster calculator)?
    – Babel
    Dec 14 '20 at 15:47
  • I have tried quite a few of these functions out but the results were unsatisfactory, I felt, for what I want. So I am having a try at developing an algorithm(s) that examine a small area, or a single feature, and in some way replace large changes in elevation with approximations of ground surface. Dec 15 '20 at 14:03
0

I asked the question because I have access to a 1 m photogrammetry of a valley where the landscape includes mounds of glacial deposits from the Last Ice Age. Having identified one as being lake deposits – at about 8m thick – the task is to identify the other mound locations and extents. They have small dimensions – single metres or sub-metre dimensions, so the DTM that is available at 5m grid is not so useful as the 1m DSM. So I am developing an algorithm that I can use to remove features based on their identification by the sudden change in elevation – buildings, trees, shrubs, woodlands, hedgerows. The algorithm I have come up with so far is simple – I do not want to fabricate elevations more than needed. So the idea is to take the ground elevation each side of the feature, identify where the feature starts and ends by the change in elevation above a certain amount (which thereby represents the maximum expected terrain gradient), and replace the higher elevations by an interpolation from one side to the other. The process works on an area of a raster layer as delineated by drawing a rectangle on the canvas. Scanning of the grid pixel by pixel can be either horizontal or vertical. Thus on finding a large change in elevation – above a certain value x – the algorithm goes to the end of the row (or column if scanning vertically) and then scans backwards until a large elevation change is encountered. The assumption here is that the two elevation jumps represent the two sides of the tree/building etc. An adjustment I have made is that instead of scanning for the farthest elevation jump, the algorithm can if required scan for the next – the nearest – elevation jump. This is determined by a parameter at run time. In this latter case, on finding the first elevation jump, the algorithm scans forward to find an elevation that is within the 'jump' or 'rise' limit specified – assumed to represent for example a clearing within a woodland. Thus several lengths of cells may be replaced in this case within each line of cells. The problem I have is that whether I scan vertically or horizontally, although the interpolation works well, the resulting contours and hillshades show vertical or horizontal lines. I have managed to reduce these, but I cannot eliminate them. I believe that by scanning to the sides, as well as forwards, this may help to eliminate such lines of similar elevations, or at least to fuzzify them. If anyone has any ideas as to how to do this, or an algorithm for scanning cells – anything that might add to the value, I would love to hear them. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.