Jump to content

 
Photo

How do I create a DEM from contour lines?

- - - - -

  • Please log in to reply
29 replies to this topic

#16
Clark Geomatics

Clark Geomatics

    Jeff Clark

  • Validated Member
  • PipPipPipPip
  • 105 posts
  • Gender:Male
  • Location:North Vancouver, BC
  • Canada

With Manifold, the incremental costs are always worth it - you get so much bang for your $. Remember to go for a 64-bit OS if you are a serious Manifold user, the results are worth it. As per Charles' reply, Manifold's implementation of the DEST algorithm will give you the best results when creating DEMs from elevation isolines.


So how is Manifold's speed at producing DEMs? In the personal edition it can take from an hour and and half to more, depending on the parameters set, to produce at 1200 x 1200 dpi DEM.


Did you mean a 1200x1200 pixel raster? Shouldn't take long at all - it's a small grid.
Cheers,

Jeff Clark
Principal
www.clarkgeomatics.ca

#17
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 749 posts
  • Gender:Male
  • Location:Canada
  • Canada

The sample I shown you was with 32 bit at 5 metre contours; it took 2.5 minutes. If you have a NVIDIA CUDA 8100 or newer graphics chip it would have taken seconds.

Ok, so that's impressive.

#18
mika

mika

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 120 posts
  • Gender:Male
  • Location:Warsaw
  • Poland

Manifold won't be that quick... At least not 8.12 x64 using quad core, 8gb ram and gtx 260. And that's because it does not yet use cuda for interpolation

A very good choice in manifold is flat triangulation and doeas nearly as well as DEST. Nearly as there are differences mainly at peaks and valleeys. It is much quicker though.
A very good test is to generate quite dense contour lines from dem (I used srtm 3 and contours generated at 10m interval).
Flat triangulation of dem of 2500 x 2500 at 3'' took under a minute. I had to cancel DEST after 20 minutes. It would finish interpolation eventualy but I had no patience to wait - after many tests in the past I found out that DEST seems to be best when the data are simplified and normalised prior to interpolation. DEST will then perform quickly and there won't be a big difference between dem flat triangulated from source counturs and dem interpolated using DEST from simplified data.

[Update]
If you're interested, here: http://forest.miiz.w...mp/testdest.rar is a test file. It containnes 3 drawings:
1st has the contours generated from srtm3 - flat interpolation instant, dest takes long time, both with pixel size 3''
2nd has the same contour lines but the topology was normalised (it took roughly 30 mins to do so) - once again flat interpolation is instant and dest takes long time, both with pixel size 3''
3rd has the normalised contour lines simplified at 1'' - here dest is instant, pixel size 3''

When compared, results of a flat interpolation using the source lines are very similar to dest interpolated dem from simplified lines. Dest handles peaks and valeys better so that's a good place to compare the output.
maps made easy - www.cartomatic.pl

#19
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 749 posts
  • Gender:Male
  • Location:Canada
  • Canada

So I'm getting a couple of different messages here . . . . let me show you what I've done using Manifold personal edition. I've clipped a set of contours (shapefile attached). The scale of the contours is 1:50,000. I am trying to generate a DEM appropriate for a similar scale.

So, I've tried generating a DEM by first generating points from the contours, then pasting the points as a surface, using kriging (the only option available) and playing around with the other parameters. Most seem to come out something like this:
Attached File  Points_exponential.jpg   203.51KB   75 downloads
This took about 1 1/2 hours to produce. I also tried using Voronoi neighbours with not much more success. This is what I got:
Attached File  Points_4.jpg   74.52KB   71 downloads
This I had to let run overnight. I suspect it took about 6 hours.

This DEM is freely available and doesn't require any processing:
Attached File  base_dem.jpg   53.73KB   67 downloads
but as you can see, there are some issues with the content and the resolution is just not sharp enough.

Obviously, neither option is a viable solution since I need a better quality DEM (300 dpi at 1:50,000, appropriate for printing). The processing time is far too long anyway since the area I'm looking at for processing runs to about 2 degrees x 1 degree.

