New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simplaz

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplaz

A simple Python package to read LAZ files (LAS too).

pipPyPI
Version
0.3.0
Maintainers
1

GitHub license PyPI version

simplaz

A Python package to read LAZ files (LAS too). Basically it's a wrapper around Rust las and it exposes the most useful methods.

It doesn't read in memory the whole file, so you can just iterate over each point sequentially without worrying about your RAM comsumption.

Only reading at this moment; writing is for later.

Installation

pip

To install the latest release: pip install simplaz

Development

  • install Rust (v1.39+)
  • install maturin
  • maturin develop
  • move to another folder, and import simplaz shouldn't return any error

Documentation

The pydoc can be found here.

Example

import simplaz
import numpy as np

ds = simplaz.read_file("/Users/hugo/data/ahn3/crop.laz")

header = ds.header
print("LAS v{}".format(header.version))
print("Point count: {}".format(header.number_of_points))

#-- using numpy functions
#-- define a specific numpy type
mypoint = np.dtype([('x','float64'), 
                    ('y', 'float64'), 
                    ('z', 'float64'), 
                    ('intensity', 'int16')]
                    ) 
pts = np.zeros((ds.header.number_of_points,), dtype=mypoint)

#-- iterate over all the points and store in numpy array only 
#-- the ground point (classification=2)
for (i, p) in enumerate(ds):
    if p.classification == 2:
        pts[i][0] = p.x
        pts[i][1] = p.y
        pts[i][2] = p.z
        pts[i][3] = p.classification
print (len(pts))

What is supported and what not?

Most of LAS v1.4 is supported, except:

  • v1.4 support for extra bits after each point

LAS classes

Classificationdescription
0Created, never classified
1Unclassfied
2Ground
3Low Vegetation
4Medium Vegetation
5High Vegetation
6Building
7Low Point (noise)
8Model Key-point (mass point)
9Water
10Reserved for ASPRS definition
11Reserved for ASPRS definition
12Overlap Points
13-31Reserved for ASPRS definition

LAS Point format

This is well explained on this page.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts