Skip to content
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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Flexibly Modify Point Contents #49

wants to merge 11 commits into from

Conversation

BenCurran98
Copy link
Collaborator

@BenCurran98 BenCurran98 commented Jan 30, 2025

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 do

las = load_las(...)
add_column!(las, :overlap, falses(number_of_points(las)))`

This 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 (the caveat here is that the points you're adding need to have the exact same fields as those presently in the point cloud).

To make this work, I've redone the internals of how we store point data, changing to use a single FlexTable instead of a core TypedTable and an optional FlexTable 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 this

Types of Changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Refactor/improvements
  • Documentation / non-code

Tasks

  • Functions to modify header format properties
  • Plumb header functions through LASDataset objects
  • Modify add_column! to work for LAS fields as well as user fields
  • Ability to add points to LASDataset
  • Documentation of API changes

Review

  • Tests

Signed-off-by: BenCurran98 <b.curran@fugro.com>
Signed-off-by: BenCurran98 <b.curran@fugro.com>
Signed-off-by: BenCurran98 <b.curran@fugro.com>
Signed-off-by: BenCurran98 <b.curran@fugro.com>
Signed-off-by: BenCurran98 <b.curran@fugro.com>
Signed-off-by: BenCurran98 <b.curran@fugro.com>
Comment on lines +372 to +373


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra white space.

else
header.legacy_point_return_count = points_per_return
header.legacy_point_return_count = (0, 0, 0, 0, 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to return nothing at the end of this function?

@i-kieu i-kieu self-requested a review January 30, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants