Gist 1aa1bf66d847be043a246df8bf74793e
✓ Published0🌍 Public
TThomasG77
Last edited Aug 24, 2021
Created on Aug 24, 2021
This example demonstrates how to load multiple CSV files containing Chinese-character field names as spatial layers in QGIS. The script uses the PyQGIS API, specifically `QgsVectorLayer` with the `delimitedtext` provider, to parse longitude and latitude columns named 經度 and 緯度. It iterates through all CSV files in a directory using Python’s `glob` and `os` modules, constructs a URI with URL encoding via `urllib.parse.quote`, and adds each resulting point layer to the project with `QgsProject.instance().addMapLayer`. The sample data shows simple occurrence records with coordinates.
AI-generated description