crossing contour lines after las2iso

132 views
Skip to first unread message

Tobias K Kohoutek

unread,
Jul 11, 2016, 1:49:38 PM7/11/16
to LAStools - efficient tools for LiDAR processing
Hi everybody,

while using las2iso we encountered a problem with crossing contour lines after generating contour lines every meter. Any idea where this can come from?
I had the idea that there are maybe not enough points in certain areas of steep terrain but it wouldn't be really logical. We also figured that the crossing
contour lines aren't limied to a specific area. In fact they are spread over the whole area.

Any hint, idea or help is appreciated.

Cheers from Chile,
Tobias


Kirk Waters - NOAA Federal

unread,
Jul 11, 2016, 2:34:11 PM7/11/16
to LAStools - efficient command line tools for LIDAR processing
Tobias,
Can you verify that the lines are truly crossing and not simply touching? Visually they may look like they cross in the same way an X could be two lines crossing or it could be a V and an upside down V touching at a point. I'm assuming you checked for that, but we can't tell in the picture.

Thanks,
Kirk

Kirk Waters, PhD                     | NOAA Office for Coastal Management
Applied Sciences Program      | 2234 South Hobson Ave
843-740-1227                          | Charleston, SC 29405    

Terje Mathisen

unread,
Jul 11, 2016, 4:45:14 PM7/11/16
to last...@googlegroups.com
As Kirk wrote, an actual cross should be impossible:

LAStools contour generation is actually quite simple: Start by
generating a TIN, i.e. a set of tringles covering the entire area, this
results in a single-connected surface with no vertical overlap possible.
I.e. you cannot have a ground plane above another ground plane.

For each of the the triangles in the TIN, calculate line segments for
each contour height that falls between the top and the bottom of that
triangle.

Finally, join together all line segments with identical (x,y,z)
coordinates at one of their ends.

You can easily get close to vertical TIN segments, leading to
effectively overlapping contour segments, but never an actual cross.

OTOH, if you first generate contours, then perform some kind of low-pass
filtering/smoothing on each contour individually, then it is in fact
possible to generate such crossings.

This is the main reason that contour smooting should happen in the form
of surface smooting (i.e. low-pass filter the actual ground points
before TIN generation) instead of line smoothing.

Terje

'Tobias K Kohoutek' via LAStools - efficient tools for LiDAR processing
wrote:
> <https://lh3.googleusercontent.com/-wK0TZfDfreM/V4O40b_ujxI/AAAAAAAANqY/uARGZdYTLjAr3nQ_vIx30OlbjYrv2ObUQCLcB/s1600/las2iso_problem.png>
--
- <Terje.M...@tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Tobias K Kohoutek

unread,
Jul 12, 2016, 9:48:17 AM7/12/16
to LAStools - efficient tools for LiDAR processing, terje.m...@tmsw.no
Hi Kirk, hi Terje,

Am Montag, 11. Juli 2016 16:45:14 UTC-4 schrieb Terje Mathisen:
As Kirk wrote, an actual cross should be impossible:

I know it should be impossible of contour lines to cross, but yes we checked the single lines and they do cross. I'll upload the resulting shape file and *laz files so you can check yourself (drive).

My code to generate the lines out of the classified point cloud looks like this:

blast2iso -i %INPUT_FILES%\*.las -merged ^
         
-keep_class 2 -iso_every 1 ^
         
-smooth 2 -simplify_length 1 -simplify_area 1 -clean 5 ^
         
-o %OUTPUT_FILES%\ISO\CN_1m.shp


If you can find any error here please let me know. And as I wrote in the first post, it's not only limited to one area, it appears well distributed over the whole project area.


Konstantin Lisitsyn

unread,
Jul 12, 2016, 4:51:14 PM7/12/16
to last...@googlegroups.com
Hello Tobias,

>> "-smooth 2 -simplify_length 1 -simplify_area 1

It seems that it's contour line simplification and/or smoothing that leads to contour lines to cross in that high gradient area.

--
Konstantin

batt...@eaglemapping.com

unread,
Jul 12, 2016, 4:52:20 PM7/12/16
to LAStools - efficient tools for LiDAR processing
Hi Tobias,

We have found that the -smooth, -clean, -simplify modifiers can cause crossing contours. Can you try running this dataset again without these settings and see if you still end up with crossing lines? 

