Specifiying an orgin to generate grids with LAStools

113 views
Skip to first unread message

pafekety

unread,
Sep 15, 2015, 5:55:19 PM9/15/15
to LAStools - efficient tools for LiDAR processing
Hi LAStools user group:

I have been trying to generate LiDAR metrics so they spatially match another dataset. I am trying to use the switch that specifies the lower left corner, but LAStools is not using my coordinates.
This should be possible as indicated in the Blast2dem help file "
It is also possible to define the raster extend with setting
  '-ll min_x min_y' and '-ncols 512' and '-nrows 512'."

Am I misunderstanding the syntax? I have attached a small LAZ file and sample code that demonstrates the problem. I would like to be able to specify the lower left corner when using blast2dem and lascanopy.

Does anybody have any thoughts or suggestions?

Thanks,
patrick


:: Create a DTM
blast2dem -i pt000180.laz -o Elevation.asc -keep_class 2 -step 30 -ll -1522395 2708385 -v

::From ASCII file
::xllcorner -1522410.000000
::yllcorner 2708370.000000


::Shift lower left by 10 meters
blast2dem -i pt000180.laz -o ElevationPlus10.asc -keep_class 2 -step 30 -ll -1522385 2708395 -v

::From ASCII file
::xllcorner -1522410.000000
::yllcorner 2708370.000000
::NO CHANGE in lower left corner


::Same issue with lascanopy results when using lascanopy

::xllcorner -1522410.000000
::yllcorner 2708370.000000

pt000180.laz

Jan Rombouts

unread,
Sep 17, 2015, 1:06:33 AM9/17/15
to last...@googlegroups.com

Hi Patrick,

 

With lascanopy you have the option to use the “grid_ll” argument. Excerpt from lascanopy_README.txt:

 

“In order to shift the raster grid that the points are binned into away from the default alignment of (0/0) to (5/15) use '-grid_ll 5 15'.”

 

Regards,

 

Jan

pafekety

unread,
Sep 17, 2015, 4:24:53 PM9/17/15
to LAStools - efficient tools for LiDAR processing
Hi Jan,

Thanks for the reply.
Does using the 'grid_ll' switch mean that I have to run lastools twice? The first run would be to determine the default lower left coordinate coordinates, next I would calculate how far to shift the default lower left coordinates, and then I would need to re-run lastools using the '-grid_ll' switch.

Or is there an elegant solution that I am missing?

thanks,
patrick

pseudo code:

::run to determine the lower left coordinates
lascanopy -i *.laz -merged -avg -oasc -odir tempMetrics 

code to read the header in the output raster
code to determine distance the x- and y-values need to be shifted. For example say 5 meters in x-direction and 15 meters in y-direction

::rerun to produce metrics at specified lower left coordinates
lascanopy -i *.laz -merged -avg -oasc -odir finalMetrics  -grid_ll 5 15

Jan Rombouts

unread,
Sep 18, 2015, 4:17:31 AM9/18/15
to last...@googlegroups.com

Hi Patrick,

 

I think it is simpler than your pseudo code suggests. If you want to compare gridcell metrics of two (partially) overlapping datasets (which I understand your intent to be) then you must process both datasets with identical grid_ll and step coordinates. Alternatively you manipulate the grid_ll of the tested dataset to make the centroids of the grid cells coincide with those of the reference dataset (using the equations below and using the same -step of course) . 

 

I attach two example output files corresponding to two commands below.

 

C:\LASTOOLS\BIN\lascanopy -i test.laz -o test1.csv -step 10 -centroids -qav -grid_ll 0 0

C:\LASTOOLS\BIN\lascanopy -i test.laz -o test2.csv -step 10 -centroids -qav -grid_ll 2.5 2.5

 

See the effect of –grid_ll on the centroids of the cells. The centroid x and y are calculated as

 

                   grid_ll x + n* step + step/2

                   grid_ll y + m* step + step/2

 

where n, m  are whole numbers. The minimum and maximum n/m are determined by bounding box of your data.

 

