Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

Sunday, 25 May 2014

Plot of geological attitudes and traces in vertical sections along fold axes with Quantum GIS and qProf

The new released version of qProf (0.2.4), a Python plugin for Quantum GIS, allows to project geological attitudes and traces onto a vertical section along fold axes. On-the-fly reprojection of layers is supported.

The first step in using this plugin is creating a topographic profile by defining one (or more) source DEMs and a line layer that define the section, plus a line densify distance (generally of the order of the used DEM cell resolution) and an optional line order field (required only when the input geometry of the line layer is not sufficiently simple, see previous posts on the qProf plugin).
While for creating only topographic profiles the input line can be made up of many points and more than one DEM can be used, for geological projections the input line must be made up by just two points and only one DEM may be selected.
After having defined and created the profile using the tools in the "profile" tab, it is then possible to project geological attitudes or traces by using the commands in the "Project" tab.


Projection of geological attitudes

Geological attitudes will be stored in a point layer, with the measured dip direction and dip angle of the features in two distinct fields of the attribute table.
The commands are available from the "Geological attitudes" subwindow.
The projection of geological attitudes may be applied via different methodologies: (a) the nearest intersection point between the geological plane of a feature and the section plane; (b) using a common projection ("fold") axis for all features; (c) using individual axes for each attitude, with two numeric fields storing trend and plunge values.
If some data are selected, only those selected will be plotted, otherwise all layer features will be used. Labels can also be added to projected measures.
It is possible to cumulate in a single analysis session more sub-analyses, distinguishing them via different colors. Previous sub-analyses can be removed with the 'Reset geological attitudes' button.
Data can be saved as csv files or shapefiles.


A plot example, with attitudes labelled by original trend and plunge values, is in the figure below.



Projection of line traces

Line traces can represent the intersection of geological surfaces with the topography. When these surfaces are cylindrically folded, it is possible to projected the traces onto the section via a user-defined fold axis. The elevation information will be derived from the chosen DEM.
The commands are available from the "Geological traces" subwindow.
A line layer has to be chosen, with the name of the id field and a value for the line densification.
Trend and plunge of the projection axis will be defined, and a color chosen for the line plotting.
Different subanalyses, with different projection axes, can be differentiated by using different colors.
Previous analyses can be eliminated with the "Reset traces" command.
Results can be saved as text file, storing id-s-z values (where s is the horizontal distance from the section start) for each resulting point.



An example of the output is below. In this case, only geological traces are plotted. In general, both geological traces and attitudes can be plotted in the same section.



Installation

qProf can be installed from Quantum GIS via the plugin manager, or downloaded and unzipped in the Python plugin folder from:


For bug segnalation:
or write directly to alberti.m65@gmail.com (also for improvement requests or questions).
 

Saturday, 16 March 2013

qProf: un nuovo plugin QuantumGIS per la creazione di profili topografici


Questo è il primo rilascio di QProf, un plugin per la creazione di  profili di elevazione e di pendenza 2D e 3D, a partire da uno o più DEM. E' possibile visualizzare più profili contemporaneamente. I risultati possono essere salvati come dati (shapefiles puntuali e lineari, csv) o immagini. L'idea iniziale nasce da Marco Zanieri e l'implementazione è di Mauro Alberti. Il plugin è installabile direttamente come nuovo plugin in Quantum GIS.

Esempio di profili prodotti da qProf da DEM SRTM2 ed Aster di una zona della Valnerina (Umbria): in alto i profili topografici,  in basso il corrispondente profilo delle pendenze lungo la traccia: valori positivi indicano salite, negativi discese.

Tool analoghi in Quantum GIS

In Quantum GIS sono disponibili almeno altri due moduli che consentono l'elaborazione di profili topografici: Profile Tool di Boris Jurgiel, Etienne Tourigny e Patrice Verchere, e Profile from Line di Ricardo Garcia Silva. Il primo utilizza come traccia di input un percorso "dinamico", definito dall'utente al momento dell'analisi, su uno o più DEM. L'output grafico e tabellare riguarda le elevazioni ma non le pendenze lungo il profilo. Il secondo determina le elevazioni, a spaziatura costante, a partire da un livello lineare e produce come output un livello puntuale con le elevazioni determinate a partire dallo specifico DEM scelto dall'utente. Non viene creato un output grafico. Entrambi i plugin estraggono le elevazioni dai DEM per nearest neighbor.


