I need to recieve the number of points that .las file has from Python and save it as variable. For now I'm doing it like this:
def execute(self, pipeline):
pipeline = pdal.Pipeline(json.dumps(pipeline))
pipeline.validate()
self.points_num += int(pipeline.execute())
def points(self, file):
pipeline = [
file,
{
"type": "filters.info",
}
]
self.execute(pipeline)
However when file is big (above 2Gb) the procedure takes up to 4 minutes. Is there a smarter way to get number of points?
laspy
package? Then you can read your LAS file, and then get the number of points withlen(your_las_file.read().points)
-info
, and after that you canlen(dict.items())
.