I/O — Raster & Point Cloud¶
COG (Cloud-Optimized GeoTIFF)¶
Read raster tiles locally or stream windows directly from S3/HTTPS
using GDAL virtual filesystems (/vsicurl/, /vsis3/).
cog
¶
COG read operations via rasterio with /vsicurl/ and /vsis3/ support.
Supports windowed reads by bounding box with automatic CRS reprojection so users can pass EPSG:4326 bboxes against EPSG:3089 data.
read_cog(source, bbox=None, crs=None)
¶
Read a COG, optionally windowed to a bbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str or Path
|
Local path, S3 URI, or HTTPS URL to a Cloud-Optimized GeoTIFF. |
required |
bbox
|
tuple
|
Bounding box (xmin, ymin, xmax, ymax) for windowed read. |
None
|
crs
|
str
|
CRS of the bbox. Defaults to EPSG:4326 per project convention. If different from the source CRS, the bbox is reprojected. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, dict]
|
(data, profile) — raster array and rasterio profile dict. |
inspect_cog(source)
¶
Inspect a COG without reading pixel data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str or Path
|
Local path, S3 URI, or HTTPS URL. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Metadata dict with keys: path, width, height, crs, bounds, dtype, band_count, driver, nodata, transform. |
Point Cloud (COPC / LAZ)¶
Optional dependency
Requires pip install abovepy[lidar] (laspy).
pointcloud
¶
Point cloud reads for COPC/LAZ files.
Requires optional dependencies: pip install abovepy[lidar]
Supports reading point cloud data from local files, S3 URIs, and HTTPS URLs. For COPC files, spatial filtering via bbox is supported without downloading the entire file.
read_pointcloud(source, bbox=None, classifications=None)
¶
Read a COPC or LAZ point cloud file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str or Path
|
Local path, S3 URI, or HTTPS URL to a LAZ/COPC file. |
required |
bbox
|
tuple
|
Spatial filter (xmin, ymin, xmax, ymax) in the file's native CRS. |
None
|
classifications
|
list[int]
|
Filter to specific LAS classification codes (e.g., [2] for ground). |
None
|
Returns:
| Type | Description |
|---|---|
tuple[LasData, dict]
|
(point_cloud, metadata) — LasData object and metadata dict. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If laspy is not installed. |
inspect_pointcloud(source)
¶
Inspect a point cloud file header without reading all points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str or Path
|
Local path to a LAZ/COPC file. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Metadata dict. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If laspy is not installed. |