Logo von Qgis Errors Data Loading

Qgis Errors Data Loading

Organisation
Impertio-Studio
qgis-errors-data-loading

Use when diagnosing data loading failures, invalid layers, or provider connection errors. Prevents silent failures from unchecked layer validity and incorrect URI formats. Covers invalid layer detection, URI format errors, encoding issues, GeoPackage locking, connection failures, and performance. Keywords: invalid layer, isValid, data loading error, URI format, encoding, GeoPackage lock, connection failed, provider error, layer won't load, can't open shapefile.

Übersicht

HerausgeberImpertio-Studio
RepositoryQGIS-Claude-Skill-Package
Skill-Nameqgis-errors-data-loading
Sterne
39
Forks
2
Mitgelieferte Dateien
3
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 3 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von Impertio-Studio auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Qgis Errors Data Loading in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/Impertio-Studio/QGIS-Claude-Skill-Package/tree/main/skills/source/qgis-errors/qgis-errors-data-loading
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Impertio-Studio/QGIS-Claude-Skill-Package.git /tmp/QGIS-Claude-Skill-Package
mkdir -p .claude/skills
cp -r /tmp/QGIS-Claude-Skill-Package/skills/source/qgis-errors/qgis-errors-data-loading .claude/skills/qgis-errors-data-loading
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Qgis Errors Data Loading in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Qgis Errors Data Loading automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Qgis Errors Data Loading nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

qgis-errors-data-loading

Quick Reference

The #1 Rule

ALWAYS call layer.isValid() immediately after creating ANY layer. An invalid layer does NOT raise an exception — it silently returns a broken object that crashes or produces undefined behavior on access.

python
layer = QgsVectorLayer(uri, name, provider)
if not layer.isValid():
    raise RuntimeError(f"Failed to load layer '{name}': check URI, provider, and data source")

Error Categories at a Glance

Error CategorySymptomsTypical Root Cause
Invalid layerisValid() returns FalseWrong path, bad URI, missing provider
Wrong URI formatLayer loads with 0 features or fails silentlyProvider-specific URI syntax violated
Encoding issuesGarbled attribute text, mojibakeShapefile .dbf encoding mismatch
GeoPackage locking"database is locked" errorConcurrent write access to .gpkg
PostGIS connection failureTimeout, auth error, empty layerNetwork, credentials, permissions
WMS/WFS errorsBlank tiles, timeout, parse failureService URL, capabilities, CRS mismatch
Large dataset performanceMemory exhaustion, UI freezeLoading all features into memory at once
Missing CRSLayer places at wrong locationNo .prj file or CRS metadata absent
Shapefile limitationsTruncated field names, 2GB capFormat constraints hit

Critical Warnings

NEVER access features, attributes, or data provider methods on an invalid layer — this leads to crashes or undefined behavior.

NEVER use backslashes in file paths or URIs — QGIS/Qt normalizes to forward slashes internally. Backslashes in URIs cause provider failures.

NEVER pass True to uri.uri(expandAuthConfig) when logging or displaying URIs — this exposes credentials in plain text. ALWAYS use uri.uri(False).

NEVER hardcode absolute file paths in cross-platform code. ALWAYS use os.path.join() or pathlib.Path for path construction.


Error Catalog

E-001: layer.isValid() Returns False

Symptoms: Layer object exists but isValid() returns False. No exception raised. Adding to project shows a broken layer icon.

Root causes (check in order):

  1. File does not exist at the specified path
  2. URI format is wrong for the chosen provider
  3. Provider name is misspelled or missing
  4. Authentication credentials are missing or incorrect
  5. CRS database is unavailable (standalone scripts without setPrefixPath)
  6. Data file is corrupted or truncated

Fix pattern:

python
import os
from qgis.core import QgsVectorLayer

path = "/data/airports.shp"

# Step 1: Verify file exists
if not os.path.exists(path):
    raise FileNotFoundError(f"Data file not found: {path}")

# Step 2: Load with explicit provider
layer = QgsVectorLayer(path, "Airports", "ogr")

# Step 3: ALWAYS check validity
if not layer.isValid():
    # Step 4: Inspect error string for details
    error = layer.dataProvider().error().message() if layer.dataProvider() else "No provider"
    raise RuntimeError(f"Layer invalid: {error}")

E-002: Wrong URI Format for Provider

Symptoms: Layer is invalid or loads with 0 features. No error message.

Correct URI formats by provider:

