Treesta Importer Plugin
Treesta Importer – Instructions
Download: via GitHub or directly in QGIS via Extensions → Manage and Install Extensions.
With the Treesta Importer plugin, you can convert data from Tree Cadastre 3 and 4 into the new Treesta format—right in QGIS.
The following are supported:
- permanent trees
- Temporary individual trees
- Areas
- Plans
Each of the different layers is exported and converted individually and then inserted into the corresponding Treesta layer.
1. ✅ What You’ll Need
You’ll need one or more CSV files containing your existing data. Export each existing layer separately.
The required mapping files are already included in the plugin:
fields_mapping*.csvvalue_mapping*.csv
You don’t need to change anything. The files can be expanded only if necessary, for your own or different mappings.
2. 📤 Export data from the existing tree registry
Repeat the export process for each layer you want to import into Treesta:
- Trees
- Temporary individual trees
- Areas
- Plans
Export in QGIS
- Select the desired layer.
- Right-click on the layer.
- Select Export → Save Objects As …
- Select "Comma-Separated Values [CSV]" as the format.
Use the following settings:
| Setting | Value |
|---|---|
| Format | Comma-separated values [CSV] |
| Encoding | UTF-8 |
| Delimiter | Semicolon |
| Geometry | AS_WKT |
| KBS | Preferably EPSG:4326 – WGS 84 |
| File Name | e.g., alte_baeume.csv |
The geometry must be output as Well-Known Text (WKT). This applies to both points and polygons.
3. 🚀 Convert data using the plugin
- Install the plugin via Extensions → Manage and Install Extensions.
- Open any project in QGIS.
- Launch the Treesta Importer.
- Click "Browse…" and select the CSV file you exported earlier.
- Select the appropriate data type from the drop-down menu:
- Permanent Trees
- Temporary Trees
- Area
- Plan
- Click "Start Conversion."
Repeat the conversion for each exported layer.
Import Files Generated
Depending on the selected data type, the plugin creates a uniquely named CSV file in the folder containing the source file:
| Selection in the plugin | File Created | Target Layer in Treesta |
|---|---|---|
| Permanent Trees | trees-treesta-import.csv | Trees |
| Temporary Trees | individual-trees-treesta-import.csv | Trees |
| Area | flächen-treesta-import.csv | Areas |
| Plan | plans-treesta-import.csv | Areas |
In addition, the plugin can generate the following file:
unmapped_values.txt
This file contains values that could not be automatically assigned. Check this file after each conversion before converting the next layer.
The importer also automatically sets the required parameters:
- Permanent trees:
temp = 0 - Temporary trees:
temp = 1 - Areas:
documentation = 1andatlas = 0 - Plans:
atlas = 1
4. 📥 Import data into Treesta
Load the Treesta database
- Before importing, create a backup of the Treesta database, especially if it already contains data.
- Open QGIS.
- Load only the Treesta database
database.gpkg, not the entire Treesta project. - To do this,
database.gpkgin QGIS and select the target layers you need.
Important: Do not upload CSV files using drag-and-drop
Do not simply drag the generated CSV file into QGIS. Doing so may cause all columns to be recognized as text, which can lead to errors when importing into the Treesta database.
Loading a CSV File Correctly
- Open Layer → Data Source Management.
- Select "Separate Texts" on the left.
- Select the appropriate import file, for example
flächen-treesta-import.csv. - Set the following:
| Setting | Value |
|---|---|
| Delimiter | Semicolon |
| Quotation marks | " |
| Geometry | Well-Known Text (WKT) |
| Geometry Field | the field with the WKT geometry |
| KBS | EPSG:4326 – WGS 84 or the coordinate system used during export |
QGIS usually recognizes the remaining columns automatically.
Copying Objects to the Treesta Layer
- Open the attribute table for the loaded CSV file.
- Select the desired items:
- Select all with
Strg+A - copy using
Strg+C
- Select all with
- Enable edit mode for the corresponding Treesta target layer.
- Insert the data using
Strg+V." - Save the layer changes.
Make sure the data is inserted into the correct layer:
bäume-treesta-import.csv→ tree_dataeinzelbäume-treesta-import.csv→ tree_dataflächen-treesta-import.csv→ polygonspläne-treesta-import.csv→ polygons
5. 🔍 Check the import
Check the data after each import:
- Are the number and positions of the objects correct?
- Were the point and polygon geometries imported correctly?
- Are the tree species, measures, and levels of urgency appropriate?
- Are the areas and plans correctly symbolized?
- Were the date fields carried over?
- Are photo details and file paths available?
- Are there any unassigned values in
unmapped_values.txt? - Are special characters, umlauts, and values with commas correct?
Photo fields and the filenames or paths stored in them are imported. However, the actual image files must also be transferred to the designated photo folder.
Video Tutorial
🛠 Note on Plugin Status
The conversion from Tree Cadastre 4 has been expanded to include permanent and temporary trees, areas, and plans.
Importing data from Baumkataster 3 is generally possible. The new functions for the various layers are still being tested separately for this purpose. Therefore, always check converted data carefully before continuing to work with the Treesta database.
