diff --git a/CMakeLists.txt b/CMakeLists.txt index bddebca..47fe925 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,21 +9,6 @@ find_package(PDAL REQUIRED) set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install) set(CMAKE_DEBUG_POSTFIX d) -######### filter - gridDecimation ######### - -file( GLOB_RECURSE GD_SRCS ${CMAKE_SOURCE_DIR} src/filter_grid_decimation/*.*) - -PDAL_CREATE_PLUGIN( - TYPE filter - NAME grid_decimation - VERSION 1.0 - SOURCES ${GD_SRCS} -) - - -######### Install ######### - -install(TARGETS - pdal_plugin_filter_grid_decimation -) +## add plugin +add_subdirectory(src/filter_grid_decimation) diff --git a/Dockerfile b/Dockerfile index 36ae009..ab76659 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM mambaorg/micromamba:latest as build_ign_pdal_plugin -COPY environment.yml /environment.yml +COPY environment_docker.yml /environment_docker.yml USER root -RUN micromamba env create -f /environment.yml +RUN micromamba env create -f /environment_docker.yml SHELL ["micromamba", "run", "-n", "pdal_ign_plugin", "/bin/bash", "-c"] COPY . . @@ -14,4 +14,4 @@ RUN make -j4 install ENV PATH=$PATH:/opt/conda/envs/pdal_ign_plugin/bin/ ENV PROJ_LIB=/opt/conda/envs/pdal_ign_plugin/share/proj/ -ENV PDAL_DRIVER_PATH=/tmp/install/lib +ENV PDAL_DRIVER_PATH=/tmp/install/lib \ No newline at end of file diff --git a/README.md b/README.md index eb8b2bb..713f040 100755 --- a/README.md +++ b/README.md @@ -12,6 +12,27 @@ run ci/build.sh todo... +## Architecture of the code + +The code is structured as : + +``` +├── src +│ ├── plugins forlder +│ │ ├── plufinFilter.cpp +│ │ ├── plufinFilter.h +│ │ ├── CMakeLisits.txt +├── doc +│ ├── plufinFilter.md +├── ci +├── test +├── CMakeLisits.txt +├── environment*.yml +├── Dockerfile +├── .github +└── .gitignore +``` + ## Run the tests Each plugin should have his own test. To run test : @@ -20,12 +41,50 @@ Each plugin should have his own test. To run test : python -m pytest -s ``` -## Architecture +## List of Filters -todo... +[grid decimation](./doc/grid_decimation.md) -## Filters +## Adding a filter -[grid decimation](./doc/grid_decimation.md) +In order to add a filter, you have to add a new folder in the src directory : + +``` +├── src +│ ├── filter_my_new_PI +│ │ ├── my_new_PI_Filter.cpp +│ │ ├── my_new_PI_Filter.h +│ │ ├── CMakeLisits.txt +``` + +The name of the folder informs of the plugIN nature (reader, writer, filter). + +The code should respect the documentation purpose by pdal : [build a pdal plugin](https://pdal.io/en/2.6.0/development/plugins.html). Be careful to change if the plugIn is a reader, a writer or a filter. + +The CMakeList should contains : + +``` +file( GLOB_RECURSE GD_SRCS ${CMAKE_SOURCE_DIR} src/my_new_PI/*.*) + +PDAL_CREATE_PLUGIN( + TYPE filter + NAME my_new_PI + VERSION 1.0 + SOURCES ${GD_SRCS} +) + +install(TARGETS pdal_plugin_filter_my_new_PI) +``` + +You should complet the principal CMakeList by adding the new plugIN : + +``` +add_subdirectory(src/filter_my_new_PI) +``` + +Each plugIN has his own md file in the doc directory, structured as the [model](./doc/_doc_model_plugIN.md). + +D'ont forget to update [the list](#adding-a-filter) with a link with the documentation. + diff --git a/doc/_doc_model_plugIN.md b/doc/_doc_model_plugIN.md new file mode 100755 index 0000000..44778e2 --- /dev/null +++ b/doc/_doc_model_plugIN.md @@ -0,0 +1,34 @@ +# filter my_plugIN + +Purpose +--------------------------------------------------------------------------------------------------------- + + +The **my_plugIN** explanation... + + +Example +--------------------------------------------------------------------------------------------------------- + +*Give an example of a contextual use of the plugIN* + + +``` + [ + ... + { + "type": "filters.my_plugIN", + "option1":"*", + }, + ... + ] +``` + +Options +--------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +*The plugIn's options* + +**option1** : + Explanation of the option and its possible(s) value(s). [Default: *] + diff --git a/doc/grid_decimation.md b/doc/grid_decimation.md index 93fcda9..573a46b 100755 --- a/doc/grid_decimation.md +++ b/doc/grid_decimation.md @@ -1,5 +1,8 @@ # filter grid decimation +Purpose +--------------------------------------------------------------------------------------------------------- + The **grid decimation filter** transform only one point in each cells of a grid calculated from the points cloud and a resolution therm. The transformation is done by the value information. The selected point could be the highest or the lowest point on the cell. It can be used, for exemple, to quickly filter vegetation points in order to keep only the canopy points. A new attribut is created with the value '1' for the grid, and '0' for the other points. diff --git a/environment_docker.yml b/environment_docker.yml new file mode 100755 index 0000000..b49f938 --- /dev/null +++ b/environment_docker.yml @@ -0,0 +1,6 @@ +name: pdal_ign_plugin +channels: + - conda-forge +dependencies: + - pdal + diff --git a/src/filter_grid_decimation/CMakeLists.txt b/src/filter_grid_decimation/CMakeLists.txt new file mode 100755 index 0000000..2fd6689 --- /dev/null +++ b/src/filter_grid_decimation/CMakeLists.txt @@ -0,0 +1,14 @@ + +file( GLOB_RECURSE GD_SRCS ${CMAKE_SOURCE_DIR} src/filter_grid_decimation/*.*) + +PDAL_CREATE_PLUGIN( + TYPE filter + NAME grid_decimation + VERSION 1.0 + SOURCES ${GD_SRCS} +) + +install(TARGETS + pdal_plugin_filter_grid_decimation +) +