ProviderCorrect URICommon Mistake
ogr (Shapefile)"/path/to/file.shp"Missing file extension
ogr (GeoPackage)"/path/to/file.gpkg|layername=roads"Missing |layername= for multi-layer GPKG
ogr (GeoJSON)"/path/to/file.geojson"Using "geojson" as provider name
postgresUse QgsDataSourceUri objectManual string concatenation
wms"crs=EPSG:4326&format=image/png&layers=name&styles&url=https://..."Missing url= parameter
WFS"https://server/wfs?service=WFS&version=2.0.0&request=GetFeature&typename=ns:layer"Wrong provider name (must be uppercase "WFS")
delimitedtext"file:///path/to/file.csv?delimiter=,&xField=lon&yField=lat"Missing file:// prefix
memory"Point?crs=EPSG:4326&field=name:string(50)"Missing geometry type
spatialiteUse QgsDataSourceUri objectRaw path without URI builder
gpx"/path/to/file.gpx?type=track"Missing ?type= parameter

Fix pattern for GeoPackage:

python
# WRONG: loads first layer or fails silently
layer = QgsVectorLayer("/data/data.gpkg", "My Layer", "ogr")

# CORRECT: explicit layer name
layer = QgsVectorLayer("/data/data.gpkg|layername=roads", "Roads", "ogr")

Fix pattern for PostGIS:

python
from qgis.core import QgsDataSourceUri, QgsVectorLayer

# ALWAYS use QgsDataSourceUri: NEVER concatenate strings
uri = QgsDataSourceUri()
uri.setConnection("localhost", "5432", "mydb", "user", "pass")
uri.setDataSource("public", "roads", "geom", "", "gid")

layer = QgsVectorLayer(uri.uri(False), "Roads", "postgres")

E-003: Character Encoding Issues in Shapefile .dbf Files

Symptoms: Attribute values contain garbled characters (mojibake). Accented characters display incorrectly. Field values show é instead of é.

Root cause: Shapefile .dbf files use a code page byte in the header, but many tools write it incorrectly or omit it. QGIS/OGR falls back to system encoding, which may not match the actual encoding.

Fix pattern:

python
from qgis.core import QgsVectorLayer

# Method 1: Set encoding via open options in the URI
layer = QgsVectorLayer(
    "/data/old_data.shp|option:ENCODING=UTF-8",
    "Data", "ogr"
)

# Method 2: Create a .cpg file next to the .shp with the encoding name
# Write "UTF-8" or "ISO-8859-1" to /data/old_data.cpg

# Method 3: Set encoding after loading (for display only)
layer = QgsVectorLayer("/data/old_data.shp", "Data", "ogr")
if layer.isValid():
    layer.dataProvider().setEncoding("UTF-8")

Common encodings to try: UTF-8, ISO-8859-1 (Latin-1), Windows-1252, ISO-8859-15 (Latin-9 with Euro sign).

E-004: GeoPackage File Locking (Concurrent Access)

Symptoms: "database is locked" error. Write operations fail. Layer becomes read-only unexpectedly.

Root cause: GeoPackage uses SQLite, which has limited concurrent write support. Multiple processes or QGIS instances writing to the same .gpkg file cause locking conflicts. WAL (Write-Ahead Logging) mode can help but does not eliminate all issues.

Fix pattern:

python
# Prevention: Use journal_mode=WAL for better concurrent read support
# Set GDAL config option BEFORE loading
from osgeo import gdal
gdal.SetConfigOption("OGR_SQLITE_JOURNAL", "WAL")

# Detection: Check for lock files
import os
gpkg_path = "/data/project.gpkg"
lock_files = [
    gpkg_path + "-wal",
    gpkg_path + "-shm",
    gpkg_path + "-journal"
]
for lock_file in lock_files:
    if os.path.exists(lock_file):
        print(f"Lock file present: {lock_file}")

# Resolution strategies:
# 1. Close all other QGIS instances accessing the file
# 2. Delete stale lock files (-wal, -shm, -journal) ONLY if no process is using the file
# 3. Copy the file, work on the copy, then replace the original
# 4. For multi-user workflows: use PostGIS instead of GeoPackage

E-005: PostGIS Connection Failures

Symptoms: Layer is invalid. Error messages include "could not connect to server", "authentication failed", "permission denied", or "relation does not exist".

Diagnostic checklist:

  1. Network: Can the machine reach the database host and port?
  2. Authentication: Are username/password correct? Is the auth method configured in pg_hba.conf?
  3. Database: Does the database exist? Does the user have CONNECT privilege?
  4. Schema/Table: Does the table exist in the specified schema? Does the user have SELECT privilege?
  5. Geometry column: Does the specified geometry column exist in the table?
  6. Primary key: Is the specified key column a valid unique column?

Fix pattern:

