-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from TDT4290-group-4/3-group-surveys-to-fix-flo…
…ating-point-issue 3 group surveys to fix floating point issue
- Loading branch information
Showing
4 changed files
with
326 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| #survey content | ||
| /surveys/* | ||
| /output_las/* | ||
| surveys | ||
| converted_surveys | ||
| temp_cells | ||
| metadata | ||
| h3_cells | ||
| .DS_Store | ||
| .venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,79 @@ | ||
| # Las Converter | ||
|
|
||
| `lasConverter.py` converts survey CSV files into LAS files using EPSG:4978 and groups/crops them by H3 cells. | ||
| The main steps are: | ||
|
|
||
| 1. Prepare H3 Cells and Assign Surveys | ||
| 2. Convert CSV Surveys to LAS using EPSG:4978 | ||
| 3. Group and Crop by H3 Cells | ||
|
|
||
| # How to run | ||
|
|
||
| ## Activate python environment | ||
| ## 1. Prepare Files and Folders | ||
|
|
||
| Before running the script, make sure your project folder has the following structure: | ||
|
|
||
| ```text | ||
| lasConverter.py | ||
| surveys/ | ||
| ├── survey_name_1/ | ||
| │ ├── file1.csv | ||
| │ └── file2.csv | ||
| ├── survey_name_2/ | ||
| │ └── ... | ||
| └── ... | ||
| metadata/ | ||
| ├── metadata.csv | ||
| └── level1_h3_cells.csv | ||
| ``` | ||
|
|
||
| ### `surveys/` | ||
| - Contains **one folder per survey**, using the **survey name** as the folder name. | ||
| - Each survey folder contains the CSV files for that survey (arbitrarily named). | ||
|
|
||
| ### `metadata/metadata.csv` | ||
| - Must include the columns: `fid`, `survey_name`, `survey_area`, `geom`, `epsg`. | ||
| - Script assumes bounding polygons in `geom` use EPSG:4258. | ||
| - Each row corresponds to a survey. | ||
|
|
||
| ### `metadata/level1_h3_cells.csv` | ||
| - Must contain a single column `cell_id`, listing all relevant **level 1 H3 cells**. | ||
|
|
||
|
|
||
| ## 2. Activate python environment | ||
|
|
||
| Create a python environment with | ||
| Create a python virtual environment with | ||
| ```zsh | ||
| python -m venv <environment_name> | ||
| ``` | ||
|
|
||
| and run it with: | ||
| Activate it: | ||
|
|
||
| Windows: `<environment_name>\Scripts\activate` | ||
| * **Windows:** | ||
| ```zsh | ||
| <environment_name>\Scripts\activate | ||
| ``` | ||
|
|
||
| * **macOS/Linux:** | ||
| ```zsh | ||
| source <environment_name>/bin/activate | ||
| ``` | ||
|
|
||
| macOS/Linux: | ||
| `source <environment_name>/bin/activate` | ||
| ## 3. Install requirements | ||
|
|
||
| ## Run script | ||
| First ensure that all requirements are installed: `pip install -r requirements.txt` | ||
| Install the required Python packages: | ||
|
|
||
| ```zsh | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| Then run the command below to create the potree structure. | ||
|
|
||
| ## 4. Run the script | ||
|
|
||
| Run the converter: | ||
|
|
||
| ```zsh | ||
| python lasConverter.py <input_directory> <output_directory> | ||
| python lasConverter.py | ||
| ``` | ||
|
|
||
| The processed LAS files, cropped to level 2 H3 cells, will be saved in the `./h3_cells` folder. |
Oops, something went wrong.