Giter VIP home page Giter VIP logo

digital-forestry-toolbox's Introduction

Digital-Forestry-Toolbox

The Digital Forestry Toolbox (DFT) is collection of tools and tutorials for Matlab/Octave designed to help process and analyze remote sensing data related to forests.

Documentation

Please check the Digital-Forestry-Toolbox website.

License

  • Unless otherwise stated in the file, the code is licensed under GNU GPL V3.
  • The airborne laser scanning datasets are a courtesy of the States of Solothurn, Zürich and Geneva (Switzerland).

Reference

The Digital Forestry Toolbox was developed by Matthew Parkan (GIS Research Laboratory, EPFL) with support from the Swiss Forest and Wood Research Fund (project 2013.18).

If you use this code in your work, please consider including the following citation:

Matthew Parkan. (2018). Digital Forestry Toolbox for Matlab/Octave. DOI: 10.5281/zenodo.1213013. Available: http://mparkan.github.io/Digital-Forestry-Toolbox/.

DOI

digital-forestry-toolbox's People

Contributors

mparkan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

digital-forestry-toolbox's Issues

LAS 1.4 files with a PDRF > 6 do not conform to the ASPRS LAS Format

According the the LAS 1.4 Format R15, to maintain legacy compatibility, the header fields Legacy Number of Point Records & Legacy Number of Points by Return should contain the total number of point records and an array of point records per return if the Point Data Record Format is less than 6. These fields should be zero if greater than 6.

The check in line 2172 in LASWrite.m does not consider the PDRF and sets these header fields to zero if the LAS version is 1.4. This condition can be modified from:

if las_version < 14

to:

if arg.Results.recordFormat < 6

as both LAS 1.2 and 1.3 versions do not have record formats greater than 6.

treemetrics

Hi. I am doing Tutorial 2. But it gives me this error:

Expected one output from a curly brace or dot indexing expression, but there were 12267 results.

Error in treeMetrics (line 1276)
metrics.ConcaveHull3D{k,1} = nan;

