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

Fix prdf type & simplify writer examples #86

Merged
merged 2 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/include/copc-lib/las/header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LasHeader

// Getters/Setters for protected attributes

uint8_t PointFormatId() const { return point_format_id_; }
int8_t PointFormatId() const { return point_format_id_; }
uint16_t PointRecordLength() const { return point_record_length_; }
Vector3 Scale() const { return scale_; }
Vector3 Offset() const { return offset_; }
Expand Down
5 changes: 4 additions & 1 deletion example/example-writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ las::Points RandomPoints(const VoxelKey &key, const las::LasHeader &header, int
std::uniform_int_distribution<> rand_z(std::ceil(header.ApplyInverseScaleZ(std::max(header.min.z, z_min))),
std::floor(header.ApplyInverseScaleZ(std::min(header.max.z, z_min + step))));

las::Points points(header.PointFormatId(), header.Scale(), header.Offset());
// Create a Points object based on the LAS header
las::Points points(header);

// Populate the points
for (int i = 0; i < number_points; i++)
{
// Create a point with a given point format
Expand Down
9 changes: 4 additions & 5 deletions example/example-writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,10 @@ def RandomPoints(key, las_header, number_points):
miny = las_header.min.y + (step * key.y)
minz = las_header.min.z + (step * key.z)

points = copc.Points(
las_header.point_format_id,
las_header.scale,
las_header.offset,
)
# Create a Points object based on the LAS header
points = copc.Points(las_header)

# Populate the points
for i in range(number_points):
# Create a point with a given point format
point = points.CreatePoint()
Expand Down