Skip to content

3 group surveys to fix floating point issue #4

Merged
merged 7 commits into from
Oct 27, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
8 changes: 5 additions & 3 deletions .gitignore
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
73 changes: 63 additions & 10 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,25 +1,78 @@
# 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:

```
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`.
- 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**.


Create a python environment with
## 2. Activate python environment

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:
`source <environment_name>/bin/activate`
* **macOS/Linux:**
```zsh
source <environment_name>/bin/activate
```

## Run script
First ensure that all requirements are installed: `pip install -r requirements.txt`
## 3. Install requirements

Then run the command below to create the potree structure.
Install the required Python packages:

```zsh
pip install -r requirements.txt
```


## 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.
Loading