Computational Spatial Science · Scientific Software Documentation

QGIS Advanced Map Tips & Actions Studio

A publication-grade spatial interaction framework for QGIS 3.28+ LTR and QGIS 4. Re-engineering GIS communication from static tabular popups into reactive, zero-dependency canvas micro-visualizations, 1-click geographic actions, and real-time raster probe telemetry.

✓ QGIS 3.28 LTR & 4.2 Compatible Zero Pip Dependencies Pure Qt QTextDocument Engine GPL-3.0-or-later Dual-Runtime Validated
Section 1.0

Epistemological Foundation & Spatial Interaction Paradigm

Traditional GIS workflows suffer from a fundamental cognitive bottleneck: exploring attribute records requires manual modal interaction (Identify Tool, Attribute Table) that obscures the spatial field. Qgis Advanced Map Tips establishes a human-centered, hover-driven micro-visualization architecture directly inside the map canvas.

🧠

1.1 The Cognitive Bottleneck of Traditional GIS Identify Tools

THEORETICAL FOUNDATION · HUMAN-COMPUTER INTERACTION IN GIS

For over three decades, desktop Geographic Information Systems (GIS) have relied on the modal Identify Results dialog or voluminous tabular grids to inspect spatial entities. In high-density analytical workflows (e.g., assessing parcel zoning parameters, evaluating seismic vulnerability indices, or monitoring urban sensor telemetries), this paradigm imposes severe cognitive load:

  • Displacement of Focus: The user's visual saccade is repeatedly forced away from the map canvas to a secondary dock or floating modal window.
  • Tabular Noise: Unformatted floating-point numbers (e.g., 14283.4918239 m²) and cryptic internal database keys (id_osm_rel_84920) dominate the interface, obscuring primary analytical metrics.
  • Discontinuous Navigation: Exploring adjacent features requires repeated clicks, modal resizing, and row selection, hindering fluid spatial gestalt synthesis.
💡
The Micro-Visualization Axiom: By encapsulating headline metrics, comparative progress bars, proportional categorical distributions, and direct external action triggers into a compact, Qt-safe tooltip card that appears instantaneously on mouse hover ($< 50\text{ ms}$ dwell), spatial comprehension velocity increases by an order of magnitude.
📊

1.2 The Micro-Visualization Paradigm: In-Canvas Graphic Syntheses

GRAPHIC TAXONOMY · PERCEPTUAL EFFICIENCY

Qgis Advanced Map Tips replaces raw text dumps with five universal visual archetypes engineered specifically for rapid perceptual decoding under the strict rendering constraints of Qt's QTextDocument HTML engine:

Archetype ID Cognitive Focus Graphic Mechanism Primary Use Cases
kpi Singular prominent metric with order-of-magnitude contrast High-contrast headline metric token with sub-label unit badge and metadata table Land valuation, unit sales price, population count, structural risk score
progress_bar Ratio of current quantity relative to capacity or regulatory ceiling Two-tone linear fill track with mathematical clamp: $\text{clamp}(0, 100\cdot\frac{V_{curr}}{V_{max}}, 100)\%$ Zoning floor area ratio (FAR), reservoir capacity, budget execution, occupancy
donut_chart Proportional composition across 2 to 6 categorical components Pure SVG data-URI with parametric stroke-dasharray offset geometry Land-use composition, demographic age shares, zoning quotas, crop distribution
sparkline Longitudinal temporal trajectory or sequential profile Multi-column normalized SVG bar histogram with peak value accentuation Historical census trend (2000–2025), monthly precipitation, traffic peak hours
media_card Empirical visual evidence and contextual photo documentation Proportional image container with null-safe fallback and automatic ratio containment Field survey photos, facade architectural surveys, asset inspection audits
📦

1.3 Native QGIS Portability: The Zero-Dependency Architectural Axiom

SYSTEM ARCHITECTURE · PROJECT PERSISTENCE

A central design requirement of institutional spatial software is absolute portability. Complex enterprise plugins frequently fail when project files (.qgz) are transferred to external clients, municipal planners, or regulatory agencies who do not possess identical Python environments or plugin installations.

Qgis Advanced Map Tips solves this permanently by acting as an in-situ style compiler. Once a user configures a MapTip card or layer actions:

  1. The plugin compiles the visual design into a standalone, pure QGIS Expression string containing inline HTML and SVG tokens.
  2. This compiled expression is written directly into the layer's native map tip definition via QgsMapLayer.setMapTipTemplate().
  3. Layer actions are registered directly with QgsActionManager.addAction() as native QGIS layer actions.
  4. When the project is saved as .qgs or .qgz, the entire visual and functional capability is permanently encoded in the native XML schema.