Descrizione del plugin

Schermata del plugin.


1 - Path shapefile
La traccia del profilo è costituita da una linea singola e continua  (anche se con andamento variabile), contenuta in uno shapefile.

2 -Use DEMs
Come fonte delle elevazioni possono essere scelti i raster DEM che sono già caricati nel progetto QGIS corrente. Ovviamente in ogni raster ci deve essere una sola banda di dati; in caso contrario il modulo fornirà un messaggio di errore. Raster di notevoli dimensioni possono generare errori di memoria del modulo (MemoryError).

3 - Max sampling distance
L'utente definisce la distanza massima di campionamento lungo la traccia del profilo. Questo plugin mantiene tutti i punti di campionamento definiti nel profilo, sia l'inizio, sia quelli interni, sia quello terminale. La spaziatura risultante può essere quindi più fitta, oltre che irregolare,  della max sampling distance.
Il passo di campionamento determinerà la risoluzione spaziale del profilo, incidendo anche, ovviamente sulla distanza cumulativa 3D. Quest'ultima sarà tanto maggiore quanto minore la distanza (fino al limite di risoluzione del DEM), dato che la topografia ha carattere frattale (e.g. Turcotte, 1997).
Si suggerisce di impostare un valore circa analogo a quello della risoluzione dei DEM utilizzati: per esempio per un DEM ASTER si può inserire un valore di 30 m, per un DEM SRTM2 a 90 m un valore di 90 o superiore.

4 - Calculate profile
I dati DEM vengono letti da Python tramite il binding a GDAL. I valori di elevazione per i punti di campionamento sono interpolati per bilinear interpolation a partire dai centri delle quattro celle che racchiudono il punto da interpolare.
Quando viene modificato un parametro di analisi, come p.e. i DEM usati per il profilo, occorre ricalcolare il profilo, altrimenti verrà visualizzato il profilo coi parametri precedentemente calcolati.

5 - Plot
La visualizzazione dei profili si basa sul modulo Matplotlib, che fornisce gli usuali strumenti di zoom, pan, e salvataggio in formato grafico della visualizzazione (SVG, PDF, jpg, etc.).
Lo zoom non funziona in maniera sincronizzata fra i due grafici che rappresentano le elevazioni e le pendenze. Questo aspetto potrebbe essere risolto nelle prossime versioni.

6 - Save full results as
Tutti i dati vengono salvati come informazioni puntuali in formato csv oppure come uno shapefile 2D. Il valore di inclinazione attributo ad ogni punto di campionamento si riferisce al segmento che lo precede immediatamente. Da notare che se il profilo scelta ha il vertice iniziale al di fuori di un DEM utilizzato, la distanza cumulativa 3D non sarà calcolata per nessun punto.

7 - Export 3D line from DEM
E' possibile salvare le informazioni come dati lineari 3D per uno specifico raster. Il formato di output è sempre shapefile.


Possibili modifiche future
Alcuni spunti per possibili futuri miglioramenti del plugin come tipologie di analisi sono elencati nei link sottostanti.
Esempi di integrazione di Grass con R, per il calcolo della dimensione frattale lungo profili topografici, sono riportati in Raster profile along arbitrary line segments del California Soil Resource Lab. Esempi molto interessanti (ed avanzati) di integrazione tra profili topografici ed informazioni geologiche sono presentati in Grass Gis et R: superposition des couleurs d'un raster quelconque sur un profil topographique élaboré à partir d'un MNT di di Martin Laloux, come pure Python: utilisation des couches vectorielles et matricielles dans une perspective géologique, sans logiciel SIG, sempre di Martin Laloux.
E' prevista anche la possibilità di personalizzare la vestizione del profilo, con scelta del rapporto di scala e delle caratteristiche grafiche.


Bibliografia

Turcotte, D. L., 1997. Fractals and Chaos in Geology and Geophysics. Cambridge University Press, 398 pagine.