brycefrank / pyfor

Tools for analyzing aerial point clouds of forest data.
MIT License
93 stars 19 forks source link

Easier way to check units, useful for threshold in watershed #14

Open bw4sz opened 6 years ago

bw4sz commented 6 years ago

Hey bryce - this is looking really great! Amazing job. I just came back to it for a way to pass watershed clusters to my deep learning tree classifier (still in progress). One thing i noticed is that its not immediately easy to know the map units of the vertical dimension. It might be useful to have a summary method for the cloud object that prints some essentials.

Similar to

https://rdrr.io/cran/lidR/man/summary.LAS.html

That way I know what units to input to the threshold tolerance for watershed.

brycefrank commented 6 years ago

This should be straightforward, I will implement in 0.2.2 when I get the chance.

Thanks for the suggestion, Ben.

bw4sz commented 6 years ago

yup. Just letting you know, rasterio's planned update is going to break your code. I found it in pre release.

pip install --pre rasterio --upgrade

Has some kind of problem way deep in the code, looks like something with __gdal_version__ variable. I can't paste it, i've already downgraded. I had grabbed it because i was looking for a way to crop the CHM by the shapely geometry from your geopandas frame. I'm trying to avoid writing the chm to file (big arrays), which fits better with rasterio's current functionality. Soon you will be able to push numpy arrays directly to their file type.

https://rasterio.readthedocs.io/en/latest/topics/memory-files.html

brycefrank commented 6 years ago

Thanks for the tip, I will adjust the yaml file to maintain the old version once Travis CI fails.

I've been awaiting the memory files capability to show up. A good portion of pyfor can be reworked to use these if they are as performant as just using numpy arrays, and other portions can just be converted straight over. I may just be able to re-work the Raster class using memory-files, since most of that class is dedicated to danncing around rasterios past framework of "input raster / output raster" that made "internal" arrays like mine hard to handle.

I should have some time in the coming months to dedicate more toward this. Because it is more of a "side-grade" than a new feature (the rasterio stuff, I mean), I will likely implement in 0.3.0 so I have adequate time to test and develop before merging to master.

-Bryce

brycefrank commented 5 years ago

Ben,

Just an update - I am working on this (summary function) for 0.3.0. It is proving a bit tricky with different LAS specifications, but I think I can come up with something reasonable that attempts to parse CRS information from older acquisitions. The new version should be out sometime in the next month or two.

-Bryce