Error in dft_tutorial_2 (line 191)
metrics_3d = treeMetrics(label_3d, ...

Extended fields wrongly read

Thank you very much for sharing this useful toolbox.

I am using the LASread.m script to read the following point cloud: point_cloud_to_test_LASread.zip. The code read all fields correctly unless the extended fields. For instance, opening the point cloud with CloudCompare the “Range” field have values from 0.85 m to 5 m. However, the “Range” values read with the LASread.m script ranges from 4.6059e+18 to 4.6173e+18. The same happen with other extended fields: “FrameIndex” and “Azimuth”.
Do you have any idea how can I fix this issue?

Thank you in advance.
Best regards,
Jordi

Lastread problem with extrabytes

Hello

I am trying to use the Digital-Forestry-Toolbox tool, it is very well done.
I have already tried some functions, lasread and laswrite I find them very interesting.
Unfortunately I'm having problems loading a las with extra bytes created with Cloudcompare, I should first load them, then I should perform some calculations on the field "New Extra (P01)" in Matlab and then use Laswrite to write the las again.
Can you help me ?

Currently Matlab gives me this error:

WARNING: The point data record contains an extra 4 byte field: "new_extra_p01"
reading point data record...
Error using bitshift
Invalid data type. First and second arguments must be integer or double.

Error in LASread (line 2229)
bytes(:,k) = bitshift(cast(blob(ind_start: step : ind_end), r.record(j).type{:}),
nbitshift);

Thanks
Stefano from Italy

PS Sorry for my English I use deepl for a better translation
PPS I attach the point cloud that gives me this error

tree_1a.zip

Incorrect type for Return Point Waveform Location

Hey @mparkan,
Thanks for fixing those other issues! Found another issue with LASWrite -the Return Point Waveform Location is being written as an incorrect type, currently is uint32, but should be a floating point single - same as the parametric dX/dY/dZ's.

Changing lines 1642-1643 from

r.record(k).type = {'uint32', 'uint32', 'uint32', 'uint32'};
r.record(k).storage_type = {'uint32', 'uint32', 'uint32', 'uint32'};

to

r.record(k).type = {'single', 'single', 'single', 'single'};
r.record(k).storage_type = {'single', 'single', 'single', 'single'};

solves this issue for me.

Cheers.

ASCread error - Vertical dimension mismatch

Hello,

I am running Octave version 4.4.1 x86_64-w64-mingw32.
I have a problem with reading ASC file. I get an error related to ASCRead.m

error: vertical dimensions mismatch (2x1 vs 0x2)
error: called from
    ASCread at line 84 column 8

Here's my script:

addpath(genpath('D:\Octave-4.4.1\DFT\'))

clc
clear
close all

OCTAVE_FLAG = (exist('OCTAVE_VERSION', 'builtin') ~= 0); % determine if system is Matlab or GNU Octave

if OCTAVE_FLAG
    
    pkg load statistics
    pkg load image
    pkg load io
    pkg load mapping
    more off
    
end

[chm, refmat] = ASCread('E:\chmASC.asc')

My ASC file is zipped in the attachment.
OCTAVE.zip

Thank you!
Jakub

Error: 'fspecial' & bwdist for CHM Exercice 2

Error: 'fspecial' & bwdist for CHM Exercice 2
Hello ,
I am currently experimenting with your work on LIDAR data for an urban planning agency. The tutorial is well done. I finished exercise 1, but I am a beginner, I encounter an error for the generation of CHM of exercise 2. I do not have Matlat but I work with Octave.

error: 'fspecial' undefined near line 9 column 24 error: 'bwdist' undefined near line 174 column 12
Thank

Error in LASread (line 76)

Hello,I am using matlab2017b to run dft_tutorial_1.m and I get the following error.There was no problem two weeks ago, and this problem occurred after running today.
Error using fseek
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in LASread (line 76)
fseek(fid, 0, 'eof');
Error in dft_tutorial_1 (line 38)
pc = LASread('zh_2014_a.las');
Can you tell me how to reject this problem? Thank you.

dft_tutorial_2.m: Tutorial dataset works okay, but replacing it with my own produces: Unrecognized function or variable 'marker'.

I'm able to run the dft_tutorial_2.m okay by using the example dataset (available at website).
But when I replace the example dataset path with path to my own .las, then the height model looks a bit odd and
also it runs into the following error:

detecting peaks...done!
filtering low peaks...done!
computing watershed transform...Unrecognized function or variable 'marker'.

Error in treeWatershed (line 141)
label(~ismember(label, label(marker))) = 0;

Error in dft_tutorial_2 (line 96)
[label_2d, colors] = treeWatershed(models.height.values, ...

How must my input .las be produced to work with the tutorial's code parts?

Hint:

I know that my point cloud contains "scan lines", i.e. small "no data" lines between lines of data. Maybe this causes the problem?

But I wonder how to get around it? I can e.g. produce a scan line filled chm elsewhere, but then I would need the Digital Forestry Toolbox code to work directly on a chm.png, rather than the equivalent .las? Is this possible?

Can I e.g. produce a refmat in order to not have to use elevationModels() at all? But use canopyPeaks() directly on a chm (GeoTiff) produced elsewhere?

error reading LAS file

Hi,
When reading a LAS file containing an extra scalar field, of type unsigned char (type 1), using the function LASread, I got the error message:
"Error using zeros
CLASSNAME input must be a valid numeric or logical class name."

In the file LASread.m, I had to replace line 1645:
r.extra_bytes(k).type = 'uchar'
by
r.extra_bytes(k).type = 'uint8';

as the string 'uchar' is not recognized by the Matlab function zeros.

LASWrite requires Statistics and Machine Learning Toolbox

When running LASWrite.m, it throws an error on line 2116 if the Statistics and Machine Learning is not installed.

Add a check for that toolbox and if it doesn't exist, use an alternate method to determine the equal lengths of the point data records:

if license('test','statistics_toolbox')
    if ~(range(n_records_per_attribute) == 0)
        error('LASwrite:unequalRecordLengths', 'The lengths of point data records are unequal');
    end
else
    if ~(max(n_records_per_attribute)-min(n_records_per_attribute) == 0)
        error('LASwrite:unequalRecordLengths', 'The lengths of point data records are unequal');
    end
end

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.