semvec/pypi-packages huggingface dataset:
pyxllib 4.33.2
code4101的python通用工具库
Requires Python: <3.13,>=3.6

# 1 安装

推荐使用uv环境管理工具，使用uv时，以下pip要改为"uv pip"
，更多uv工具使用技巧见：[uv环境管理工具](https://www.yuque.com/xlpr/pyxllib/uv)。

```shell
# 这样可以安装纯净版pyxllib源码，不附带任何其他三方库依赖。
# 在很清楚自己仅需要什么小功能组件，做简单任务，或者为了打包精简的exe时很有用。
pip install pyxllib

# 常规情况下建议使用basic版基础依赖，目前basic还不算很轻量，项目在不断迭代优化中。
pip install pyxllib[basic]

# 有需要再额外补充一些组件的写法，比如autogui是windows上ui自动化操作相关系列功能
pip install pyxllib[basic,autogui]

# 不怕重依赖，清楚自己在干什么的情况下，可以使用下述配置
pip install pyxllib[advance]
pip install pyxllib[full]
```

pyxllib支持的依赖分组情况，请直接看项目的pyproject.toml配置文件。

大家在使用中有发现依赖使用不流畅，不舒服，反人性的地方，欢迎狠狠来怼我。

# 2 文档

本库的完整介绍文档在语雀: https://www.yuque.com/xlpr/pyxllib
pointslicer 0.1.0
Python bindings for pointslicer - extract points from LAS/LAZ files using GeoPackage tile indices
Requires Python: >=3.8

# pointslicer Python Bindings

Python bindings for the `pointslicer` library, allowing you to extract points from LAS/LAZ files using GeoPackage tile indices.

## Installation

```bash
pip install pointslicer
```

Or from source:

```bash
pip install maturin
maturin develop
```

## Usage

```python
import pointslicer

# Create a bounding box geometry
bbox = pointslicer.BoundingBox(10000, 20000, 30000, 40000)

# Or create a cylinder geometry
cylinder = pointslicer.Cylinder(12345, 67890, 6.0)

# Extract points from tile index
stats = pointslicer.extract(
    index_path="tiles.gpkg",
    output_path="output.laz",
    geometry=bbox,
    verbose=True
)

print(f"Extracted {stats.points_written} points from {stats.tiles_processed} tiles")
print(f"Time: {stats.elapsed_time:.2f} seconds")
```

## API Reference

### `BoundingBox`

A 2D or 3D axis-aligned bounding box for point extraction.

```python
# 2D bounding box
bbox = pointslicer.BoundingBox(min_x, max_x, min_y, max_y)

# 3D bounding box  
bbox = pointslicer.BoundingBox(min_x, max_x, min_y, max_y, min_z, max_z)

# Convenience methods
bbox = pointslicer.BoundingBox.new_2d(min_x, max_x, min_y, max_y)
bbox = pointslicer.BoundingBox.new_3d(min_x, max_x, min_y, max_y, min_z, max_z)

# Check if a point is inside
bbox.contains(x, y)           # 2D check
bbox.contains(x, y, z)        # 3D check (only for 3D boxes)
```

### `Cylinder`

A vertical cylinder defined by center coordinates and radius.

```python
# From radius
cylinder = pointslicer.Cylinder(center_x, center_y, radius)

# From diameter
cylinder = pointslicer.Cylinder.from_diameter(center_x, center_y, diameter)

# Check if a point is inside
cylinder.contains(x, y, z)    # z is ignored for vertical cylinders
```

### `extract()`

Main function for extracting points.

```python
stats = pointslicer.extract(
    index_path="tiles.gpkg",      # Path to GeoPackage tile index
    output_path="output.laz",     # Output LAS/LAZ file
    geometry=bbox_or_cylinder,    # Extraction geometry
    verbose=False                 # Enable verbose logging
)
```

### `ExtractionStats`

Statistics returned by the extraction process.

```python
stats.tiles_processed    # Number of tiles processed
stats.points_read        # Total points read
stats.points_written     # Points that passed geometry filter
stats.elapsed_time       # Extraction time in seconds
```

## Requirements

- Python 3.8+
- GeoPackage tile index created by `pdal tindex`
- LAS/LAZ point cloud files

## License

GPL-3.0