Skip to content

Commit

Permalink
Add test for colorization when epsg is not 2154
Browse files Browse the repository at this point in the history
  • Loading branch information
leavauchier committed Jan 24, 2024
1 parent a74ebe1 commit bbc363b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# dev
- fix add_buffer: propagate header infos from input to the output
- update pdal.Writer params to make sure input format is forwarded except for the specified parameters
- add test for colorization with epsg != 2154

# 1.5.0
- switch colorisation source from Geoportail to Geoplateforme
Expand Down
Binary file added test/data/sample_guyane_epsg2972.laz
Binary file not shown.
22 changes: 19 additions & 3 deletions test/test_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ def setup_module(module):

TEST_PATH = os.path.dirname(os.path.abspath(__file__))
INPUT_PATH = os.path.join(TEST_PATH, "data/test_noepsg_043500_629205_IGN69.laz")
INPUT_PATH_SINGLE_POINT_CLOUD = os.path.join(TEST_PATH, "data/test_data_0436_6384_LA93_IGN69_single_point.laz")

OUTPUT_FILE = TMPDIR + "Semis_2021_0435_6292_LA93_IGN69.las"
OUTPUT_FILE_SINGLE_POINT_CLOUD = TMPDIR + "test_data_0436_6384_LA93_IGN69_single_point.colorized.laz"


@pytest.mark.geopf
Expand Down Expand Up @@ -56,15 +54,33 @@ def test_color_and_keeping_orthoimages():

@pytest.mark.geopf
def test_color_narrow_cloud():
input_path = os.path.join(TEST_PATH, "data/test_data_0436_6384_LA93_IGN69_single_point.laz")
output_path = TMPDIR + "test_data_0436_6384_LA93_IGN69_single_point.colorized.laz"
# Test that clouds that are smaller in width or height to 20cm are still clorized without an error.
color.color(INPUT_PATH_SINGLE_POINT_CLOUD, OUTPUT_FILE_SINGLE_POINT_CLOUD, epsg)
color.color(input_path, output_path, epsg)


@pytest.mark.geopf
def test_download_image_ok():
color.download_image_from_geoplateforme(epsg, layer, minx, miny, maxx, maxy, pixel_per_meter, OUTPUT_FILE, 15)


@pytest.mark.geopf
def test_color_epsg_2972_forced():
input_path = os.path.join(TEST_PATH, "data/sample_guyane_epsg2972.laz")
output_path = TMPDIR + "sample_guyane_epsg2972.colorized.laz"
# Test that clouds that are smaller in width or height to 20cm are still clorized without an error.
color.color(input_path, output_path, 2972)


@pytest.mark.geopf
def test_color_epsg_2972_detected():
input_path = os.path.join(TEST_PATH, "data/sample_guyane_epsg2972.laz")
output_path = TMPDIR + "sample_guyane_epsg2972.colorized.laz"
# Test that clouds that are smaller in width or height to 20cm are still clorized without an error.
color.color(input_path, output_path)


@pytest.mark.geopf
def test_download_image_raise1():
retry_download = color.retry(2, 5)(color.download_image_from_geoplateforme)
Expand Down

0 comments on commit bbc363b

Please sign in to comment.