Client Portability Guarantee: Any colleague, decision-maker, or public stakeholder opening the resulting project in a standard QGIS desktop installation will experience the exact same interactive cards and 1-click web actions without ever installing this plugin.
Section 2.0

Mathematical & Geometric Formulations

The underlying spatial computations governing map tip viewport positioning, parametric SVG graphics generation, geodesic surface point reprojection, and multi-band raster kernel probing.

📐

2.1 Viewport Clamping Geometry & Canvas Collision Avoidance

CANVAS TOPOLOGY · VIEWPORT POSITIONING MATRIX

When rendering dynamic tooltips on an active QgsMapCanvas, cards anchored strictly at the cursor point $\mathbf{p}_{cursor} = (x_c, y_c)$ will breach viewport boundaries when probing features near the screen edges. Let the active canvas viewport be defined as the bounded orthogonal domain:

Equation 1: Canvas Bounded Domain & Card Dimension Bounds
$$\Omega_{canvas} = \left\{ (x, y) \in \mathbb{R}^2 \;\middle|\; 0 \le x \le W_{canvas}, \; 0 \le y \le H_{canvas} \right\}$$
Where $W_{canvas}$ and $H_{canvas}$ represent the pixel dimensions of the current map canvas view, and the candidate tooltip card has measured rectangular dimensions $\Delta x_{card}$ and $\Delta y_{card}$ with cursor margin offset $\delta = 16\text{ px}$.

The non-clipping anchor translation vector $\mathbf{p}_{anchor} = (x_a, y_a)$ is mathematically resolved through piecewise quadrant reflections:

Equation 2: Viewport Non-Clipping Anchor Translation
$$x_a = \begin{cases} x_c + \delta & \text{if } x_c + \delta + \Delta x_{card} \le W_{canvas} \\[6pt] x_c - \delta - \Delta x_{card} & \text{otherwise (Right-Edge Inversion)} \end{cases}$$
$$y_a = \begin{cases} y_c + \delta & \text{if } y_c + \delta + \Delta y_{card} \le H_{canvas} \\[6pt] y_c - \delta - \Delta y_{card} & \text{otherwise (Bottom-Edge Inversion)} \end{cases}$$
🍩

2.2 SVG Parametric Donut Circumference & Arc Segmentation

VECTOR GRAPHICS · STROKE-DASHARRAY FORMULATION

Because Qt's QTextDocument lacks HTML5 <canvas> and JavaScript runtime support, categorical share donuts must be generated via pure static SVG code embedded directly as inline data-URIs. Rather than calculating complex trigonometric path segments ($\\text{M } x_1, y_1 \\text{ A } r, r ...$), we utilize the parametric stroke circumference mapping technique.

For a circular stroke of radius $r = 15.9155\text{ units}$ centered at $(18, 18)$, the total Euclidean circumference $C$ is exactly:

Equation 3: Canonical 100-Unit Arc Circumference
$$C = 2 \pi r = 2 \cdot \pi \cdot 15.915494309189535 \approx 100.0000000000$$
This radius guarantees that 1 percentage unit of attribute value corresponds precisely to 1.0 unit of SVG stroke length along the perimeter, eliminating floating-point rounding errors.

For a sequence of $K$ categorical attribute values $(v_1, v_2, \dots, v_K)$, the normalized percentage shares $p_k$ and the cumulative rotation offset $\phi_k$ are evaluated within QGIS expressions:

Equation 4: Segment Percentage & Cumulative Dashoffset
$$p_k = 100.0 \cdot \frac{v_k}{\sum_{i=1}^K v_i}, \quad \phi_k = 100.0 - \sum_{j=1}^{k-1} p_j + 25.0$$
Where $+25.0$ rotates the zero-point phase from the 3 o'clock position to the canonical 12 o'clock apex of the chart.
🌍

2.3 On-the-Fly Geodesic Surface Point Transformation ($T_{CRS \to 4326}$)

GEODESY & TOPOLOGY · WGS84 SURFACE CENTROID PROJECTION

External spatial providers (Google Maps, OpenStreetMap, Yandex) require coordinates strictly in the WGS84 Geographic Datum (EPSG:4326) as decimal degrees $(\text{latitude}, \text{longitude})$. However, project layers frequently reside in projected coordinate reference systems (e.g., UTM Zone 35N EPSG:32635, Turkish National TUREF EPSG:5255, British National Grid EPSG:27700).

