1

I downloaded several USGS GeoTIFFs from the USGS Earth Explorer site (https://earthexplorer.usgs.gov/). These were then converted to contours using the qgis toolbox (GDAL -> Raster Extraction -> Contour). The command was of the form:

gdal_contour -b 1 -a ELEV -i 5.0 -f "ESRI Shapefile" n33_w086_1arc_v3.tif n33_w086_1arc_v3.shp

At the boundaries of my tiles, there is a slight overlap which leaves a "ladder" effect:

contours extend past tile boundary

If I had to guess, these are artifacts resulting from GDAL hitting the edge of the GeoTIFF while processing a contour line. These are very distracting visually. How can they be trimmed or removed?

3
  • 4
    First: get more DEM data outside your focus area than you need, you can trim off the contours outside your AOI later. Second: Merge your GeoTIFF into one file, that way there won't be internal edges. Third: smooth the DEM gis.stackexchange.com/questions/12833/smoothing-dem-using-grass then make your contours. This assumes you're only dealing with a relatively small area, for a larger area you'll hit the 2 GiB shapefile size limit depending on the ruggedness of the terrain and the contour interval. Commented Dec 5, 2023 at 5:59
  • Excellent advice. Could you post this as an answer so I can accept it?
    – Jeff W
    Commented Dec 5, 2023 at 12:14
  • 1
    Jeff W, please answer your own question expanding on my previous comment illuminating how you performed each of the tasks. Commented Dec 6, 2023 at 4:45

1 Answer 1

3

Following the advice of Michael Stimson (see the response to the original question), this was quite easy.

First, add your GeoTIFF tiles:

enter image description here

Open the "Processing Toolbox", and access GDAL-> Raster Miscellaneous -> Merge:

enter image description here

Select the GeoTIFF tiles you want to merge:

enter image description here

A new "Merged" layer is added to your Layers panel. Note that the tiles are normalized and appear cohesive:

enter image description here

Back in the Processing Toolbox, select GDAL -> Raster Extraction -> Contour:
enter image description here

Select your merged layer, adjust the settings as required, and press "Run":

enter image description here

Done!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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