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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.1.1
- Mise à jour du ReadMe
- Dans la fonction extract_points_skeleton, les fichiers las n'ont plus besoin d'être dans un sous-dossier `pointcloud`

# v0.1.0
- Correction du bug au moment de la jonction entre les parties du squelette qui créait des
interpolations imprévues entre des extrémités de branches qui ne devraient pas être reliées.
Expand Down
28 changes: 20 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
FROM mambaorg/micromamba:latest
FROM mambaorg/micromamba:latest AS mamba_pdal
COPY environment.yml /environment.yml
COPY requirements.txt /requirements.txt

# Using USER root seems to fix permission issues when building mamba environment with pip packages
USER root

WORKDIR /lidro

# # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker
COPY environment.yml /tmp/env.yaml
COPY requirements.txt /tmp/requirements.txt
RUN chown $MAMBA_USER:$MAMBA_USER /tmp/env.yaml
RUN micromamba install -y -n base -f /tmp/env.yaml && \
micromamba clean --all --yes
RUN micromamba env create -n lidro -f /environment.yml


FROM debian:bullseye-slim

# install PDAL
COPY --from=mamba_pdal /opt/conda/envs/lidro/bin/pdal /opt/conda/envs/lidro/bin/pdal
COPY --from=mamba_pdal /opt/conda/envs/lidro/bin/python /opt/conda/envs/lidro/bin/python
COPY --from=mamba_pdal /opt/conda/envs/lidro/lib/ /opt/conda/envs/lidro/lib/
COPY --from=mamba_pdal /opt/conda/envs/lidro/ssl /opt/conda/envs/lidro/ssl
COPY --from=mamba_pdal /opt/conda/envs/lidro/share/proj/proj.db /opt/conda/envs/lidro/share/proj/proj.db

ENV PATH=$PATH:/opt/conda/envs/lidro/bin/
ENV PROJ_LIB=/opt/conda/envs/lidro/share/proj/

ENV ENV=base
ARG MAMBA_DOCKERFILE_ACTIVATE=1

WORKDIR /lidro

COPY lidro lidro
COPY configs configs
COPY test test
214 changes: 154 additions & 60 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data
Submodule data updated from 2ae2df to 36a33e
Binary file added images/alerte_squelette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/correction_alerte_squelette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/correction_manuelle_masque_hydro.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cuvettes_artefects.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/decoupage_masque_fusionne.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/extraction_n_points_squelette.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/masque_hydro_dalles.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/masque_hydro_merge.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mnt_avant_apres.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nettoyage_squelette.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/points_virtuels.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/squelette_hydro.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lidro/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.0"
__version__ = "0.1.1"

if __name__ == "__main__":
print(__version__)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import geopandas as gpd
import pandas as pd
from pdaltools.las_info import las_get_xy_bounds
from lidro.las_info import las_get_xy_bounds
from shapely.geometry import Point

from lidro.create_virtual_point.pointcloud.crop_las import (
Expand Down Expand Up @@ -45,9 +45,8 @@ def extract_points_around_skeleton_points_one_tile(
k (int): the number of nearest neighbors to find
"""
# Step 1 : Crop filtered pointcloud by Mask Hydro with buffer
input_dir_points = os.path.join(input_dir, "pointcloud")
tilename = os.path.splitext(filename)[0] # filename to the LAS file
input_pointcloud = os.path.join(input_dir_points, filename) # path to the LAS file
input_pointcloud = os.path.join(input_dir, filename) # path to the LAS file
logging.info(f"\nCroping filtered pointcloud by Mask Hydro with buffer for tile : {tilename}")
# Croping filtered pointcloud by Mask Hydro with buffer for tile
points_clip = read_filter_and_crop_pointcloud(input_pointcloud, str(input_mask_hydro_buffer), classes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)

TMP_PATH = Path("./tmp/create_virtual_point/vectors/extract_points_around_skeleton")
INPUT_DIR = Path("./data/tile_0830_6291")
INPUT_DIR = Path("./data/tile_0830_6291/pointcloud")
MASK_HYDRO = "./data/tile_0830_6291/mask_hydro_merge/MaskHydro_merge.geojson"
POINTS_SKELETON = "./data/tile_0830_6291/skeleton/points_along_skeleton.geojson"
OUTPUT_GEOJSON = TMP_PATH / "Semis_2021_0830_6291_LA93_IGN69_points_skeleton.geojson"
Expand Down
10 changes: 5 additions & 5 deletions test/test_main_extract_points_from_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setup_module(module):
def test_main_run_okay():

cmd = f"""python -m lidro.main_extract_points_from_skeleton \
io.input_dir={INPUT_DIR}\
io.input_dir={INPUT_DIR}/pointcloud \
io.input_filename=Semis_2021_0830_6291_LA93_IGN69.laz \
io.input_mask_hydro="{INPUT_DIR}/mask_hydro_merge/MaskHydro_merge.geojson"\
io.input_skeleton="{INPUT_DIR}/skeleton/skeleton_hydro.geojson"\
Expand All @@ -28,7 +28,7 @@ def test_main_run_okay():


def test_main_extract_points_skeleton_input_file():
input_dir = INPUT_DIR
input_dir = INPUT_DIR / "pointcloud"
output_dir = OUTPUT_DIR / "main_extract_points_skeleton_input_file"
input_filename = "Semis_2021_0830_6291_LA93_IGN69.laz"
input_mask_hydro = INPUT_DIR / "mask_hydro_merge/MaskHydro_merge.geojson"
Expand Down Expand Up @@ -111,7 +111,7 @@ def test_main_extract_points_skeleton_fail_wrong_input_dir():


def test_main_extract_points_skeleton_fail_no_output_dir():
input_dir = INPUT_DIR
input_dir = INPUT_DIR / "pointcloud"
input_mask_hydro = INPUT_DIR / "mask_hydro_merge/MaskHydro_merge.geojson"
input_skeleton = INPUT_DIR / "skeleton/skeleton_hydro.geojson"
distances_meters = 5
Expand All @@ -137,7 +137,7 @@ def test_main_extract_points_skeleton_fail_no_output_dir():


def test_main_extract_points_skeleton_fail_no_input_mask_hydro():
input_dir = INPUT_DIR
input_dir = INPUT_DIR / "pointcloud"
output_dir = OUTPUT_DIR / "main_no_input_dir"
input_skeleton = INPUT_DIR / "skeleton/skeleton_hydro.geojson"
distances_meters = 5
Expand All @@ -163,7 +163,7 @@ def test_main_extract_points_skeleton_fail_no_input_mask_hydro():


def test_main_extract_points_skeleton_fail_no_input_skeleton():
input_dir = INPUT_DIR
input_dir = INPUT_DIR / "pointcloud"
output_dir = OUTPUT_DIR / "main_no_input_dir"
input_mask_hydro = INPUT_DIR / "mask_hydro_merge/MaskHydro_merge.geojson"
distances_meters = 5
Expand Down