[general]
name=Profili, Sezioni e Comuni
description=IT: Profili altimetrici (con anteprima live ProfiloExpress), sezioni con volumi di sterro/riporto, download DTM, ricerca comuni via ISTAT e confronto prima/dopo. / EN: Elevation profiles (with a live ProfiloExpress preview), cross sections with cut/fill volumes, DTM download, ISTAT-based municipality search and before/after comparison.
about=IT: Strumento avanzato in grafica SPATIQON per profili altimetrici (con anteprima live ProfiloExpress durante il disegno) e con confronto affiancato dello stile "picchettato", sezioni trasversali reali con sterri/riporti/accumuli, disegni tecnici vettoriali, download raster da area SHIFT-draw dagli ZIP ufficiali TINITALY 1.1 e HR-DTM-5m Zenodo con progress/ETA e citazione/licenza, ricerca comuni e confini amministrativi ufficiali direttamente dall'archivio ISTAT (cache locale dopo il primo download, nessuna dipendenza da OpenStreetMap/Nominatim), confronto prima/dopo lavori tra GeoPackage generati dal plugin e tra DTM (raster differenza con volumi di scavo/riporto) con schede risultati separate per Profilo/Sezioni/Confronto, ed esportazioni PNG/PDF/CSV/GPKG/layout QGIS. --- EN: Advanced SPATIQON-style tool for elevation profiles (with a live "ProfiloExpress" preview while drawing) shown side by side with a classic "picchettata" comparison style, real cross sections with cut/fill/stockpile volumes, vector technical drawings, SHIFT-draw raster download from the official TINITALY 1.1 and HR-DTM-5m Zenodo archives with progress/ETA and citation/licence info, municipality search and official administrative boundaries fetched directly from the ISTAT archive (cached locally after the first download, no OpenStreetMap/Nominatim dependency), before/after works comparison between plugin-generated GeoPackages and between DTMs (difference raster with cut/fill volumes) with separate Profile/Sections/Comparison result tabs, and PNG/PDF/CSV/GPKG/QGIS layout exports.
qgisMinimumVersion=3.16
qgisMaximumVersion=4.99
version=1.6.1
author=Dott. Sarino Alfonso Grande
email=info@sinocloud.it
tracker=https://github.com/sag1687/profili/issues
homepage=https://github.com/sag1687/profili
repository=https://github.com/sag1687/profili
category=Raster
icon=icon.svg
tags=elevation,profile,cross-section,municipality,comuni,dem,dtm,terrain,tinitaly,zenodo,istat,cut-fill,comparison,confronto,dod,change-detection
experimental=False
license=GPL-2.0
changelog=1.6.1 - IT: Corretti diversi bug reali trovati con una revisione approfondita del codice: allo scaricamento/aggiornamento del plugin dialog, azione e finestra ProfiloExpress venivano solo nascosti (.close()) e non distrutti, restando agganciati con tutte le loro connessioni all'istanza del plugin. Annullare un disegno col tasto destro lasciava ora la finestra del plugin nascosta e lo strumento di disegno agganciato al canvas senza alcun modo di recupero: ora si chiude la preview ProfiloExpress e si riapre il dialog automaticamente. Corretto un bug nello strumento di disegno: il secondo click del doppio-click per terminare un tracciato veniva sempre interpretato come un nuovo vertice, aggiungendo un segmento fantasma di lunghezza quasi nulla alla fine di ogni profilo/sezione disegnati. Corretti bug di calcolo nelle sezioni trasversali: indici disallineati tra vertici e segmenti su tracciati con doppi click/vertici coincidenti (poteva produrre azimut/raggi di curvatura errati), ZeroDivisionError non protetto per intervallo/campioni pari a zero, calcolo della pendenza di progetto che si azzerava silenziosamente in un caso non gestito. Corretti bug nel confronto DTM prima/dopo: il CRS del raster "dopo" non veniva validato (si assumeva silenziosamente uguale a quello di "prima") e il raster "prima" veniva ricampionato anziche' ritagliato esattamente sulla sua griglia nativa — entrambi potevano falsare i volumi di scavo/riporto calcolati. Aggiunto timeout di rete GDAL mancante sul ritaglio remoto Zenodo HR-DTM-5m, che poteva bloccare l'interfaccia a tempo indefinito; download con nome file temporaneo non piu' prevedibile e pulizia garantita in caso di annullamento/errore. Nuovo strumento "Disegna poligono" nella scheda Download Raster: il raster scaricato viene ora ritagliato esattamente sulla forma disegnata (rettangolo o poligono libero) tramite cutline GDAL, non piu' solo sul rettangolo di inviluppo. Stampa PDF: corretto un bug di posizionamento nei fogli aggiuntivi per grafico, aggiunta numerazione pagine, cartiglio ristilizzato con freccia del nord, cornice mappa e legenda con sfondo/bordo coerenti con la grafica del plugin; corretto un caso in cui un grafico spariva silenziosamente nella scheda Risultati se la conversione SVG->PNG falliva (QTextBrowser non renderizza SVG inline). Rimosso ulteriore codice morto (un fallback di compatibilita' CRS irraggiungibile ripetuto in sei file, una funzione no-op, un ramo mai raggiunto) ed eccezioni troppo ampie ora loggate anziche' silenziate. Nota: queste correzioni sono state verificate rileggendo il codice e con py_compile su tutti i moduli, non ancora con un test end-to-end completo su un ambiente QGIS 4/Qt6 reale. / EN: Fixed several real bugs found via an in-depth code review: on plugin unload/reload the dialog, action and ProfiloExpress preview window were only hidden (.close()) rather than destroyed, staying alive with every connection still attached to the plugin instance. Cancelling a drawing with a right-click used to leave the plugin window hidden and the drawing tool still attached to the canvas with no way back; the ProfiloExpress preview now closes and the dialog reopens automatically in that case. Fixed a drawing-tool bug: the second click of the double-click used to finish a line was always treated as a new vertex, adding a near-zero-length phantom segment at the end of every drawn profile/section. Fixed cross-section calculation bugs: mismatched vertex/segment indices on lines with double-clicked/coincident vertices (could produce wrong azimuths/curve radii), an unguarded ZeroDivisionError for a zero interval or sample count, a design-grade calculation that silently zeroed out in one unhandled case. Fixed before/after DTM comparison bugs: the "after" raster's CRS was never validated (silently assumed equal to "before"'s) and the "before" raster was being resampled instead of exactly cropped to its native grid — both could skew the computed cut/fill volumes. Added a missing GDAL network timeout on the remote Zenodo HR-DTM-5m clip, which could hang the UI indefinitely; download temp files no longer use a predictable name and are now always cleaned up on cancel/error. New "Draw polygon" tool in the Raster Download tab: downloaded rasters are now clipped to the exact drawn shape (rectangle or free-hand polygon) via a GDAL cutline, not just to its bounding box. PDF print: fixed a page-placement bug affecting per-chart sheet titles, added page numbering, restyled the title block with a north arrow, a styled map frame and legend background/border consistent with the plugin's own look; fixed a case where a chart could silently vanish from the Results tab if SVG-to-PNG conversion failed (QTextBrowser cannot render inline SVG). Removed further dead code (an unreachable CRS-compatibility fallback repeated across six files, a no-op function, an unreachable branch) and several overly broad exception handlers now log instead of silently swallowing errors. Note: these fixes were verified by code review and py_compile across every module, not yet with a full end-to-end test on a real QGIS 4/Qt6 environment.
    1.6.0 - IT: Corretto un secondo bug di crash su QGIS 4.2: il comando "Stampa Layout" rimuoveva il layout precedente senza prima chiudere la sua finestra di progettazione ancora aperta, lasciando un riferimento pendente lato QGIS — si verificava con il normale utilizzo ripetuto (disegna, stampa, disegna di nuovo, stampa di nuovo), verificato e risolto su un ambiente QGIS reale. Riscritta la ricerca/download dei confini comunali: prima usava Nominatim con parametri API errati (la ricerca funzionava ma lo scaricamento del confine falliva sempre), ora scarica e mette in cache l'archivio ufficiale ISTAT (confini amministrativi non generalizzati) e lo interroga localmente per singolo comune, senza piu' dipendenza da OpenStreetMap/Nominatim; il checkbox "Usa come area di ritaglio" ora imposta davvero il rettangolo del comune come area nella scheda Download Raster. Rimossi altri 4 blocchi try/except duplicati e inutili nel codice di stampa (residui della migrazione Qt6). Scheda Risultati divisa in tre sotto-schede indipendenti Profilo/Sezioni/Confronto: calcolare le sezioni non cancella piu' il risultato del profilo appena calcolato. Nuovo comando "ProfiloExpress": mentre si disegna l'asse sulla mappa (con un raster locale selezionato), una finestra fluttuante mostra un'anteprima live del profilo altimetrico aggiornata in tempo reale. Verifica end-to-end su un ambiente QGIS/GDAL reale (ricerca/scarico confine ISTAT, stampa/esportazione PDF del layout, anteprima ProfiloExpress, sotto-schede risultati): nessun crash rilevato. / EN: Fixed a second QGIS-4.2 crash bug: the "Print Layout" command removed the previous layout without first closing its still-open design window, leaving a dangling reference on the QGIS side — this happened with completely ordinary repeated use (draw, print, draw again, print again), verified and fixed on a real QGIS environment. Rewrote municipality boundary search/download: it used to call Nominatim with the wrong API parameters (search worked but boundary download always failed), now it downloads and caches the official ISTAT archive (non-generalised administrative boundaries) and queries it locally per municipality, with no more OpenStreetMap/Nominatim dependency; the "Use as clip area" checkbox now actually sets the municipality's bounding box as the area in the Download Raster tab. Removed 4 more duplicate, dead try/except blocks in the print code (leftovers from the Qt6 migration). Results tab split into three independent Profile/Sections/Comparison sub-tabs: computing sections no longer wipes out a just-computed profile result. New "ProfiloExpress" command: while drawing the axis on the map (with a local raster selected), a floating window shows a live elevation-profile preview updated in real time. End-to-end verification on a real QGIS/GDAL environment (ISTAT boundary search/download, layout print/PDF export, ProfiloExpress preview, results sub-tabs): no crash detected.
    1.5.1 - IT: Corretto un bug che poteva causare il crash di QGIS: allo scaricamento del plugin (disattivazione/aggiornamento/ricarica) lo strumento di disegno sulla mappa non veniva mai rimosso dal canvas ne' scollegato dai suoi segnali, lasciando un riferimento pendente lato QGIS — la causa piu' probabile dei crash segnalati su QGIS 4.0. Aggiunta protezione anti-doppio-click su download raster e confronti (GeoPackage/DTM) per evitare operazioni di rete/GDAL sovrapposte durante l'attesa. Rimosso un blocco try/except duplicato e inutile. Corretto un bug di rendering nei grafici SVG->PNG (lo sfondo a tutta pagina non veniva disegnato dal motore SVG di Qt, mascherato finora solo perche' dello stesso colore dello sfondo): ora usa dimensioni esplicite in tutti i generatori di grafici. Nuovo confronto grafico affiancato nella scheda Profilo: accanto al grafico SPATIQON attuale viene mostrato anche uno stile "picchettato" classico (foglio bianco, linea di terreno nera, tacche di progressiva/quota), ispirato al plugin QGIS "Topographic profile" di Giulio Fattori. Rimossa ovunque la denominazione residua "GeoFusion" (gruppo di menu e titolo finestra), non piu' coerente col nome del plugin. / EN: Fixed a bug that could crash QGIS: on plugin unload (disable/update/reload) the map drawing tool was never removed from the canvas nor disconnected from its signals, leaving a dangling reference on the QGIS side — the most likely cause of the crashes reported on QGIS 4.0. Added a double-click guard on raster download and GeoPackage/DTM comparison actions to prevent overlapping network/GDAL operations while one is already running. Removed a redundant, dead try/except block. Fixed an SVG->PNG rendering bug (the full-page background wasn't actually painted by Qt's SVG engine, previously invisible only because it matched the canvas colour): every chart generator now uses explicit pixel dimensions. New side-by-side chart comparison in the Profile tab: alongside the current SPATIQON-style chart, a classic "picchettata" (peg-style) rendering is now shown too (white sheet, black ground line, progressive/elevation tick bands), inspired by the "Topographic profile" QGIS plugin by Giulio Fattori. Removed every remaining "GeoFusion" name (menu group and window title), no longer consistent with the plugin's actual name.
    1.5.0 - IT: Nuova funzione "Crea profilo 3D" nei tab Profilo e Sezioni: genera layer vettoriali Z-enabled (LineStringZ/PointZ) con la quota reale come coordinata Z, visualizzabili nella Vista Mappa 3D di QGIS, piu' un'esportazione opzionale come nuvola di punti LAS 1.2 (scrittore interno, nessuna dipendenza esterna; se l'installazione QGIS non ha il provider PDAL il file resta comunque salvato su disco per software come CloudCompare). Verifica end-to-end su QGIS 4.2/Qt 6.10 reale (apertura plugin, tutte le schede, disegno profilo/sezioni, export GeoPackage con geometrie Z, cambio lingua, chiusura): nessun crash rilevato. / EN: New "Create 3D profile" feature in the Profile and Sections tabs: generates Z-enabled vector layers (LineStringZ/PointZ) with real elevation as the Z coordinate, viewable in QGIS's 3D Map View, plus an optional LAS 1.2 point cloud export (built-in writer, no external dependency; if the QGIS install lacks the PDAL provider the file is still saved to disk for tools like CloudCompare). End-to-end verification on a real QGIS 4.2/Qt 6.10 environment (plugin open, every tab, profile/section drawing, GeoPackage export with Z geometries, language switch, close): no crash detected.
    1.4.2 - IT: Superato il QT6 Check dello store: tutti gli enum Qt e QGIS sono ora in forma pienamente scoped nel sorgente (es. Qgis.MessageLevel.Warning, QgsWkbTypes.GeometryType.PointGeometry), verificati uno a uno sull'ambiente reale QGIS 4.2/Qt 6.10 con test di caricamento automatico. / EN: Store QT6 Check satisfied: every Qt and QGIS enum is now fully scoped in the source (e.g. Qgis.MessageLevel.Warning, QgsWkbTypes.GeometryType.PointGeometry), each one verified on a real QGIS 4.2/Qt 6.10 environment with an automated load test.
    1.4.1 - IT: Azzerate tutte le segnalazioni dell'analizzatore di sicurezza dello store (eccezioni intenzionali annotate, default dei parametri credenziali resi espliciti): la scansione Bandit ora risulta pulita come richiesto per la pubblicazione. / EN: Cleared every finding of the store security analyzer (intentional exception handlers annotated, credential parameter defaults made explicit): the Bandit scan is now clean as required for publication.
    1.4.0 - IT: Compatibilita' Qt6/QGIS 4 verificata integralmente sull'ambiente reale (QGIS 4.2, Qt 6.10): eliminati tutti gli enum in forma non-scoped, test automatico di caricamento superato; rimosso il flag supportsQt6 (non piu' riconosciuto da QGIS); nuova descrizione breve bilingue. / EN: Qt6/QGIS 4 compatibility fully verified on a real environment (QGIS 4.2, Qt 6.10): removed every non-scoped enum, automated load test passed; dropped the supportsQt6 flag (no longer recognised by QGIS); new short bilingual description.
    1.3.7
    - IT: Audit di sicurezza e compatibilità Qt6: verificate tutte le chiamate di rete (solo HTTPS per Nominatim, whitelist schema, timeout, file temporanei sicuri con mkstemp) e il proxy enum Qt5/Qt6; aggiunto il flag ufficiale supportsQt6 per le build QGIS Qt6.
    - EN: Security and Qt6 compatibility audit: verified every network call (HTTPS-only Nominatim, scheme whitelist, timeouts, secure temp files via mkstemp) and the Qt5/Qt6 enum proxy; added the official supportsQt6 flag for QGIS Qt6 builds.
    1.3.6
    - IT: Nuovo diagramma quotato in stile tecnico (linea di terreno/progetto, griglia con tacche quota/progressiva, esagerazione verticale automatica ed etichetta di scala) aggiunto come layer QGIS veri per il profilo e per ogni sezione trasversale; nuovo pulsante Esporta DXF
    - EN: New engineering-style elevation diagram (ground/design line, grid with elevation/chainage ticks, automatic vertical exaggeration and scale label) added as real QGIS layers for the profile and each cross-section; new Export DXF button
    1.3.5
    - IT: Corretto E501 (righe troppo lunghe, PEP8) in core_sections.py, core_confronto.py, core_elevation.py, core_raster_download.py, dialog.py e plugin.py
    - EN: Fixed E501 (line too long, PEP8) in core_sections.py, core_confronto.py, core_elevation.py, core_raster_download.py, dialog.py and plugin.py
    1.3.4
    - IT: Scheda Info: elenco corretto degli altri plugin pubblicati dall'autore su plugins.qgis.org (QGIS Ledger, Q-Press, Quick CRS Fixer, STAC Browser, GeoBridgeIT, TAF Italia)
    - EN: Info tab: correct list of the author's other published plugins on plugins.qgis.org (QGIS Ledger, Q-Press, Quick CRS Fixer, STAC Browser, GeoBridgeIT, TAF Italia)
    - IT: Verifica end-to-end su QGIS 4.2 headless: export GeoPackage, dialog, layout di stampa multi-foglio con legenda/reticolo/scala e confronto DTM
    - EN: End-to-end verification on headless QGIS 4.2: GeoPackage export, dialog, multi-sheet print layout with legend/grid/scale bar and DTM comparison
    1.3.3
    - IT: Hardening sicurezza: validazione esplicita dello schema URL (solo http/https) su tutte le richieste di rete; azzerati gli avvisi Bandit di livello medio/alto
    - EN: Security hardening: explicit URL scheme validation (http/https only) on all network requests; medium/high Bandit findings reduced to zero
    - IT: Stile codice conforme anche a linter severi: eliminati tutti i W503 (a capo prima di operatore binario) ed E241 (spazi multipli dopo virgola)
    - EN: Code style now clean under strict linters too: removed all W503 (line break before binary operator) and E241 (multiple spaces after comma)
    1.3.2
    - IT: Corretto il nome della cartella del pacchetto ZIP (profili_sezioni_comuni) e resa bilingue (IT/EN) tutta la documentazione: descrizione, changelog e README
    - EN: Fixed the ZIP package folder name (profili_sezioni_comuni) and made all documentation bilingual (IT/EN): description, changelog and README
    1.3.1
    - IT: Corretti i metadata per il repository plugin QGIS: aggiunti URL validi per tracker e homepage, repository puntato al progetto GitHub corretto
    - EN: Fixed metadata for the QGIS plugin repository: added valid tracker and homepage URLs, repository pointed to the correct GitHub project
    1.3.0
    - IT: Nuova scheda Confronto: confronto prima/dopo lavori tra GeoPackage generati dal plugin (quote profilo, sezioni, bilancio sterri/riporti) con grafico delta
    - EN: New Comparison tab: before/after works comparison between plugin-generated GeoPackages (profile elevations, sections, cut/fill balance) with delta chart
    - IT: Confronto DTM: raster differenza (dopo - prima) con statistiche, volumi scavo/riporto e stile divergente automatico — calcolo deterministico GDAL/NumPy, senza AI
    - EN: DTM comparison: difference raster (after - before) with statistics, cut/fill volumes and automatic diverging style — deterministic GDAL/NumPy computation, no AI
    - IT: Cartografia PDF/Layout migliorata: legenda per tipologia (ogni voce una sola volta), reticolo con coordinate, barra di scala, cartiglio con grafici in miniatura, un foglio per ogni grafico con tabella attributi
    - EN: Improved PDF/Layout cartography: per-typology legend (each entry once), coordinate grid, scale bar, title block with chart thumbnails, one sheet per chart with attribute table
    - IT: Pulizia codice e rimozione file di cache / EN: Code cleanup and cache files removal
    1.2.0
    - IT: Download raster TINITALY 1.1 ZIP ufficiali e HR-DTM-5m Zenodo con progress/ETA / EN: TINITALY 1.1 official ZIP and Zenodo HR-DTM-5m raster download with progress/ETA
    - IT: Ricerca confini comunali OSM/Nominatim e riferimento ISTAT / EN: OSM/Nominatim municipality boundary search and ISTAT reference
