Coder Social home page Coder Social logo

Comments (5)

giswqs avatar giswqs commented on June 16, 2024 1

@GeospatialPython Thanks for reporting the issue! I just tested the LidarElevationSlice tool using a sample LiDAR dataset (St. Elis Mountains and Gulf of Alaska) and I can confirm that the tool seems to export the entire file, not a slice. I am copying Dr. John Lindsay (@jblindsay) on this issue to see if he can look into the source code and fix the issue. Thanks!

from whitebox-python.

jblindsay avatar jblindsay commented on June 16, 2024

I've set the tool up so that if you set the --inclassval or --outclassval, the tool works in classify mode rather than filter mode, i.e. it assigns the specified class values to points inside and outside the slice. The problem is that I've given default values to these parameters and so, in the Python WhiteboxTools interface, even if you don't mess with these parameters, the tool will classify the points.

For now, I'd suggest setting these parameters to None; the tool should work as expected when this is done. That is,

import whitebox
wbt = whitebox.WhiteboxTools()
wbt.set_working_dir(os.getcwd())
wbt.lidar_elevation_slice("test1.las", "test2.las", minz=3.0, maxz=5.0, cls=False, inclassval=None, outclassval=None)

I've just committed a change to the tool such that the only way that it runs in classify mode is when the --class parameter is set to True. This fix is available in the repository now and will be in v0.14.

from whitebox-python.

GeospatialPython avatar GeospatialPython commented on June 16, 2024

Thank you for the info. I'll try the repository version. I could see in the output that it was populating the class values with defaults so I instinctively tried the None approach. I just tried it again. The None values are still passed as strings to the binary so you get the following error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
0

I've set the tool up so that if you set the --inclassval or --outclassval, the tool works in classify mode rather than filter mode, i.e. it assigns the specified class values to points inside and outside the slice. The problem is that I've given default values to these parameters and so, in the Python WhiteboxTools interface, even if you don't mess with these parameters, the tool will classify the points.

For now, I'd suggest setting these parameters to None; the tool should work as expected when this is done. That is,

import whitebox
wbt = whitebox.WhiteboxTools()
wbt.set_working_dir(os.getcwd())
wbt.lidar_elevation_slice("test1.las", "test2.las", minz=3.0, maxz=5.0, cls=False, inclassval=None, outclassval=None)

I've just committed a change to the tool such that the only way that it runs in classify mode is when the --class parameter is set to True. This fix is available in the repository now and will be in v0.14.

from whitebox-python.

giswqs avatar giswqs commented on June 16, 2024

@GeospatialPython The latest WhiteboxTools v0.14.0 has fixed the issue. Could you try again and let us know if you still have issues with the tool?

Make sure you upgrade to whitebox v0.7.0: pip install -U whitebox

import whitebox
wbt = whitebox.WhiteboxTools()
wbt.set_working_dir(os.getcwd())
wbt.lidar_elevation_slice("test1.las", "test2.las", minz=3.0, maxz=5.0, cls=False)

from whitebox-python.

giswqs avatar giswqs commented on June 16, 2024

I believe this issue has been resolved in the latest version. Therefore, I am closing the issue. Please reopen the issue if you still encounter issues.

from whitebox-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.