Crate las [−] [src]
Natively read and write ASPRS LAS data.
Reading
Reader
s can be created from paths:
use las::Reader; let reader = Reader::from_path("tests/data/autzen.las").unwrap();
Or anything that implements Read
:
use std::io::BufReader; use std::fs::File; let read = BufReader::new(File::open("tests/data/autzen.las").unwrap()); let reader = Reader::new(read).unwrap();
Your performance will be better if your Read
is actually a BufRead
. Reader::from_path
takes care of this for you, but Reader::new
doesn't.
Read points one-by-one with read
:
let point = reader.read().unwrap().unwrap();
Writing
Create a Writer
from something that implements Write
and a Header
:
use std::io::Cursor; use las::Writer; let writer = Writer::new(Cursor::new(Vec::new()), Default::default()).unwrap();
Use the Header
to customize the output data formats:
use las::Header; let header = Header { version: (1, 3), point_format: 2.into(), ..Default::default() }; let writer = Writer::new(Cursor::new(Vec::new()), header).unwrap();
You can also write out to a path (automatically buffered):
let writer = Writer::from_path("/dev/null", Default::default());
Write points one at a time:
use las::Point; let point = Point { x: 1., y: 2., z: 3., ..Default::default() }; writer.write(&point).unwrap();
Reexports
pub use reader::Reader; |
Modules
header |
Metadata describing the layout and interpretation of the points. |
point |
Three-dimensional points with additional attributes. |
reader |
Read las points. |
vlr |
Variable length records. |
Structs
Bounds |
Minimum and maximum bounds in three dimensions. |
Header |
Metadata describing the layout, source, and interpretation of the points. |
Point |
A point is the basic unit of information in LAS data. |
Transform |
A scale and an offset that transforms xyz coordinates. |
Vector |
An xyz collection. |
Vlr |
A variable length record. |
Writer |
Writes LAS data. |
Enums
Error |
Crate-specific error enum. |
Type Definitions
Result |
Crate-specific result type. |