python
from qgis.core import QgsDataSourceUri, QgsVectorLayer

uri = QgsDataSourceUri()
uri.setConnection("dbhost", "5432", "gisdb", "gisuser", "password")
uri.setDataSource("public", "parcels", "geom", "", "gid")

layer = QgsVectorLayer(uri.uri(False), "Parcels", "postgres")
if not layer.isValid():
    # Check provider error for specific failure reason
    provider = layer.dataProvider()
    if provider:
        print(f"Provider error: {provider.error().message()}")
    else:
        print("Provider could not be instantiated — check connection parameters")

# For production: ALWAYS use QgsAuthManager instead of plain passwords
uri_secure = QgsDataSourceUri()
uri_secure.setConnection("dbhost", "5432", "gisdb", "", "")
uri_secure.setAuthConfigId("my_authcfg_id")  # Stored in encrypted qgis-auth.db
uri_secure.setDataSource("public", "parcels", "geom", "", "gid")

NEVER store passwords in plain text URIs in production. ALWAYS use QgsAuthManager with stored authentication configurations.

NEVER load PostGIS views without specifying a unique key column — this causes undefined behavior and performance issues.

E-006: WMS/WFS Timeout or Capability Parsing Errors

Symptoms: WMS layer shows blank tiles or fails to load. WFS layer times out. GetCapabilities returns an XML parsing error.

Root causes:

  1. Service URL is incorrect or unreachable
  2. Layer name does not match the service capabilities
  3. CRS is not supported by the service
  4. Network timeout is too short for slow services
  5. XYZ tile URL placeholders are not URL-encoded

Fix pattern for WMS:

python
from qgis.core import QgsRasterLayer

# CORRECT WMS URI format: note all required parameters
uri = (
    "crs=EPSG:4326"
    "&format=image/png"
    "&layers=my_layer_name"
    "&styles"
    "&url=https://example.com/wms"
)
layer = QgsRasterLayer(uri, "WMS Layer", "wms")
if not layer.isValid():
    print("WMS layer invalid — check URL, layer name, and CRS support")

Fix pattern for XYZ tiles:

python
# ALWAYS URL-encode {z}, {x}, {y} placeholders
url = "type=xyz&url=https://tiles.example.com/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0"
layer = QgsRasterLayer(url, "Tiles", "wms")

NEVER assume a WMS layer supports all CRS — check the GetCapabilities response first.

E-007: Large Dataset Performance Issues

Symptoms: QGIS freezes or runs out of memory. Feature iteration takes excessively long. Script hangs on getFeatures().

Root cause: Loading all features into memory at once for large datasets (>1M features) or iterating without spatial/attribute filters.

Fix pattern:

python
from qgis.core import QgsVectorLayer, QgsFeatureRequest, QgsRectangle

layer = QgsVectorLayer("/data/huge_dataset.gpkg|layername=parcels", "Parcels", "ogr")

# WRONG: loads ALL features into memory
all_features = list(layer.getFeatures())  # Memory explosion for large datasets

# CORRECT: use spatial filter to limit features
bbox = QgsRectangle(100000, 400000, 110000, 410000)
request = QgsFeatureRequest().setFilterRect(bbox)
for feature in layer.getFeatures(request):
    # Process feature
    pass

# CORRECT: use attribute filter
request = QgsFeatureRequest().setFilterExpression('"status" = \'active\'')
for feature in layer.getFeatures(request):
    pass

# CORRECT: limit returned attributes for performance
request = QgsFeatureRequest()
request.setSubsetOfAttributes(["name", "area"], layer.fields())
request.setFlags(QgsFeatureRequest.NoGeometry)  # Skip geometry if not needed
for feature in layer.getFeatures(request):
    pass

# CORRECT: use setLimit() to cap result count
request = QgsFeatureRequest().setLimit(1000)
for feature in layer.getFeatures(request):
    pass

E-008: Missing CRS in Loaded Data

Symptoms: Layer loads but displays at wrong location. Features cluster at origin (0,0). Layer does not align with other layers.

Root cause: Data file has no CRS metadata (missing .prj file for Shapefile, no CRS in GeoJSON, etc.). QGIS assigns a default or no CRS.

Fix pattern:

python
from qgis.core import QgsVectorLayer, QgsCoordinateReferenceSystem

layer = QgsVectorLayer("/data/no_crs.shp", "Data", "ogr")
if layer.isValid():
    # Check if CRS is valid
    if not layer.crs().isValid():
        print(f"WARNING: Layer has no valid CRS")
        # Assign the correct CRS (does NOT reproject — just sets metadata)
        layer.setCrs(QgsCoordinateReferenceSystem("EPSG:28992"))

    # Verify CRS is what you expect
    print(f"Layer CRS: {layer.crs().authid()}")

