Can I generate contours from a hillshade using lasiso?

253 views
Skip to first unread message

Dwight Crouse

unread,
Jun 23, 2013, 4:18:59 PM6/23/13
to last...@googlegroups.com
Hi Martin,

I have a hillshade (tif format), DEMs (binary format) and lidar in (las and laz formats).  I need to generate contours and I would like to from the already created DEMs or hillshades but the documentation in the readme for lasiso does not include these formats from what I can see, is this possible?  An alternative is that I base the contour generation on the original las/laz files, which I can do and I have done for testing.  

The other question, is what's the best way for me to generate the contours given that I need to process 973, 2kmx2km tiles?  I could do each tile separately and join them but then I would be left with a bunch of cleaning up to perform on the tile edges.  If I attempt to group the lidar (using lasmerge) or DEM files (using blastDEM) what's a good grouping I should use before I run into memory issues?  . 

Thanks,

Dwight
    

Terje Mathisen

unread,
Jun 24, 2013, 4:08:35 AM6/24/13
to last...@googlegroups.com
Dwight Crouse wrote:
> Hi Martin,
>
> I have a hillshade (tif format), DEMs (binary format) and lidar in (las
> and laz formats). I need to generate contours and I would like to from
> the already created DEMs or hillshades but the documentation in the
> readme for lasiso does not include these formats from what I can see, is
> this possible? An alternative is that I base the contour generation on
> the original las/laz files, which I can do and I have done for testing.

A hillshade file is pretty much worthless: All the interesting/crucial
info for contour generation has been thrown away. :-(

Using either a DEM or (better) the original laz files is the way to go!
>
> The other question, is what's the best way for me to generate the
> contours given that I need to process 973, 2kmx2km tiles? I could do

OK, so almost 4000 sq km?

What sort of contour density do you need?

At which resolution?

> each tile separately and join them but then I would be left with a bunch
> of cleaning up to perform on the tile edges. If I attempt to group the
> lidar (using lasmerge) or DEM files (using blastDEM) what's a good
> grouping I should use before I run into memory issues? .

The only reasonable workflow here is to start with one of Martin's
sample batch files that start with lastile.exe:

lastile will merge the points and generate individual tiles at whatever
size you want (I use 250x250 m), including a buffer zone around each tile!

The buffer is crucial since it makes it possible to process all the
tiles in parallel while avoiding any kind of glitches around the tile
boundaries.

I have used this process to generate 25 cm (!) contours for an area that
covers nearly 300 sq km.

You might get into some problems with lastile though, if you try to
generate 10K+ tiles your computer might run out of file handles during
the tiling process.

Terje
>
> Thanks,
>
> Dwight
>
> --
> Download LAStools at
> http://lastools.org
> http://rapidlasso.com
> Be social with LAStools at
> http://facebook.com/LAStools
> http://twitter.com/LAStools
> http://linkedin.com/groups/LAStools-4408378
> Manage your settings at
> http://groups.google.com/group/lastools/subscribe
>
>


--
- <Terje.M...@tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Heidemann, Hans

unread,
Jun 24, 2013, 2:48:03 PM6/24/13
to last...@googlegroups.com
Let's not throw the baby out with the bathwater here.

Hillshades are NOT "pretty much worthless". 
Hillshades are extremely useful for a number of visualization applications.

They do not contain actual elevation information because they are a product, not a source data. So no, you cannot generate contours from them. 
Similarly, slope, aspect, flow direction, blah blah blah ...  none of these products contain elevation information either, but they are FAR from "worthless". Nothing has been "thrown away". It all still exists in the original data -- where it belongs. 

That's like looking at a thematically classified landcover image, derived from LandSAT, and complaining that all the valuable information has been discarded. No, you just have to go to the proper dataset to get that information.

tsk tsk ....


Karl

H. Karl Heidemann, GISP
Physical Scientist, Lidar Science
U.S. Geological Survey
Mundt Federal Building
47914 252nd Street
Sioux Falls, SD  57110

"Nothing matters very much, and very few things ... matter at all."
- Arthur James Balfour

Terje Mathisen

unread,
Jun 25, 2013, 4:45:08 AM6/25/13
to last...@googlegroups.com
Heidemann, Hans wrote:
> Let's not throw the baby out with the bathwater here.
>
> Hillshades are NOT "pretty much worthless".

Sorry, I must have been unclear. English is not my native language:

What I wrote was that in the context of contour generation, a hillshade
image is in fact worthless, and that it would be far better to start
with the raw LAS/LAZ point cloud or a pre-generated DEM.

> Hillshades are extremely useful for a number of visualization applications.
>
> They do not contain actual elevation information because they are a
> *product*, not a source data. So no, you cannot generate contours from
> them.
> Similarly, slope, aspect, flow direction, blah blah blah ... none of
> these *products* contain elevation information either, but they are FAR
> from "worthless". Nothing has been "thrown away". It all still exists in
> the original data -- where it belongs.
>
> That's like looking at a thematically classified landcover image,
> derived from LandSAT, and complaining that all the valuable information
> has been discarded. No, you just have to go to the proper dataset to get
> that information.
>
> tsk tsk ....

We're in violent agreement, I use pre-processed/filtered data (slope
files, vegetation classification, cliff faces) all the time when I'm
surveying orienteering maps.

Terje

>
>
> Karl
>
> *H. Karl Heidemann, GISP*
> /Physical Scientist, Lidar Science/
> U.S. Geological Survey
> Mundt Federal Building
> 47914 252nd Street
> Sioux Falls, SD 57110
> 605-594-2861
> kheid...@usgs.gov <mailto:kheid...@usgs.gov>
> /*
> */
> /*"Nothing matters very much, and very few things ... matter at all."*/
>
> /*- Arthur James Balfour*/
> http://linkedin.com/groups/__LAStools-4408378
> <http://linkedin.com/groups/LAStools-4408378>
> Manage your settings at
> http://groups.google.com/__group/lastools/subscribe
> <http://groups.google.com/group/lastools/subscribe>
>
>
>
>
> --
> - <Terje.M...@tmsw.no <mailto:Terje.M...@tmsw.no>>
> "almost all programming can be viewed as an exercise in caching"
>
>
> --
> Download LAStools at
> http://lastools.org
> http://rapidlasso.com
> Be social with LAStools at
> http://facebook.com/LAStools
> http://twitter.com/LAStools
> http://linkedin.com/groups/__LAStools-4408378
> <http://linkedin.com/groups/LAStools-4408378>
> Manage your settings at
> http://groups.google.com/__group/lastools/subscribe
> <http://groups.google.com/group/lastools/subscribe>

Heidemann, Hans

unread,
Jun 25, 2013, 9:54:49 AM6/25/13
to last...@googlegroups.com
Terje,

You are forgiven  [lol], and having read many of your other posts, I didn't really think you actually meant what it sounded like. 

I just wanted to make sure nobody else misinterpreted the statement as I initially did, without further clarification. There are many who read these messages who have less experience and might be led astray.

:-)





Karl

H. Karl Heidemann, GISP
Physical Scientist, Lidar Science
U.S. Geological Survey
Mundt Federal Building
47914 252nd Street
Sioux Falls, SD  57110

"Nothing matters very much, and very few things ... matter at all."
- Arthur James Balfour

Stoker, Jason

unread,
Jun 25, 2013, 12:48:57 PM6/25/13
to last...@googlegroups.com
Hi all- just a completely random thought:

Let's just say that someone had lidar, made a DEM and hillshade, and for some reason decided that they only needed the hillshade and threw everything else away.  Let's hope that there isn't anyone like this out there anymore :-)

If you had a georeferenced hillshade, knew the illumination angle, azimuth and z scale factor that were used to create it, couldn't you reverse engineer a DEM from it?  I would think you could solve for the unknown Z pixel based on a known illumination source and the orientation of the pixels' neighbors. If it was actually possible, I'm guessing the first iteration would only be relative heights per pixel- you'd need some ancillary elevations to tie the relative to absolute elevations. No one in their right mind would ever do this of course.  And even if it is possible, I have no idea what kinds of accuracy would be lost going backwards from an 8-bit hillshade to a DEM, (it would probably depend on slope) but I'm guessing it would be considerable.  But it seems like you could salvage some kind of DEM from just the hillshade?  And from that you could create some kind of contour map from that?  Granted there is probably something better out there already DEM-wise that you could fall back on than going through all of this.  This is more of a theoretical argument against the idea that the hillshade is "worthless" when it comes to elevation information. Seems like it should be theoretically possible, or am I missing something here? I obviously have not put a lot of thought into this ;-)


Jason

Ruben Valbuena

unread,
Jun 26, 2013, 5:47:41 AM6/26/13
to last...@googlegroups.com

My random though is that reversing a hillshade solution would have an ambiguous solution, and therefore not reliable.

 

Let’s think that a big hill shades a small one. In the backward process there is no way to know that small hill was there. Therefore, features shaded in a hillshade product cannot be retrieved back. And in general, it is never known what really happen in shaded areas. Thus: not entirely theoretically plausible.

Heidemann, Hans

unread,
Jun 25, 2013, 2:18:19 PM6/25/13
to last...@googlegroups.com
Theoretically, yes, it could be done.
BUT, since the hillshade is only 8-bit, I suspect the vertical resolution of the resulting DEM would be rather limited.
And you would also have to know whether any fill illumination was applied, and whether shadows were modeled, and  ...

I think it would only be worth the considerable effort it would require in the rarest of circumstances.. 


Karl

H. Karl Heidemann, GISP
Physical Scientist, Lidar Science
U.S. Geological Survey
Mundt Federal Building
47914 252nd Street
Sioux Falls, SD  57110

"Nothing matters very much, and very few things ... matter at all."
- Arthur James Balfour


Stoker, Jason

unread,
Jun 26, 2013, 9:39:41 AM6/26/13
to last...@googlegroups.com
I looked into it a bit more, and there has been plenty of research done on this problem for a while.  The term that is commonly used is called "shape from shading". Here is a book on it:


Jason M. Stoker
Physical Scientist
USGS Earth Resources Observation and Science (EROS)
47914 252nd St.
Sioux Falls, SD 57198
Office: 605-594-2579

Dwight Crouse

unread,
Jun 26, 2013, 10:45:23 AM6/26/13
to LAStools - efficient tools for LIDAR processing
Hi all,

Thanks for the wonderful advice.  I will base the contours off the DEM that was produced by the LiDAR providers as Terje and others have suggested.  

Cheers,

Dwight

  
DWIGHT CROUSE  |  Analysis Manager  |  Cochrane, AB, Canada
T: 403.241.9020  |  C: 403.836.9429  |  TFN: 1.866.698.8789 ext. 4

          
This email communication and any files transmitted with it may contain confidential and or proprietary information and is provided for the use of the intended recipient only. Any review, retransmission or dissemination of this information by anyone other than the intended recipient is prohibited. If you receive this email in error, please contact the sender and delete this communication and any copies immediately. Thank you.

Reply all
Reply to author
Forward
0 new messages