I have downloaded an IMG file of NED data from the USGS National Map elevation products site and I want to create a contour map using QGIS.

The problem is, the NED raster is "oversampled". There are far more pixels in the raster than the spatial resolution of the elevation data they represent. Therefore, when the contour tool in QGIS is used, the contours follow the edge of each block of similar pixels like so:

Jagged contours along blocks of like pixels.

How can I achieve smooth contour lines?

I assume it's better to somehow resample the raster so that each elevation sample is represented by a single pixel and then rerun the contour tool rather than trying to smooth the jagged contours shown in the image above. Simply resampling the NED raster with a cubic spline is not effective because it only smooths the edges of each pixel group.

  • 4
    This is a common issue in working with contours from integer rasters. The usual solution is to use a low bypass filter. See gis.stackexchange.com/questions/9431/… – Vince Jan 5 '16 at 12:04
  • The Gaussian blur code you linked to worked well using very large kernel sizes. I will enter as answer. – EP_Guy Jan 5 '16 at 23:49

Using the Gaussian blur code here: https://gis.stackexchange.com/a/10467/61018

with very large kernel sizes of ~500 pixels, I was able to achieve the results I wanted.

enter image description here

| improve this answer | |

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