All operations demonstrated in the tutorial also apply to remote files. Thanks to
GDAL’s virtual file system, lasR can stream data directly
from remote sources without requiring you to download the entire file
beforehand.
However, working with remote data introduces some constraints:
It is strongly recommended to use cloud-optimized formats (COPC or EPT) with proper spatial or depth queries. These formats are designed for efficient partial access over the network.
| Prefix | Protocol | Authentication |
|---|---|---|
/vsicurl/ |
HTTP/HTTPS | None, or .netrc |
/vsis3/ |
Amazon S3 | AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY
env vars |
/vsigs/ |
Google Cloud Storage | GOOGLE_APPLICATION_CREDENTIALS env var |
/vsiaz/ |
Azure Blob Storage | AZURE_STORAGE_ACCOUNT +
AZURE_STORAGE_ACCESS_KEY env vars |
/vsiadls/ |
Azure Data Lake Storage Gen2 | Same as /vsiaz/ |
/vsioss/ |
Alibaba Cloud OSS | OSS_ACCESS_KEY_ID + OSS_SECRET_ACCESS_KEY
env vars |
/vsiswift/ |
OpenStack Swift (OVH, Rackspace) | SWIFT_AUTH_TOKEN + SWIFT_STORAGE_URL env
vars |
lasR can read EPT datasets by pointing to the
ept.json endpoint. EPT is a directory-based octree format
where each tile is a separate LAZ file. Only tiles that intersect the
query region are downloaded.
url <- "https://s3-us-west-2.amazonaws.com/usgs-lidar-public/IA_FullState/ept.json"
# Read only the root level of the octree
ans <- exec(reader(depth = 0) + summarise(), on = url)
# Spatial query — fetches only the tiles that overlap
pipeline <- reader_circles(-10421000, 5102000, 500, depth = 6) + write_las()
ans <- exec(pipeline, on = url)The depth parameter controls how deep into the octree
hierarchy to read (0 = root only). This parameter works for both COPC
and EPT formats. Only LAZ-encoded EPT datasets are supported.
To deal with a collection of tiled remote files we recommend using a VPC file that indexes remote files.