This is only one of many different ways to skin this cat but I hope it helps.

 

Best

 

Jan

 

From: last...@googlegroups.com [mailto:last...@googlegroups.com] On Behalf Of pafekety


Sent: Friday, 18 September 2015 4:48 AM
To: LAStools - efficient tools for LiDAR processing

--

test2.csv
test1.csv

pafekety

unread,
Sep 23, 2015, 2:40:51 AM9/23/15
to LAStools - efficient tools for LiDAR processing

Hi Jan,

Yes, I agree that consistent processing of the lidar is a necessity.
I am currently working with both ALS and satellite data, and therefore my preference is generate lidar metrics that match the satellite data. My hope is to set the lower left corner of the lidar metrics such that it will match the satellite data lower left corner.

Lascanopy will allow the user to shift the lower left corner using the '-grid_ll', but since I don't know the coordinates that lastools will choose as the lower left, I don't know how far to shift the lower left corner. That is why I suggested running lastools twice.
Another issues is blast2dem and las2dem do not accept the 'grid_ll' switch, so a user could not use lastools to generate topographic metrics using a user-specified lower left corner.

I believe it would be beneficial to have LAStools internally calculate and apply the appropriate shift. For example the user would enter:
> lascanopy -i *.laz -merged -avg -odir .\CanopyMetrics -ll x_min y_min
LAStools would internally calculate the default lower left coordinates for the output rasters.
LAStools would check to see if the user specified x_min and y_min match the internal grid. If the values don't match, LAStools could calculate the difference and pass the values to -grid_ll.

If that is not a possibility, could the '-grid_ll' switch be added to las2dem & blast2dem?

Are there other lastools users who have thoughts on this matter?

patrick






On Tuesday, September 15, 2015 at 4:55:19 PM UTC-5, pafekety wrote:

Martin Isenburg

unread,
Sep 23, 2015, 2:57:36 PM9/23/15
to LAStools - efficient command line tools for LIDAR processing
Hello,

first I would like to dispell any notion that the -ll flags do not work:

las2dem -i ..\data\fusa.laz -hillshade -ll 277850.00 6122450.00 -o fusa_hill.png
blast2dem -i ..\data\fusa.laz -hillshade -ll 277850.00 6122450.00 -o fusa_hill1.png

las2dem -i ..\data\fusa.laz -hillshade -step 0.5 -ll 277850.00 6122450.00 -ncols 100 -nrows 100 -o fusa_hill2.png
blast2dem -i ..\data\fusa.laz -hillshade -step 0.5 -ll 277850.00 6122450.00 -ncols 100 -nrows 100 -o fusa_hill3.png

these commands behave exactly as expected. It is true that the '-grid_ll' switch only exists for lasgrid and lascanopy and not for las2dem and blast2dem ... mainly because las2dem and blast2dem are usually used for high resolution grids (e.g. a '-step' of 0.25, 0.5 or 1.0) so that a shift at the subpixel level has so far not been in anybody's workflow I suppose as noone requested that so far. What resolutions are you operating at?

For lascanopy and lasgrid the existing '-ll' and '-grid_ll' combo has proven to work well in many workflows so I see no need to change that.

Regards,

Martin

hgreaves

unread,
Sep 24, 2015, 12:50:25 PM9/24/15
to LAStools - efficient tools for LiDAR processing
Hi all,

For what it's worth, I had a similar issue earlier this year. I was trying to use the -ll flag in las2dem to place the corner of my 80 cm grids so that they aligned (within a centimeter or two) with small vegetation sampling plots, but las2dem would place the corner rather unpredictably.

Martin suggested using -translate_xyz as a workaround. This worked, but I did have to run las2dem twice: first I'd run las2dem with -ll to try to place the corner, then I'd check to see how far off it was (if at all), then I'd rerun las2dem with -ll and -translate_xyz to make the correction. Luckily I was working with very small grids, so the extra processing wasn't a problem for me.

...in case that helps anyone else...

Heather
Reply all
Reply to author
Forward
0 new messages