The contours are created initially with no simplification, and then vertices are removed based on the entered parameters. In areas with tight relief this could very easily cause crossing contours, as the extra vertices are required to ensure contours do not cross.
We have found that generating contours from the DEM helps remove some of the noise, but obviously this is not ideal in all situations.

Cheers,
Bryan

Terje Mathisen

unread,
Jul 12, 2016, 4:52:47 PM7/12/16
to Tobias K Kohoutek, LAStools - efficient tools for LiDAR processing
Tobias K Kohoutek wrote:
> Hi Kirk, hi Terje,
>
> Am Montag, 11. Juli 2016 16:45:14 UTC-4 schrieb Terje Mathisen:
>
> As Kirk wrote, an actual cross should be impossible:
>
>
> I know it should be impossible of contour lines to cross, but yes we
> checked the single lines and they do cross. I'll upload the resulting
> shape file and *laz files so you can check yourself (drive
> <https://drive.google.com/folderview?id=0B3KmRGoZgeLbRHNHX1dXb1praGM&usp=sharing>).
>
> My code to generate the lines out of the classified point cloud looks
> like this:

The problem is exactly as I stated, i.e. you are smooting the generated
contour lines instead of smoothing the input ground points.

You could argue that this is a bug/limitation in the blast2iso/las2iso
LAStools programs, and I would be willing to agree with that. :-)

Due to this I never use any form of contour smooting when using las2iso
to generate raw base map contours, intended to be used for surveying only.

Terje
>
> |
> blast2iso -i %INPUT_FILES%\*.las -merged ^
> -keep_class 2-iso_every 1^
> -smooth 2-simplify_length 1-simplify_area 1-clean 5^
> -o %OUTPUT_FILES%\ISO\CN_1m.shp
> |
>
>
> If you can find any error here please let me know. And as I wrote in
> the first post, it's not only limited to one area, it appears well
> distributed over the whole project area.
>
> <https://lh3.googleusercontent.com/-BUgCmxIHvko/V4TwjYIAdrI/AAAAAAAANq0/zbvlrMV4kSw1_3i3-i6c8T7b0uDnBdIdQCLcB/s1600/las2iso_problem_2.PNG>

Tobi

unread,
Jul 12, 2016, 4:53:01 PM7/12/16
to Terje Mathisen, LAStools - efficient tools for LiDAR processing
Hi Terje,

thanks a lot for this! So I'll deselect the '-smooth' parameter and run again.

Cheers from Chile,
Tobias

Tobias K Kohoutek

unread,
Jul 12, 2016, 5:36:20 PM7/12/16
to LAStools - efficient tools for LiDAR processing
Hey Bryan and Konstantin,

as Terje pointed out before you guys are also right. It's not only the '-smooth' parameter but also '-clean' and '-simplify'. I left for a try only '-clean 5' activated because in my mind it was the least logical setting that should influence crossing lines, probably because I was thinking already in the vector data and not like Terje explained before still in TIN data. However, there are a lot less crossings but still I found them (or at least the connection of contour lines) like the image shows.
So thanks to everybody and I'll implement for now the contour line extraction via GlobalMapper scripting from the DTM (which also won't be perfect due to the incorrect interpolation of ASCII tiles from blast2dem/last2dem at their borders).

Cheers,
Tobias

Martin Isenburg

unread,
Jul 20, 2016, 6:29:59 AM7/20/16
to LAStools - efficient command line tools for LIDAR processing
Hello,

to guarantee non-crossing iso-contours the '-simplify' (or '-simplify_length) and the '-simplify_area' parameters should not be used (or set to zero). This is because those two options directly try to simplify the contours (independently) which can lead to crossing. I should point this out in the README file. The '-smooth' option operates on the TIN before contouring, hence is safe. And the '-clean' option removes entire contours that are too short. 


One of the best ways to get nicer (smoother) contours is to *thin* the points before contouring. There is a new '-contours 1.0' option in lasthin that keeps only those points far away from the target 1 meter contour lines to lower the likelyhood of "wiggles". 


Apparently it works well because David Brubacher (whose suggestions I have yet to address) was really happy about the results:

https://groups.google.com/d/topic/lastools/f5VDjrVnPEc/discussion

Regards,

Martin @rapidlasso


Reply all
Reply to author
Forward
0 new messages