So my question is: first off, can I generate the DEM at the quality that I want using 1:50,000 contours (i.e. better than what I've done)? Secondly, what is the best and quickest way of doing this in Manifold (personal or professional edition)?

Attached Files



#20
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,890 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I've taken the liberty of running them through the terrain gridder in VNS, with this result:
Attached File  VNSLastRender.png   270.68KB   68 downloads

As you can see, the quality is better than your first sample, comparable to your second.

Now, I assume the processing times you mention are for the full dataset, correct? ('cause this took only half a second to grid in VNS).

One thing I'd like to point out is that vertical exaggeration is a great way of making the shading look more dramatic. It also highlights the fact you have a relatvely low-res DEM. One thing you could try is render without vertical exaggeration and then later spice up the image in Photoshop.

Hope this helps...
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#21
mika

mika

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 120 posts
  • Gender:Male
  • Location:Warsaw
  • Poland

i also used your data and here are the results:
DEST interpolation:
Attached File  DEST.jpg   190.79KB   78 downloads
Dem Downsampled 4 times, blurred significanlty and upsamled 4 times:
Attached File  DEST_Blurred.jpg   91.71KB   79 downloads

And that's my usual approach to have a nice 'cartographic' dem. The other thing is that you don't always have to make a dem that will be 300 dpi or more - you can export a high res bitmap from manifold. It is easier to blur a relatively low res dem, say 10m+
[edit] in other words don't create an overaccurate dem; simply export a high res bitmap using low res dem. this helps smoothing the data a bit
maps made easy - www.cartomatic.pl

#22
Charles Syrett

Charles Syrett

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 537 posts
  • Canada

To really see the difference between flat triangulation and DEST, have a look at contours generated from the resulting surfaces. I took the contours and pasted them as surface in Manifold, first as flat, then as DEST, then as Krige. Below you can see the results, including contours. Even in the shaded relief, you can see all kinds of ugly artifacts in the Flat that don't appear in the DEST. And Kriging -- which wasn't designed for mapping, but for statistics -- gives you a fuzzy terraced mess.

In the contours, you can see that Flat truncates some of the valleys, and that Kriging dreams up all kinds of funny little details. This is a very lo-res rendering, but in past experimentation I've always found that for generating new contours from old, DEST is best (except, of course, for good old do-it-by-hand interpolation using raw human intuition and lateral thinking). B)

For good discussions on DEST, see the Manifold Forum.

Charles Syrett
Map Graphics
http://www.mapgraphics.com

Attached Files

  • Attached File  Flat.png   112.23KB   76 downloads
  • Attached File  DEST.png   114.09KB   79 downloads
  • Attached File  Krige.png   136.63KB   71 downloads


#23
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 749 posts
  • Gender:Male
  • Location:Canada
  • Canada

Charles - I'm not sure which image represents which process . . . .

Charles & mika -

You're both using the DEST algorithm but seemingly following different processes . . . if DEST gave Charles a good result, why, mika, are you downsampling and upsampling? Are there different parameters being set?

#24
Charles Syrett

Charles Syrett

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 537 posts
  • Canada

Left, "Flat"; middle, "DEST", right, "Krige".

My guess is that Mika is playing with the shaded relief image to improve its appearance. This can be done any number of ways, and to achieve any number of different effects, depending what role the image will play in the final map. I almost always do this myself (Photoshop is usually my weapon of choice), and I love it -- so much faster than the old days of airbrushes and paints! B)

My experiment was more sheer comparison of the different surfaces created from the same contour set, using different algorithms. Again, apart from the human brain and eye, DEST is best, and definitely faster than human. However, automatically generated contours are even more direly in need of post-edit, even when generated by DEST.

Charles Syrett
Map Graphics
http://www.mapgraphics.com

Charles - I'm not sure which image represents which process . . . .

Charles & mika -

You're both using the DEST algorithm but seemingly following different processes . . . if DEST gave Charles a good result, why, mika, are you downsampling and upsampling? Are there different parameters being set?



#25
mika

mika

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 120 posts
  • Gender:Male
  • Location:Warsaw
  • Poland

Charles is right - I was playing with the dem to make it looking better when used for sheded relief. And actually my previous posts here were about preparing dem for shaded relief. If i was to end up with interpolated contour lines dest would be my choice anyway :-)
maps made easy - www.cartomatic.pl

#26
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 749 posts
  • Gender:Male
  • Location:Canada
  • Canada

Thanks for the advice. I'll look into gets Manifold Professional just so I can do this. By the way, my processing times that I was referring to earlier was for just the sample. Yes, obviously a little slow. i don't think it is the computer. I'm running a duo core @ 1.86 MHz with 4 GB RAM. I hope that the different processing you are suggesting will be much faster.

#27
mika

mika

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 120 posts
  • Gender:Male
  • Location:Warsaw
  • Poland

1.5 h only for the sample? Wow...
perhaps changing the interpolation method will save you some time. DEST interpolation of the sample took under a second on my box... It was a couple of minutes for the standard krigging. Both with pixel size 2.5m
maps made easy - www.cartomatic.pl

#28
ctmaps

ctmaps

    Newbie

  • New Member
  • Pip
  • 1 posts
  • No Country Selected

If you have access to Edit Tools, you can convert the contour lines to points - the tool extracts the vertices and nodes to a point shapefile. Once there you should be able to use those points to create a tin from or interpolate a new surface.

#29
Covasnianu Adrian

Covasnianu Adrian

    Contributor

  • Validated Member
  • PipPip
  • 48 posts
  • Gender:Male
  • Location:Iasi
  • Romania

Hi!

You can use also topo 2 raster (ArcToolBox) from ESRI ArcView (need Spatial Analyst extension).

It levels and eliminates the terraces effect and tweaks a little bit the "brute" TIN.


Sincerely,
Adrian
GIS user

PhD geographer
CUGUAT-TIGRIS Research Center
University Al.I.Cuza Ia┼či
Faculty of Geography & Geology

email: covasnianu.adrian@gmail.com

#30
Sharim

Sharim

    Newbie

  • New Member
  • Pip
  • 1 posts
  • No Country Selected

Hi!

You can use also topo 2 raster (ArcToolBox) from ESRI ArcView (need Spatial Analyst extension).

It levels and eliminates the terraces effect and tweaks a little bit the "brute" TIN.


Sincerely,
Adrian


Hi Adrian
Can You explain a little more ?

Tanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->