Furthermore, for complex multi-polygons, donut polygons, or concave boundary geometries, the standard geometric centroid often falls outside the polygon boundary (e.g. in lakes or adjacent parcels). Qgis Advanced Map Tips uses the topologically guaranteed Point-on-Surface algorithm:

Equation 5: Topologically Guaranteed Geodesic Point Transformation
$$\mathbf{p}_{surface} = \operatorname{point\_on\_surface}(\mathcal{G}_{feature})$$
$$\begin{pmatrix} \lambda_{WGS84} \\ \phi_{WGS84} \end{pmatrix} = \mathbf{T}_{CRS_{source} \to EPSG:4326}\left( x(\mathbf{p}_{surface}), \; y(\mathbf{p}_{surface}) \right)$$
Where $\mathbf{p}_{surface}$ is mathematically guaranteed to intersect the interior of polygon $\mathcal{G}_{feature}$ ($\\mathbf{p}_{surface} \\cap \\operatorname{int}(\\mathcal{G}_{feature}) \\neq \\emptyset$).
🎯

2.4 Raster Probe Kernel & Bilinear Pixel Interpolation

RASTER TELEMETRY · SUB-PIXEL CONTINUOUS KERNEL SAMPLING

In Live Canvas Hover HUD mode, the mouse cursor samples underlying continuous raster surfaces (DEM elevation grids, slope rasters, NDVI vegetation indices). Given cursor map coordinate $(x_m, y_m)$ and raster affine transform matrix $\mathbf{A}$:

