-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add COPC reading support #219
Conversation
In addition to filtering by a bounds, it would also be really useful to filter by a resolution or tree level. PDAL has some examples of this resolution-based filtering at https://github.com/PDAL/PDAL/tree/master/io/private/copc and https://github.com/PDAL/PDAL/blob/master/io/CopcReader.cpp#L241 |
The query function is defined as def query(
self,
bounds: Optional[Bounds] = None,
level: Optional[Union[int, range]] = None,
) -> ScaleAwarePointRecord: So you can filter by bounds or level or both at the same time , some wrapper functions also exists def spatial_query(self, bounds: Bounds) -> ScaleAwarePointRecord:
return self.query(bounds=bounds, level=None)
def level_query(self, level: Union[int, range]) -> ScaleAwarePointRecord:
return self.query(bounds=None, level=level) |
A helper function to allow users to convert level->resolution would be very useful. |
Ok I got confused, resolution != level |
Yes. They're directly related, but we have found with EPT and COPC it is much easier to say "select everything at or below 3m" instead of having to calculate based on the dimensions of the octree what level would correspond to everything 3m or below. |
fc25096
to
370fcfe
Compare
resolution was added as a query parameter |
I attempted to test this but got the following:
I presume this is due to lazrs not being released with chunk table support quite yet? |
Yes, I plan on releasing lazrs later this week, after that this PR will be testable easily |
The new version of lazrs was pushed to pypi so it should be easier to test now |
OSX arm wheels for lazrs didn't post https://pypi.org/project/lazrs/#files |
I installed my own lazrs. It seems a bit slower than PDAL while fetching over the network. Are you reading the entire octree down to the client?
|
I have not posted these wheels yet
Yes the entire octree hierarchy info is fetched at the begnning. The The python example reads the whole hierarchy and then queries two quarter of the bounds with a Some resolution |
I just pushed changes that makes it so that the octree hierarchies are fetched when actually needed (and not fetch every thing on init like before) |
Confirmed and behaving as I would expect now.
I didn't realize these weren't automated. laz-rs/laz-rs-python#9 implied they were, but maybe that isn't quite done yet. |
Sorry, my
That reads across the entire domain and fetches points to a 20m resolution (376303 points) |
Ok nice
Yeah its a thing that I want to do, it should not be hard, but CI is not the most interesting thing to do in projects 😅 |
This adds the `CopcReader` class to laspy that understands the COPC LAZ format, enabling to do spatial and / or LOD based queries. The class require `lazrs` to work, and optionaly, if `requests` is installed COPC over HTTP is supported.
This adds the
CopcReader
class to laspythat understands the COPC LAZ format, enabling to
do spatial and / or LOD based queries.
The class require
lazrs
to work,and optionaly, if
requests
is installedCOPC over HTTP is supported.