Skip to content
Open
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# dev
- [fix] update pandas to 3.0.0

# 1.15.9
- [fix] color: fix main

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- gdal
- lastools # for check that lasinfo warnings desapear when standardizing
- geopandas
- pandas=2.3.3 # in the next version (3.0.0), test_add_points_from_geometry_to_las fails
- pandas
# --------- dev dep --------- #
- pre-commit # hooks for applying linters on commit
- black # code formatting
Expand Down
6 changes: 4 additions & 2 deletions pdaltools/add_points_in_pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,11 @@ def add_points_from_geometry_to_las(
gdf = clip_3d_lines_to_tile(gdf, input_las, spatial_ref, tile_width)
# If the geometry type is LineString, generate 3D points
if spacing <= 0:
geom_type_str = str(unique_geom_type[0]) # scalar for stable message across pandas versions
print(f"geometry type: {geom_type_str} and spacing = {spacing}")
raise NotImplementedError(
f"add_points_from_geometry_to_las requires spacing > 0 to run on (Multi)LineString geometries, \
but the values provided are geometry type: {unique_geom_type} and spacing = {spacing} "
f"add_points_from_geometry_to_las requires spacing > 0 to run on (Multi)LineString geometries, "
f"but the values provided are geometry type: {geom_type_str} and spacing = {spacing}"
)
else:
points_gdf = generate_3d_points_from_lines(gdf, spacing, altitude_column)
Expand Down
2 changes: 2 additions & 0 deletions test/test_add_points_in_pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ def test_add_points_from_geometry_to_las(input_file, input_points, epsg, expecte
assert input_las.header.point_format == output_las.header.point_format
assert np.array_equal(input_las.header.scales, output_las.header.scales)
assert np.array_equal(input_las.header.offsets, output_las.header.offsets)
print(f"input = {input_las.header.vlrs[0].string}")
print(f"output = {output_las.header.vlrs[0].string}")
assert input_las.header.vlrs[0].string == output_las.header.vlrs[0].string

point_count = compute_count_one_file(OUTPUT_FILE)["68"]
Expand Down
6 changes: 4 additions & 2 deletions test/test_standardize_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import laspy
import pdal
import pytest
from packaging.version import Version

from pdaltools.count_occurences.count_occurences_for_attribute import (
compute_count_one_file,
Expand Down Expand Up @@ -57,9 +58,10 @@ def test_standardize_format(params):
assert os.path.isfile(output_file)
# check values from metadata
json_info = get_pdal_infos_summary(output_file)
if pdal.info.version < "2.5":
pdal_version = Version(pdal.info.version)
if pdal_version < Version("2.5"):
raise NotImplementedError("This test is not implemented for pdal < 2.5")
elif pdal.info.version <= "2.5.2":
elif pdal_version <= Version("2.5.2"):
metadata = json_info["summary"]["metadata"][1]
else:
metadata = json_info["summary"]["metadata"]
Expand Down
Loading