[R-sig-Geo] Mapping contours from jpg map

Pierre Roudier pierre.roudier at gmail.com
Wed Jul 13 07:34:24 CEST 2011


There's even a dedicated page on the GRASS-wiki:
http://grass.osgeo.org/wiki/Contour_lines_to_DEM

HTH,

Pierre

2011/7/13 Dylan Beaudette <dylan.beaudette at gmail.com>:
> I would second Roger's comments. I have found r.surf.contour does well
> in complex terrain, especially at interfaces with water (i.e. alpine
> lakes). There are several related threads on the GRASS mailing list.
>
> Dylan
>
> On Fri, Jul 8, 2011 at 8:09 AM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
>> On Fri, 8 Jul 2011, Barry Rowlingson wrote:
>>
>>> On Fri, Jul 8, 2011 at 2:26 PM, Robert Hijmans <r.hijmans at gmail.com>
>>> wrote:
>>>
>>>
>>>
>>>> # now there are many ways to interpolate. See, e.g., the 'gstat' and
>>>> 'automap' packages. See raster::interpolate for an example with splines.
>>>> # using gstat and inverse distrance weighted interpolation:
>>>>
>>>> library(gstat)
>>>> g <- gstat(id="level", formula = level~1, data=p, nmax=7, set=list(idp =
>>>> .5))
>>>> x1 <- interpolate(r, g)
>>>
>>> Statistical interpolation techniques may be right for this, but
>>> thinking about it last night made me realise that contours are more
>>> than just linear estimates of height at location. There's the
>>> implication that between any two contour lines of height H1 and H2
>>> there are no locations with height outside the bounds of (H1,H2).
>>> Otherwise there would be a contour line there.
>>>
>>> And this may not be so uncommon in elevation models. Consider a steep
>>> sided valley with a wide flood plain. You have close contours on
>>> either side with a big gap between. Would a "statistical"
>>> interpolation run down the valley side and plummet on down, then back
>>> up the other side, turning the flood plain into a deep rounded valley
>>> bottom? Sure it all depends on the parameters of the smoothing, but a
>>> method that knew it was dealing with contours would constrain the
>>> surface such that points between contour lines were always between the
>>> contour line values.
>>>
>>> I think at least one of the algorithms in GRASS-GIS does this by
>>> "drawing" the contour lines on the raster and then doing a 'flood
>>> fill' operation between them.
>>>
>>> I'll have to dig out some GIS books...
>>
>> r.surf.contour in GRASS does what is required:
>>
>> http://grass.osgeo.org/grass64/manuals/html64_user/r.surf.contour.html
>>
>> gives its description; the input is a raster of the contours where the
>> non-missing cells take the contour elevation values. I have found that
>> spline interpolation can create artefacts, and geostatistical interpolation
>> (or IDW for obvious reasons) does not like many neighbouring data points
>> along a contour line.
>>
>> Roger
>>
>>>
>>> Barry
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>> --
>> Roger Bivand
>> Department of Economics, NHH Norwegian School of Economics,
>> Helleveien 30, N-5045 Bergen, Norway.
>> voice: +47 55 95 93 55; fax +47 55 95 95 43
>> e-mail: Roger.Bivand at nhh.no
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Scientist
Landcare Research, New Zealand



More information about the R-sig-Geo mailing list