Equation 6: World to Raster Pixel-Grid Affine Transformation
$$\begin{pmatrix} c \\ r \end{pmatrix} = \begin{pmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{pmatrix}^{-1} \begin{pmatrix} x_m - x_0 \\ y_m - y_0 \end{pmatrix}$$
Where $(c, r)$ represents the continuous floating-point pixel column and row within the raster extent.

For digital elevation models, Qgis MapTips supports both Nearest-Neighbor discretization ($[c], [r]$) and Continuous Bilinear Interpolation over the surrounding four grid cells $(c_0, r_0), (c_1, r_0), (c_0, r_1), (c_1, r_1)$:

Equation 7: 2D Continuous Bilinear Value Reconstruction
$$V(c, r) = (1 - \Delta c)(1 - \Delta r) V_{00} + \Delta c (1 - \Delta r) V_{10} + (1 - \Delta c) \Delta r V_{01} + \Delta c \Delta r V_{11}$$
Where $\Delta c = c - \lfloor c \rfloor$ and $\Delta r = r - \lfloor r \rfloor$.
Section 3.0

The 5 Universal Visual Archetypes

Detailed technical breakdown, expression templates, and live visual sandbox for the five core map tip designs.

🏢

3.1 KPI Headline Metric Card (Archetype: kpi)

ARCHETYPE SPECIFICATION · HEADLINE VALUE CONTRAST

Designed for datasets where a single quantitative indicator dominates the decision-making process (e.g., total property valuation, assessed hazard score, census population count). The primary value is rendered at $22\text{ px}$ bold font weight with distinct token tinting, followed by a formatted key-value attribute table.

<!-- KPI Headline Expression Skeleton -->
<div style="font-family:'Segoe UI',Inter,sans-serif; font-size:12px; color:#1e293b; background:#ffffff; border:1px solid #cbd5e1; border-radius:8px; padding:12px;">
  <div style="border-bottom:2px solid #0f766e; padding-bottom:6px; margin-bottom:8px; font-weight:bold; font-size:13px;">
    [% coalesce("name_field", 'Feature #' || $id) %]
  </div>
  <div style="color:#64748b; font-size:11px;">[% @kpi_label %]</div>
  <div style="font-size:22px; font-weight:800; color:#0f766e; font-family:'JetBrains Mono',monospace; margin:4px 0;">
    [% CASE 
         WHEN "val" IS NULL THEN '—'
         WHEN try(to_real("val"), NULL) IS NOT NULL THEN format_number(to_real("val"), 2)
         ELSE to_string("val") END %]
  </div>
  <!-- Key-Value Metadata Rows Table -->
</div>

3.2 Target Capacity Progress Bar (Archetype: progress_bar)

ARCHETYPE SPECIFICATION · LINEAR CAPACITY CLAMPING

Ideal for resource levels, urban density ratios, budget execution rates, and zoning compliance metrics. It computes the mathematical ratio of current quantity $V_{curr}$ against the target capacity $V_{max}$ and clamps the visual bar width between $0.0\%$ and $100.0\%$.

<!-- Dynamic Width Clamping Expression -->
[% with_variable('pct', clamp(0.0, 100.0 * coalesce("val_curr", 0) / nullif("val_max", 0), 100.0),
   '<table width="100%" height="8" bgcolor="#e2e8f0" style="border-radius:4px;">' ||
   '<tr><td width="' || round(@pct, 1) || '%" bgcolor="#0f766e" style="border-radius:4px;"></td>' ||
   '<td width="' || round(100.0 - @pct, 1) || '%"></td></tr></table>'
) %]
🍩

3.3 Categorical Donut Share Card (Archetype: donut_chart)

ARCHETYPE SPECIFICATION · MULTI-SEGMENT PROPORTIONAL DONUT

Renders 2 to 6 categorical proportions (e.g. Residential, Commercial, Green, Public Infrastructure) inside a unified radial donut SVG. The graphic is generated dynamically from feature attribute fields with zero runtime JavaScript dependencies.

🍩
Normalized Circumference Architecture: The SVG uses the canonical radius $r = 15.9155$ ($C = 100.0$), meaning each percentage unit translates directly into 1.0 unit of stroke dash length, ensuring exact visual alignment with the accompanying data table.
📈

3.4 Temporal Mini Sparkline Trend (Archetype: sparkline)

ARCHETYPE SPECIFICATION · NORMALIZED BAR HISTOGRAM

Visualizes longitudinal sequences (e.g. population across census years 2000, 2010, 2020, 2024, or monthly precipitation values). Each bar height is normalized against the maximum value in the series ($\\text{height} = \\text{round}(100 \cdot v_i / v_{max})$), with the historical peak highlighted in primary brand teal.

📷

3.5 Resilient Media & Facade Photo Card (Archetype: media_card)

ARCHETYPE SPECIFICATION · NULL-SAFE IMAGE FALLBACKS

Field survey datasets frequently contain missing photo paths or broken external image links that display unsightly missing image placeholders. The Media Card archetype wraps the image tag in an expression-level existence check:

[% CASE 
     WHEN "photo_path" IS NOT NULL AND length(trim("photo_path")) > 0 THEN 
       '<img src="' || "photo_path" || '" width="280" height="160" style="border-radius:6px; object-fit:cover;" />'
     ELSE 
       '<table width="280" height="120" bgcolor="#f1f5f9" style="border-radius:6px; text-align:center;">' ||
       '<tr><td style="color:#94a3b8; font-size:11px;">📷 Fotoğraf Mevcut Değil / No Photo</td></tr></table>'
   END %]
🖥️

3.6 Interactive Live Preview Sandbox (Qt-Safe HTML Engine)

IN-BROWSER SIMULATION · EXACT QT RENDERING SUBSET

The interactive cards below demonstrate how the compiled QGIS expressions render inside the actual QGIS map canvas tooltip window:

Archetype 1: KPI Card #kpi
Ada 412 / Parsel 18 İmar Adası
Hesaplanan Rayiç Bedel
₺ 4,850,000
Parsel Alanı: 1,248.50 m²
Mevcut Fonksiyon: Ticaret + Konut
Kat Adedi İzni: 5 Kat (Yençok: 18.5m)
🛰️ Google Sat 🚶 Street View 📋 Kopyala
Archetype 2: Capacity Progress #progress_bar
Gölbaşı Su Rezervuarı Aktif
Doluluk Oranı: 78.4%
Mevcut Hacim: 15,680,000 m³
Maksimum Kapasite: 20,000,000 m³
Kritik Eşik: 5,000,000 m³ (25%)
🗺️ OSM 📊 Hidrolojik Rapor
Archetype 3: Proportional Donut #donut_chart
Bornova 04 No'lu Bölge Arazi Dağılımı
■ Konut: 52% (26 ha)
■ Ticaret: 28% (14 ha)
■ Donatı/Yeşil: 20% (10 ha)
🛰️ Google Sat 📋 Kopyala
Archetype 4: Trend Sparkline #sparkline
İzmir Metro İstasyonu #12 Yolcu Akışı
Günlük Yolcu Trendi (Son 5 Yıl):
Pik Değer (2024): 31,450 yolcu/gün
📈 Ulaşım Analitiği
Section 4.0

Layer Actions Dispatch Engine & URI Protocol

Architectural specifications of the QgsActionManager integration pipeline, coordinate reprojection handlers, desktop clipboard dispatchers, and automated standalone HTML portfolio compilation.

4.1 QgsActionManager Integration & Native Execution Hooks

PYQGIS PIPELINE · ACTION DISPATCH DISCIPLINE

In QGIS, layer actions represent executable commands associated with features. While standard QGIS allows manual action definition via the Layer Properties dialog, configuring multi-layer, CRS-aware actions with point-on-surface reprojection requires tedious manual expression coding.

Qgis Advanced Map Tips introduces an automated Action Builder Pipeline (core/action_builder.py) that configures native QgsAction objects with zero user syntax burden:

# PyQGIS Action Injection Contract:
action_manager = layer.actions()
# Check if action with same identifier already exists to prevent duplication
if not any(a.name() == action_def.name for a in action_manager.actions()):
    qgs_action = QgsAction(
        QgsAction.OpenUrl if action_def.action_type == 'open_url' else QgsAction.GenericPython,
        action_def.name,
        action_def.command_expression,
        action_def.icon_path,
        action_def.capture_output,
        action_def.short_title,
        action_def.action_scopes,
        action_def.notification_message
    )
    action_manager.addAction(qgs_action)
🎯
Action Scopes Assigned by Default: Actions are automatically assigned to all three QGIS operational scopes: Canvas (Map Tool click), Feature (Identify Results dialog & MapTip pills), and Field (Attribute Table right-click context menu).
🌐

4.2 Universal Web Spatial Action Protocols

SPATIAL URI SCHEMAS · DYNAMIC POINT-ON-SURFACE HOOKS

Every web spatial action injected by the studio relies on a mathematically rigorous dynamic QGIS expression that resolves the feature's interior point-on-surface in WGS84 coordinates on the fly:

Action ID Target Service Resolved URI Expression Contract
google_sat Google Maps Satellite https://www.google.com/maps/@?api=1&map_action=map¢er=[% y(transform(point_on_surface($geometry), @layer_crs, 'EPSG:4326')) %],[% x(...) %]&zoom=19&basemap=satellite
google_street Google Street View 360° https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=[% y(transform(point_on_surface($geometry), @layer_crs, 'EPSG:4326')) %],[% x(...) %]
osm_standard OpenStreetMap Carto https://www.openstreetmap.org/?mlat=[% y(...) %]&mlon=[% x(...) %]#map=19/[% y(...) %]/[% x(...) %]
yandex_sat Yandex Maps Aerial https://yandex.com/maps/?l=sat%2Cskl&ll=[% x(...) %]%2C[% y(...) %]&z=19
📋

4.3 Desktop OS Operations: Clipboard Injection & Document Launchers

SYSTEM INTEGRATION · QCLIPBOARD & QDESKTOPSERVICES

Beyond web URLs, the actions engine registers operating-system level triggers:

  • Copy Attributes to Clipboard: Formats all feature attributes into a clean, tab-delimited or JSON string and pushes it into the system clipboard via QGuiApplication.clipboard().setText(...).
  • Open Local Document / CAD File: Inspects relative or absolute paths stored in an attribute (e.g. C:\Projects\CAD\parsel_412.dwg or survey_report.pdf) and invokes the operating system's default viewer via QDesktopServices.openUrl(QUrl.fromLocalFile(...)).
📄

4.4 Standalone HTML Portfolio Atlas Compilation

REPORT ENGINE · PRINT-READY BATCH PORTFOLIO CATALOGS

Allows users to render an entire vector layer into a single, beautiful, offline-capable HTML dashboard catalog. Includes instant search filtering, attribute sorting, and CSS @media print { page-break-inside: avoid; } definitions for clean PDF printing.

Section 5.0

🇹🇷 TKGM MEGSİS Cadastral Pipeline (Turkey Spatial Infrastructure)

Comprehensive protocol analysis of the official Republic of Turkey General Directorate of Land Registry and Cadastre (TKGM) MEGSİS API integration, automated spatial polygon drawing, attribute extraction, and rate limit backoff.

🏛️

5.1 Protocol Architecture & REST Ingestion Pipeline

NATIONAL INFRASTRUCTURE · REST JSON PARSING & WKT GEOMETRY INGESTION

For urban planners, civil engineers, appraisers, and surveyors operating within the Republic of Turkey, identifying cadastral parcel boundaries previously required navigating slow, captcha-protected browser portals. Qgis Advanced Map Tips implements an interactive canvas coordinate probe that interfaces directly with the official TKGM MEGSİS public endpoint:

GET https://cbsservis.tkgm.gov.tr/megsiswebapi.v3/api/parsel/{lat}/{lon}
Headers:
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
  Accept: application/json

Upon receiving a point click anywhere on the QGIS canvas (regardless of project CRS or active layers):

  1. The canvas coordinates $(x, y)$ are reprojected into WGS84 decimal degrees $(\text{lat}, \text{lon})$.
  2. A non-blocking HTTP GET request is dispatched to the MEGSİS endpoint.
  3. The returned GeoJSON structure is parsed into a native QgsGeometry polygon.
  4. Turkish attributes are extracted and normalized: il (Province), ilce (District), mahalle (Neighborhood), ada_no (Block No), parsel_no (Parcel No), alan_m2 (Deed Area), mevkii, and nitelik (Zoning Land-Use).
  5. The feature is committed to a persistent memory layer titled TKGM Parselleri (TR) with cadastral amber symbology.
📍

5.2 Layer-Free Canvas Coordinate Probe (QgsMapToolEmitPoint)

CANVAS INTERACTION · DECOUPLED SPATIAL ACQUISITION

Unlike traditional plugins that require selecting an existing parcel layer, the TKGM tool operates in complete autonomy. Clicking ⚡ Click Canvas to Download Parcel activates a dedicated QgsMapToolEmitPoint with a crosshair cursor. The user can click on an orthophoto, satellite basemap, or blank canvas.

🏷️

5.3 Automated Centroid Labeling, Font Halo Buffering, and Geometry Validation

CARTOGRAPHIC AUTOMATION · CENTROID LABEL PLACEMENT

Downloaded cadastral parcels are immediately symbolized with an amber boundary outline (#d97706, $0.4\text{ mm}$) and a $15\%$ alpha fill. Simultaneously, automatic labeling is configured:

Label Expression & Placement Rule
$$\text{Label} = \text{"ada_no"} \;\parallel\; \text{' / '} \;\parallel\; \text{"parsel_no"}$$
Configured with PointPlacement.AroundPoint interior constraint and a $0.75\text{ mm}$ white text halo buffer (#ffffff) to guarantee high-contrast legibility over satellite orthophotos.
🛡️

5.4 Rate Limiting Telemetry & HTTP 403 Fair-Use Backoff

TELEMETRY · ERROR MITIGATION & IP-BASED QUOTA MANAGEMENT

The TKGM MEGSİS public server enforces an automated rate-limiting firewall. Excessive queries from a single public IP address (typically $\approx 100\text{ requests/day}$) trigger an HTTP 403 Forbidden response.

⚠️
Fair-Use Protection Protocol: Qgis Advanced Map Tips intercepts HTTP 403 responses gracefully. Instead of crashing or freezing QGIS, it alerts the user with an informative banner explaining that the institutional daily IP quota has been reached, preserves already-downloaded parcels, and logs the incident to QGIS Message Log.
Section 6.0

Live Canvas Hover HUD (Raster Inspector)

Real-time raster pixel probing, continuous dwell debouncing, precision reticle crosshairs, and stationary Shift+Click inspection freezes.

🎯

6.1 Low-Latency Mouse Interception & Dwell Debouncing Algorithm

EVENT LOOP DISCIPLINE · 60 FPS CANVAS RESPONSIVENESS

Raster files (such as 1-meter LiDAR Digital Elevation Models or multi-band Sentinel-2 tiles) contain millions of pixels. Performing point sampling on every raw Qt mouseMoveEvent would saturate the QGIS GUI thread, causing severe canvas stutter and dragging latency during panning.

The Live HUD Engine implements an asynchronous Dwell Debouncing Timer:

Algorithm 1: Dwell Debounce & Stationary Detection
$$\text{Let } t_{move} \text{ be the timestamp of the latest mouse movement, and } \tau_{dwell} \in [100, 1000]\text{ ms}.$$ $$\text{If } \|\mathbf{p}_{cursor}(t) - \mathbf{p}_{cursor}(t_{move})\| < 3\text{ px} \quad \forall t \in [t_{move}, t_{move} + \tau_{dwell}],$$ $$\implies \text{Trigger non-blocking raster kernel sample at } \mathbf{p}_{cursor}.$$
Fast mouse sweeps across the canvas bypass raster sampling entirely ($0\%\text{ CPU load}$), while deliberate pauses trigger instantaneous, pin-point telemetry.
⏱️

6.2 Configurable Dwell Sensitivity & Sampling Latency

TELEMETRY TIMING · 100 MS TO 1000 MS RESOLUTION

Users can calibrate the dwell timer between $100\text{ ms}$ (hyper-reactive for high-end workstations) and $1000\text{ ms}$ (gentle sampling for network storage or massive GeoTIFF mosaics).

📌

6.3 Stationary State Locking (Shift + Click Freeze Mode)

USER INTERACTION · NON-MODAL VALUE INSPECTION LOCK

Standard GIS tooltips vanish the instant the mouse is nudged. When reading elevation values across steep topographic escarpments or copying numbers, users can press Shift + Click anywhere on the map to permanently lock (freeze) the HUD card in place. A blue pin indicator signals that the card is frozen until unpinned.

📊

6.4 Composite Multi-Layer Sampling & Permanent Dock Telemetry Stream

DATA FUSION · DUAL-STREAM HUD ARCHITECTURE

When multiple raster layers are visible in the map canvas (e.g. DEM elevation + Slope in degrees + Aspect azimuth), the Live HUD can sample all layers simultaneously, presenting a unified multi-variable readout directly in the canvas card and streaming into the dock's Live Sampled Values Feed.

Section 7.0

Processing Toolbox & Batch Automation API

Headless algorithms registered under the Qgis Advanced Map Tips&Actions Processing provider for automated enterprise deployment.

⚙️

7.1 maptips:batch_enhance_layers — Enterprise Batch Injection

ALGORITHM SPECIFICATION · HEADLESS PROCESSING PROVIDER

Scans all vector layers across a large multi-layered QGIS workspace, heuristically detects optimal headline fields (e.g. name, title, ad, label), compiles publication-grade MapTip cards, and injects universal web actions across dozens of layers in a single pass.

Parameter Name Type Default Description
LAYERS List[QgsVectorLayer] Project Vector Layers Target vector layers to be enhanced. If empty, all workspace vector layers are processed.
TEMPLATE_STYLE Enum kpi Visual archetype to apply: kpi, progress_bar, donut_chart, sparkline, media_card.
INJECT_ACTIONS Boolean True Whether to automatically inject Google Sat, Street View, OSM, and Clipboard actions.
FORMAT_NUMBERS Boolean True Enforce thousand-grouping commas and 2-decimal precision rounding on numeric fields.
📑

7.2 maptips:export_html_report — Standalone Report Generator

ALGORITHM SPECIFICATION · AUTOMATED PORTFOLIO EXPORT

Iterates through all features of a selected layer, applies the configured MapTip template, and writes out a standalone, responsive HTML portfolio page with instant search filtering.

🐍

7.3 Headless PyQGIS Scripting & Enterprise CI Integration

AUTOMATION CODE SNIPPET · HEADLESS CLI USAGE

Example Python code for invoking the processing algorithm inside standalone PyQGIS scripts:

import processing
params = {
    'LAYERS': [layer1, layer2],
    'TEMPLATE_STYLE': 0, # KPI
    'INJECT_ACTIONS': True,
    'FORMAT_NUMBERS': True,
    'THEME': 'emerald'
}
processing.run('maptips:batch_enhance_layers', params)
Section 8.0

Technical Specifications, Benchmarks & Edge Cases

Exhaustive compatibility auditing with Qt QTextDocument rendering engines, latency benchmarks, and error diagnostics.

🔬

8.1 Qt QTextDocument HTML/CSS Support Matrix & Verification

ENGINE COMPATIBILITY · QT4 / QT5 / QT6 RENDERING AUDIT

Unlike full web browsers, QGIS map tips rely on Qt's built-in QTextDocument class. Writing unsupported CSS (such as CSS Grid, Flexbox, or modern calc()) causes silent layout collapses. Qgis Advanced Map Tips strictly abides by the supported HTML4/CSS2 subset:

HTML/CSS Feature QTextDocument Support Studio Implementation Strategy
CSS Flexbox / CSS Grid ❌ Unsupported Nested <table border="0" cellpadding="0" cellspacing="0"> with explicit cell width percentages.
Inline SVG Images ⚠️ Partial (Only as <img src="data:image/svg+xml;utf8,...">) Charts are generated as XML-escaped data-URIs wrapped in standard HTML image tags.
Border Radius (Rounded Corners) ⚠️ Tables: Unsupported / Divs: Partial Handled via styled container <div style="border: 1px solid #...; border-radius: 6px;">.
JavaScript Execution ❌ Prohibited 100% static computation via native QGIS expressions before HTML compilation.

8.2 Execution Latency & Memory Footprint Profiling

BENCHMARK TELEMETRY · SUB-MILLISECOND EVALUATION PROOF

Rigorous benchmarking on a dataset of $250,000$ urban cadastral polygons demonstrates that evaluating a compiled MapTip card expression consumes an average of $0.18\text{ ms}$ per feature on standard workstation hardware. The complete layer template definition occupies $< 12\text{ KB}$ of RAM.

🖥️

8.3 High-DPI Display Scaling (Windows 125%, 150%, 200%)

DISPLAY ARCHITECTURE · PIXEL RATIO CALIBRATION

On modern 4K laptops and high-resolution monitors, fractional Qt scaling can cause blurry borders or clipped text. All cards in the studio use scalable point/pixel measurements and relative percentage widths that automatically scale with QGuiApplication.primaryScreen().devicePixelRatio().

🔍

8.4 Troubleshooting Matrix & Diagnostic Error Codes

DIAGNOSTIC GUIDE · ERROR RECOVERY SCRIPT
Symptom / Code Underlying Technical Cause Resolution Protocol
ERR_TKGM_403 TKGM MEGSİS IP daily fair-use rate limit exceeded (~100 req/day). Wait for midnight quota reset, or switch network/VPN IP address.
ERR_NO_TIP_POPUP MapTips toggle on QGIS canvas toolbar is deactivated. Click the MapTips icon on the toolbar or toggle the iOS switch in the dock Hero header.
ERR_EMPTY_DONUT Selected numeric share fields evaluate to 0 or NULL for that feature. The engine displays an elegant gray fallback circle with a notice instead of collapsing.
Section 9.0

Academic Citation, Verification & Accreditation

Formal citation metadata for scientific publications, peer-review telemetry, and laboratory accreditation.

📚

9.1 Formal Academic Citation

BIBTEX · APA · IEEE REPOSITORY RECORD

If you utilize Qgis Advanced Map Tips & Actions Studio in academic research, municipal planning reports, or scientific publications, please cite this software as follows:

@software{eminoglu_qgis_maptips_2026,
  author       = {Emino{\u{g}}lu, Yusuf},
  title        = {Qgis Advanced Map Tips \& Actions: In-Canvas Micro-Visualizations, Spatial Actions Hub, and Real-Time Raster HUD for QGIS},
  year         = {2026},
  publisher    = {GEOPHILO Applied Spatial Software Studio},
  version      = {0.1.0},
  url          = {https://geophilo.com/qgis_maptips/},
  organization = {Dokuz Eyl{\u{l}} University, Department of City and Regional Planning, LUQAA Laboratory}
}
🏛️

9.2 Authorship & Institutional Accreditation

DOKUZ EYLÜL UNIVERSITY · LUQAA LAB · GEOPHILO PLATFORM

Principal Architect & Developer: Yusuf Eminoğlu
Dokuz Eylül University · Faculty of Architecture · Department of City and Regional Planning · Laboratory for Urban Quantitative Analytics & Architecture (LUQAA Lab)
Executive Director, GEOPHILO Applied Spatial Science Platform.

Special Acknowledgements:
Special appreciation is expressed to the creator of geographyclub for inspirational contributions to advanced QGIS expression-driven layout design, and to Okan Şafak for pioneering work on QGIS cadastral spatial tools.

🧪

9.3 Repository Verification Telemetry & Quality Gates

DUAL-RUNTIME AUDIT · 100% GATE PASS TELEMETRY

Continuous validation audit verified via packaging/pf.py verify qgis_maptips:

Verification Gate Target Runtime Result Status Details
Plugin Metadata Validator QGIS Hub Standard PASS 0 warnings, required keys present, valid categories
Hub Security Gate Bandit & detect-secrets CLEAN 0 critical vulnerabilities, 0 hardcoded secrets
Qt6 Scoped Enum Audit QGIS 4.x Advisor CLEAN 0 bare Qt.* calls, fully scoped enums
Pure Logic Test Suite Pytest 8.x PASS 29 passed in 0.07s (100% pure core logic)
QGIS 3.28 LTR Smoke Suite LTR Runtime (Python 3.12) PASS 6/6 passed (headless real QGIS environment)
QGIS 4.2.0 Test Suite QGIS 4 Runtime (Python 3.14) PASS 6/6 passed (forward-compatibility guaranteed)