[gdal-dev] Slope obtained with GDAL has weird lines

Danilo da Rosa daniloide at gmail.com
Tue Mar 17 13:24:33 PDT 2020


Thanks for your answers Joaquim, Alex and Martin!

I think the problem is height is measured by 1m intervals, thatś why I see
1 meter contour lines in the slope result. The dem grid was not
interpolated from contours, at least not by me, the data comes from Mapzen
terrain tiles, I don't know exactly how they are producing it.

Do you think it would be a good idea to do some kind of interpolation to
smooth the DEM file or the slope file? Do you have any recommendations on
how to do that using gdal? The idea is to use the gdaldem color-relief
command to generate a coloured and easy to read map. The problem is that
this lines makes the map more difficult to understand, which is a priority
in this case.

Thanks again!
Danilo


El mar., 17 mar. 2020 a las 4:50, Martin Chapman (<mchapman at hyperacktive.com>)
escribió:

> A slope map indicates the maximum rate of change between a pixel elevation
> value and its neighboring 8 pixels.  In other words, the output value for
> each pixel represents the steepest slope, or decent to the neighboring
> elevation values.  The output values are given as either percent slope or
> degrees from 0 (flat) to 90 (vertical) depending on the command line
> switches you choose.
>
> Therefore, the output raster values no longer represent elevation values
> from the input but rather slope (steepness) values and should be
> interpreted differently.  A common way to visually interpret them would be
> to color code them with a color ramp where each color in the ramp
> represents a range of degrees somewhere between 0 and 90.  That way a user
> can look at the image and quickly identify steep slopes versus not so steep
> slopes and flat areas.  To create a color ramp that matches changes in
> steepness you will need to use a statistical method on the slope values
> such as standard deviations or jenks natural breaks to group similar slope
> values together and where they change.  In other words, you will want your
> color ramp to change colors where flat areas start to get steeper.  I hope
> that makes sense.
>
> Another way to use the results would be to write an algorithm to identify
> areas that are within a certain range of steepness so you could identify a
> good place to build a road or perhaps lay train tracks that must not exceed
> a certain steepness.
>
> I hope that helps.
>
> Best regards,
> Martin Chapman
>
> On Mar 16, 2020, at 5:09 PM, Danilo da Rosa <daniloide at gmail.com> wrote:
>
> 
> Hi!
>
> This may be a very basic question, but I can't find the answer anyware.
>
> I am working with this DEM obtained using terraincache
> <https://pypi.org/project/terraincache/>, it uses mapzen data. The SRC is
> WGS 84.
>
> [image: DEM File in QGIS] <https://i.stack.imgur.com/Sp4Sg.jpg>
>
> I ran this GDAL command to get the slope:
>
> gdaldem slope -s 111120 dem.tif slope.tif (I had to do scaling because of
> the SRC)
>
> The resulting image looks fine but it's not smooth, it has weird lines
> over it, like contour lines.
>
> [image: Slope file on QGIS] <https://i.stack.imgur.com/POcHR.jpg>
>
> You can download the DEM file here: https://gofile.io/?c=Du7WnM
>
> Does anyone have an idea of how to solve it?
>
> Thanks in advance for your help,
>
> Danilo
>
> P.S. I made this question here too:
> https://gis.stackexchange.com/questions/353983/slope-obtained-with-gdal-has-weird-lines
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200317/f3b64231/attachment.html>


More information about the gdal-dev mailing list