Skip to content

Commit 9104de0

Browse files
committed
Add minimal reader example
1 parent cc359b9 commit 9104de0

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

README.md

+27-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
## Writing is still a WIP
2-
Writing of the octree structure seem to work, so spatial queries in full resolution on copc-rs written files should be good.
3-
BUT the octree levels does not yet contain a similar point distribution as the whole cloud so results from resolution queries on copc-rs written files are wrong.
4-
This means the written files will look bad in viewers.
5-
6-
7-
I will look into it when I find time, for now I only need full resolution spatial queries in my current project anyway.
8-
-oyhj1801
9-
101
# copc-rs
112

123
[![crates.io version](https://img.shields.io/crates/v/copc-rs.svg)](https://crates.io/crates/copc-rs)
@@ -18,6 +9,15 @@ It utilizes the las and laz crates heavily and tries to offer a similiar API to
189
## Usage examples
1910

2011
### reader
12+
13+
```rust
14+
let mut copc_reader = CopcReader::from_path("autzen-classified.copc.laz")?;
15+
for point in copc_reader.points(LodSelection::Level(0), BoundsSelection::All)?.take(5) {
16+
println!("Point coordinates: ({}, {}, {})", point.x, point.y, point.z);
17+
}
18+
```
19+
20+
Full example with bounds selection:
2121
```rust
2222
use copc_rs::{Bounds, BoundsSelection, CopcReader, LodSelection, Vector};
2323

@@ -45,7 +45,14 @@ fn main() {
4545
}
4646
}
4747
```
48+
49+
Run an example:
50+
```
51+
cargo run --example copc_http
52+
```
53+
4854
### writer
55+
4956
```rust
5057
use copc_rs::CopcWriter;
5158
use las::Reader;
@@ -65,5 +72,16 @@ fn main() {
6572
}
6673
```
6774

75+
## Writing is still a WIP
76+
77+
Writing of the octree structure seem to work, so spatial queries in full resolution on copc-rs written files should be good.
78+
BUT the octree levels does not yet contain a similar point distribution as the whole cloud so results from resolution queries on copc-rs written files are wrong.
79+
This means the written files will look bad in viewers.
80+
81+
82+
I will look into it when I find time, for now I only need full resolution spatial queries in my current project anyway.
83+
-oyhj1801
84+
6885
## Credits
86+
6987
This library depends heavily on the work of Thomas Montaigu (@tmontaigu) and Pete Gadomski (@gadomski), the authors of the laz and las crates.

0 commit comments

Comments
 (0)