Agent skill
qgis-11-pyqgis-application-bootstrap-headless
Sub-skill of qgis: 1.1 PyQGIS Application Bootstrap (Headless) (+2).
Install this agent skill to your Project
npx add-skill https://github.com/vamseeachanta/workspace-hub/tree/main/.claude/skills/_archive/engineering/gis/qgis/11-pyqgis-application-bootstrap-headless
SKILL.md
1.1 PyQGIS Application Bootstrap (Headless) (+2)
1.1 PyQGIS Application Bootstrap (Headless)
import sys
import os
# Required: set QGIS prefix path before importing
os.environ["QT_QPA_PLATFORM"] = "offscreen" # headless mode
from qgis.core import QgsApplication
qgs = QgsApplication([], False) # False = no GUI
qgs.initQgis()
# Always call at end of script:
# qgs.exitQgis()
1.2 Well Locations from CSV (lat/lon)
from qgis.core import (QgsVectorLayer, QgsProject,
QgsCoordinateReferenceSystem)
# CSV with columns: well_name,latitude,longitude
uri = (
"file:///path/to/wells.csv"
"?delimiter=,"
"&xField=longitude"
"&yField=latitude"
"&crs=EPSG:4326" # WGS84 geographic
)
layer = QgsVectorLayer(uri, "wells", "delimitedtext")
if not layer.isValid():
raise RuntimeError("Failed to load CSV layer")
QgsProject.instance().addMapLayer(layer)
1.3 Supported Input Formats
| Format | Driver | Use |
|---|---|---|
| GeoPackage (.gpkg) | GPKG | Preferred vector store |
| Shapefile (.shp) | ESRI Shapefile | Legacy vector |
| GeoJSON (.geojson) | GeoJSON | Web interchange |
| GeoTIFF (.tif) | GTiff | Raster standard |
| NetCDF (.nc) | netCDF | Metocean/bathymetry |
| KML (.kml) | KML | Google Earth exchange |
| CSV + lat/lon | delimitedtext | Point data import |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
gsd-complete-milestone
Archive completed milestone and prepare for next version
gsd-reapply-patches
Reapply local modifications after a GSD update
gsd-verify-work
Validate built features through conversational UAT
gsd-thread
Manage persistent context threads for cross-session work
clinical-trial-protocol
Generate clinical trial protocols for medical devices or drugs through a modular, waypoint-based architecture with research-only and full protocol modes.
single-cell-rna-qc
Performs quality control on single-cell RNA-seq data (.h5ad or .h5 files) using scverse best practices with MAD-based filtering and comprehensive visualizations.
Didn't find tool you were looking for?