Comments (3)
I tried merging the laz into one file and then running lidar tile gridding.
I get a constant shift north west throughout the raster compared to lastools output
from whitebox-tools.
Hi,
As you have correctly suspected it's a matter of whitebox-tools performing sampling in the corner of the pixel, instead of the center like lastools does. In my personal opinion, this is a bug, and the behaviour of lastools is to be preferred. When displaying the DEM in QGIS we can see that generated raster differs from the position of the original las points.
This is especially visible on the raster corners (Picture 1):
Or when one interpolates at high enough resolution to see the mismatch between the TIN points and the underlying pointclouds (Picture 2):
I've managed to fix for this for my own purposes by sidestepping this behaviour (or maybe we can call it a bug). I forcibly shift the points by half-a-resolution-step before processing them with the LidarTINGridding tool. This gives me results identical to las2dem outputs, bar numerical instabilities. Here is the code that works on my data which uses EPSG:32648 CRS. I use lastools to perform this shift and set a right bounding box, but I hope to find a solution using other opensource tools. I don't think WBT itself has the functionality needed to set the bounding box directly.
# *** How to create DTM at 0.5 that match between lastools and White Box Tools ***
# Put the .LAS into tight borders that we want in the resulting GTIFF
las2las -i "C387014760.las" -o "C387014760_tight.las" -auto_reoffset
lasinfo -i "C387014760_tight.las" -set_bounding_box 387000.00 1476000.00 12.00 387500.00 1476500.00 36.00
# = Creating C387014760_LT.tif in lastools =
# Apply las2dem on this data, forcing high precision of elevation outputs to match WBT precision
las2dem -i "C387014760_tight.las" -keep_class 2 -step 0.5 -cpu64 -o "C387014760_LT.tif" -force_precision -float_precision 0.000001
# = Creating C387014760_WBT.tif in White Box Tools =
# Shift las points by half a resolution step
las2las -i "C387014760_tight.las" -o "C387014760_shifted.las" -translate_x -0.25 -translate_y +0.25
# Force the bounding box to match the previous tight box
lasinfo -i "C387014760_shifted.las" -set_bounding_box 387000.00 1476000.00 12.00 387500.00 1476500.00 36.00
# Apply WBT on shifted, tight data
whitebox_tools -v=true --compress_rasters=True --max_procs=32 --run=LidarTINGridding --input "C387014760_shifted.las" --parameter="elevation" --returns="all" --resolution=0.5 --exclude_cls="1" --max_triangle_edge_length=100.0 -o "C387014760_WBT.tif"
For the moment being I will use this trick to get proper TIN gridding with WBT
from whitebox-tools.
Thanks a lot for this. This works for me also.
However there is a very slight shift in the result on my end still due to the fact I have used a 0.5 step in lastools. (This ensures the edges between tiles are seemless.)
I am doing the transformation on the x and y in each as tile beforehand using laspy.
As my data is in feet and my required resolution is 3 so 1.5m shift. I am shifting:
las.x += -4.92126 # Shift on the x-axis
las.y += 4.92126 # Shift on the y-axis
To fix the step issue in the wb version. I round the XLLCORNER AND YLLCORNER. Eg:
NCOLS 2255
NROWS 844
XLLCORNER 804729.1
YLLCORNER 444923.72
CELLSIZE 3
NODATA_VALUE -32768.00
NCOLS 2255
NROWS 844
XLLCORNER 804729.0 #technically now XLLCENTER
YLLCORNER 444924.0 #technically now YLLCENTER
CELLSIZE 3
NODATA_VALUE -32768.00
Then I get perfect alignment:
Cheers Vlad
from whitebox-tools.
Related Issues (20)
- Compress raster default value incorrectly labelled? HOT 2
- Error reading LAZ file HOT 1
- Isochrone along direction map of watershed HOT 2
- ListUniqueValuesRaster HOT 3
- Wrong results of DirectDecorrelationStretch
- Bug with IndividualTreeDetection detecting trees very close together HOT 5
- ClipLidarToPolygon is modifying retained point data HOT 1
- Geomorphons - edge effects and difficulties in geographic coordinates
- WhiteboxWorkflows: kernel dies if file not found
- whitebox.Runner() urllib.error.URLError: <urlopen error unknown url type: https> HOT 1
- whitebox_tools 'Unrecognized tool name NormalizeLidar' HOT 16
- Whitebox-Worflows: Erroneous results when using raster files in NAD83 projection HOT 1
- lidar_digital_surface_model extent changed HOT 1
- Feature Requests: lidar_digital_surface_model HOT 2
- FlowAccumulationFullWorkflow gracefully exits without writing all 3 results
- documentation of PercentElevRange
- [feature request] add option to use D-infinity pointer grid in ElevationAboveStream
- "extract_by_attribute" tool missing from "whitebox_tools.py" (?) HOT 3
- TimeInDayLight - error when calculating local almanac
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whitebox-tools.