-
Notifications
You must be signed in to change notification settings - Fork 9
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
New buffer API (and support for reading extra bytes in LAS files) #22
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ts COLOR_RGB attribute)
…st data with extra bytes
… new point buffer API
…xed bug when reading LAS files that have leftover bytes between the end of VLRs and the beginning of the point records
…n readers/writers
…pported unfortunately
…to point data in the LAS header to be wrong
…ntReader API to have more relaxed requirements for buffer types
…version for interleaved buffers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new, improved buffer API to pasture, which is effectively a rewrite of large parts of
pasture-core
. This will break a lot of existing code, which is unfortunate, but I believe the new API is significantly clearer and more extensible than the old buffer API. Using this new API, new features have been added topasture-io
, such as reading of extra bytes in LAS files. Here is a list of the new features that this PR introduces to pasture:InterleavedVecPointStorage
becomesVectorBuffer
,PerAttributeVecPointStorage
becomesHashMapBuffer
. Also renamed theper-attribute
memory layout intocolumnar
, as it more closely matches e.g. columnar databases, which use a similar memory layout, so hopefully this term is clearer thanper-attribute
BorrowedBuffer
,BorrowedMutBuffer
, andOwningBuffer
), as well as multiple memory layout traits (InterleavedBuffer
,InterleavedBufferMut
,ColumnarBuffer
andColumnarBufferMut
). This allows e.g. mutable, but not resizable buffer types to be used as generic bounds and makes some code more efficient and/or ergonomicSliceBuffer
andSliceBufferMut
that provide similar functionality to theIndex
andIndexMut
traits in the Rust standard library. Many buffers support slicing, also recursively (i.e. slicing a slice) in a more coherent manner than the previous buffer APIPointView
andAttributeView
types (with mutable variants). Where previously, pasture only supported typed iterators, these views implement accessor functions likeat
andset_at
for strongly typed data. This makes it easier to work with strongly typed point data in pastureExternalMemoryBuffer
. Currently, this only supports interleaved data, but it allows interesting optimizations, such asmmap
-ing an LAS file and viewing its point records through a pasture point buffer for very fast LAS parsing (see [pasture-io/examples/fast_las_parsing.rs])BufferLayoutConverter
type