-
Notifications
You must be signed in to change notification settings - Fork 1
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
Flexibly Modify Point Contents #49
Conversation
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
14df992
to
0af3dbf
Compare
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
95cb934
to
048126a
Compare
While I'm at it, I've also corrected a couple of small bits and pieces in the logic here. |
Signed-off-by: BenCurran98 <[email protected]>
bbdc935
to
92cf95d
Compare
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
d716969
to
0389032
Compare
else | ||
return Table(las.pointcloud, las._user_data) | ||
end | ||
return las.pointcloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type returned has changed from Table -> FlexTable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so this might cause issues in downstream methods expecting this to be of type Table
. Ideally, those methods should change to accept AbstractVector{<:NamedTuple}
instead
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
Signed-off-by: BenCurran98 <[email protected]>
06c9085
to
9b4b9f9
Compare
@@ -183,4 +183,40 @@ | |||
remove_vlr!(las, superseded_comment) | |||
@test number_of_evlrs(get_header(las)) == 1 | |||
@test get_evlrs(las) == [new_commment] | |||
|
|||
# test modifying point formats and versions | |||
las = LASDataset(pc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
las = LASDataset(this_pc)
?
@@ -554,13 +585,18 @@ end | |||
Set the number of points in a LAS file with a header `header` | |||
""" | |||
function set_point_record_count!(header::LasHeader, num_points::Integer) | |||
if las_version(header) == v"1.4" | |||
if (las_version(header) == v"1.4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need the brackets?
Ability to flexibly modify point data and header info in LAS Dataset
Description
Adding the functionality to let users modify the point data or header information relating to the point data in a
LASDataset
without invalidating the header of the LAS file.The main use case here is if you have some
LASDataset
and you want to add extra LAS fields to it (that aren't already present, and maybe don't correspond to the point version currently stored in your header). For example, if you have a file with the LasPoint0 format, but want to add an overlap column, you can doThis will update the header information appropriately as well as the actual point data.
Additionally, you can opt to change the point format or las version specifically (without changing the point data itself).
The benefit of these changes is that if you load in a LAS file, do some processing, and then need to output it in a different format, you can do it without having to create a whole new
LASDataset
.On top of this, you can add extra points to your dataset too using the new
add_points!
function (where one caveat is if your new points are missing any fields that are in the LAS dataset, they'll be filled in with zeroes)To make this work, I've redone the internals of how we store point data, changing to use a single
FlexTable
instead of a coreTypedTable
and an optionalFlexTable
just containing user data. This may be slightly less performant in some operations over the point data due to type inference overhead, however I think the flexibility in the UI justifies thisTypes of Changes
Tasks
LASDataset
objectsadd_column!
to work for LAS fields as well as user fieldsLASDataset
Review