NEVER confuse setCrs() (assigning metadata) with reprojection (coordinate transformation). setCrs() changes the label, not the coordinates. To reproject, use Processing native:reprojectlayer or QgsCoordinateTransform.

E-009: Shapefile Limitations

Symptoms: Field names truncated to 10 characters. File size capped at 2GB. Date/time fields lose precision. No support for NULL vs empty string.

Root cause: Shapefile is a legacy format with hard limitations from dBASE III.

Known limitations:

LimitationDetails
Field name lengthMaximum 10 characters — names are silently truncated
File sizeMaximum 2GB per component file (.shp, .dbf)
Geometry typesSingle geometry type per file — no mixed geometries
Character encodingRelies on .cpg file or code page byte — unreliable
No NULL supportCannot distinguish NULL from empty string or zero
Date precisionDate only, no time or datetime support in .dbf
No nested fieldsNo support for JSON, arrays, or nested structures

Fix pattern: Migrate to GeoPackage for any new work:

python
import processing

# Convert Shapefile to GeoPackage
processing.run("native:package", {
    'LAYERS': [shapefile_layer],
    'OUTPUT': '/data/output.gpkg',
    'OVERWRITE': True
})

Diagnostic Flowchart

Layer fails to load or behaves unexpectedly
│
├─ Step 1: Does the file/service exist?
│  ├─ NO → Fix the file path or service URL
│  └─ YES ↓
│
├─ Step 2: Is layer.isValid() True?
│  ├─ NO → Check layer.dataProvider().error().message()
│  │  ├─ "Could not connect" → E-005 (PostGIS) or E-006 (WMS/WFS)
│  │  ├─ "not recognized as a supported file format" → E-002 (URI format)
│  │  ├─ "database is locked" → E-004 (GeoPackage locking)
│  │  └─ No provider at all → Wrong provider name in constructor
│  └─ YES ↓
│
├─ Step 3: Does the layer have features?
│  ├─ featureCount() == 0 → Check URI (E-002), filter expression, or empty source
│  └─ featureCount() > 0 ↓
│
├─ Step 4: Are features at the correct location?
│  ├─ NO → Check CRS (E-008) or coordinate order
│  └─ YES ↓
│
├─ Step 5: Are attribute values correct?
│  ├─ Garbled text → E-003 (encoding)
│  ├─ Truncated names → E-009 (Shapefile limits)
│  └─ YES ↓
│
├─ Step 6: Is performance acceptable?
│  ├─ NO → E-007 (large dataset optimization)
│  └─ YES → Layer is working correctly

Fix Patterns Summary

ErrorFirst ActionFallback Action
E-001: Invalid layerVerify file path exists, check provider nameInspect dataProvider().error().message()
E-002: Wrong URICompare URI against format table aboveUse QgsDataSourceUri for database providers
E-003: EncodingCreate .cpg file with correct encodingSet encoding via dataProvider().setEncoding()
E-004: GPKG lockClose other processes accessing the fileDelete stale lock files, switch to PostGIS
E-005: PostGISVerify host/port/db/user/passwordCheck pg_hba.conf, schema permissions
E-006: WMS/WFSVerify service URL in browserCheck GetCapabilities for layer names and CRS
E-007: PerformanceAdd spatial filter to QgsFeatureRequestUse NoGeometry flag, limit attributes
E-008: Missing CRSAssign CRS with setCrs()Create .prj file alongside Shapefile
E-009: Shapefile limitsMigrate to GeoPackageAccept limitations for legacy workflows

Reference Links

Official Sources

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Qgis Errors Data Loading?

Use when diagnosing data loading failures, invalid layers, or provider connection errors. Prevents silent failures from unchecked layer validity and incorrect URI formats. Covers invalid layer detection, URI format errors, encoding issues, GeoPackage locking, connection failures, and performance. Keywords: invalid layer, isValid, data loading error, URI format, encoding, GeoPackage lock, connection failed, provider error, layer won't load, can't open shapefile.

Warum Qgis Errors Data Loading in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Qgis Errors Data Loading besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Qgis Errors Data Loading in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/Impertio-Studio/QGIS-Claude-Skill-Package/tree/main/skills/source/qgis-errors/qgis-errors-data-loading ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Qgis Errors Data Loading nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Qgis Errors Data Loading verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Qgis Errors Data Loading damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Qgis Errors Data Loading kostenlos?

Ja. Der Skill wird von Impertio-Studio auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