lasgrid -i lake.laz -last_only -step 1 -counter -oxyz
python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> lake_count = np.loadtxt('lake.xyz',delimiter=',',usecols=(2,))
>>> lake_count.all()
True
lasgrid -i lake.laz -last_only -step 1 -counter -ocsv
ERROR: zero column pointer not supported by SRwriter_csv
ERROR: cannot open SRwriter_csv
ERROR: could not open srwriter
Hello,
You can use a grid format that supports “data voids” by the use of a nodata value (bil, tif, etc). After that, you can use a separate call to gdal_translate to remove the no data value assigned in the header by lasgrid. Alternately you can just count the number of nodata cells (in python/GIS/whatever) or manually edit the nodata value in the header if you use bil format.
> lasgrid -counter -last_only -i lake.laz -o lake_grid.bil
> gdal_translate -a_nodata none -of EHdr lake_grid.bil lake_grid_nodata.bil
> lasinfo -i lake_grid_nodata.bil -histo z 1
…
z coordinate histogram with bin size 1
bin 0 has 27878
bin 1 has 13250
bin 2 has 14512
bin 3 has 8536
bin 4 has 3145
bin 5 has 910
bin 6 has 323
bin 7 has 170
bin 8 has 89
bin 9 has 68
bin 10 has 51
bin 11 has 41
bin 12 has 30
bin 13 has 32
bin 14 has 15
bin 15 has 11
bin 16 has 8
bin 17 has 17
bin 18 has 5
bin 19 has 6
bin 20 has 7
bin 21 has 7
bin 22 has 1
bin 23 has 1
bin 24 has 2
bin 25 has 3
bin 26 has 2
bin 27 has 3
bin 28 has 3
bin 29 has 2
bin 30 has 1
bin 31 has 3
bin 33 has 1
bin 34 has 2
bin 35 has 2
bin 38 has 1
bin 39 has 2
bin 41 has 2
bin 44 has 1
bin 50 has 1
average z coordinate 1.35244 for 69144 element(s)
Cheers,
Mike
--
Download LAStools at
http://lastools.org
http://rapidlasso.com
Be social with LAStools at
http://facebook.com/LAStools
http://twitter.com/LAStools
http://linkedin.com/groups/LAStools-4408378
Manage your settings at
http://groups.google.com/group/lastools/subscribe