Tutorial
The images displayed in this tutorial come from the qgeologistest
database, available in the sample
folder.
Setup plugin
QGeoloGIS may be activated as a standard QGIS plugin (see Extensions/Manage extensions
).
QGeoloGIS makes two new icons available. They are related to either the depth view or the time view, depending on the type of measurement one wants to plot.
QGeoloGIS implies the use of the QGIS selection tool, so as to select the station(s) where measures should be plotted.
Sample data
The plugin provides sample data.
Postgresql data
QGeoloGIS can use data from a Postgresql database. We provide a project in the repository : project.qgs. Layers in this project are defined with a postgresql service called “qgeologistest” (see Connection service file.
Create a new database first and load the qgeologistest.sql. And create the service entry in the service file.
You will be able to use the project. To rebuild the project, you can use the script generate_config_test.py
GPKG data
QGeoloGIS can also be used with other vector data as GeoPackage. The repository contains a .gpkg with sample data. A project is also save in the .gpkg. To open the project from the GeoPackage, you can :
add a new gpkg connection in the browser panel, the project will appear beside layers.
use the menu Project > Open from > GeoPackage …
If source data are broken, you can launch the script generate_config_gpkg_test.py to rebuild it.
Configure QGeoloGIS
First of all, QGeoloGIS comes with a layer configuration. It describes which layers to use within a project, and amongst them which layers to display by default. The configuration is closely related to the used database.
Setup configuration
Basically, trying to open a plugin view with an unconfigured layer will open a dialog dedicated to the initialization of the layer configuration.
In this dialog, the id and name columns must be specified, they correspond to the layer table. If your table has a elevation column, you can mention it with the ground elevation column parameter.
Then you will be able to open an empty log / temporal dialog. From this dialog, you can use the button to configure a new data visualization. Each visualization is relative to a vector layer in the project.
For log visualizations, you can define :
instantaneous data : each measure is captured at a single elevation
cumulative data : each measure is captured during an interval
continuous data : each entry in the table contains a list of values that are captured from a starting elevation with a defined step.
stratigraphy data : stratigraphy data is defined with interval elevation.
imagery data : imagery are also defined with interval elevation.
For time series visualizations, you can only define instantaneous or cumulative data.
Generate a configuration from a script
In order to bridge the gap between the data stored in the database and the configured layers, which are exploited by the plugin, one may design a Python configuration generation script.
The following screenshots will guide the user during the configuration generation process, by depicting the qgeologistest
example database:
first open the Python console within QGIS:
then open a Python script (for instance,
sample/generate_config_test.py
), or write it (the sample script may be a source of inspiration…):
and just run it:
if everything is OK, some brand new layers (one for station, and the other ones for measurements) will appear in the layer panel:
starting from this point, QGeoloGIS may be used, and some symbology may be applied to the station layer:
Import/export Configuration
As an alternative solution for setting the plugin configuration, one may directly load a .json
configuration from the file system. This is a far more practical way of loading a configuration like those designed for the geologistest
sample…
Alternatively, the configuration may be exported on the file system for further exploitation. Please note that it will be closely linked to the used database; hence a modification of this data source will trouble the future plugin usage.
Plot measures
At this stage, the tutorial makes the assomption that the user has loaded a configuration, hence gets a station layer and some measurements layers.
The next section will be focused on the plugin viewers, available by clicking on the plugin icons:
Note
From here, the station layer must be selected so as to refer to the current configuration.
Log view
The log view allows to visualize any measures expressed with respect to a depth. If a ground elevation column has been configured in the station layer, the log view will use a elevation scale. Otherwise a depth scale will be used. The scale is expressed in meters.
For the geological context, it may include stratigraphy, fracturation rates, or various drilling characteristic. This view supports imagery as well.
By selecting a station with the QGIS selection tool, then clicking on the log view icon, one can get available measurement on this station. In the qgeologistest
example, every measurement is included into the plugin configuration, however the user may have designed a lighter configuration, with only a subset of measure tables.
One may also select several station, in order to compare any measurement between two (or more) stations.
Note
Tip: In QGIS, one may select additional object on the canvas by maintaining the Shift
key when drawing the area of interest with the mouse.
Time view
The time view in QGeoloGIS makes possible to visualize any timestamped event. That may include geology, hydrogeology, weather, chemical analysis, chimney releases, and so on.
The functioning imitates the depth view functioning. The user has to select a station (or more) with the QGIS selection tool, then to click onto the relevant icon. It displays every timestamped measure available for the current station(s).
QGeoloGIS supports histograms as well, if the database contains continuous measurements (defined by a start date and an end date).
Finally, the user may also choose to depicts categorical measurements that comes from the same table. As an example from the qgeologistest
database, one has a chemical_analysis
table that includes several chemical elements:
QGeoloGIS functionalities
The view panels come with additional functionalities that aims at providing more control to the user; especially by interacting with the plugin configuration.
Here are the available actions:
One may hide a measure type from the panel (without dropping it from the configuration). The measure stays hidden while it is not asked to display it again. The measure type must be selected before clicking on the button.
One may display a configured measure type with the button, by picking into the measure type available in the plugin configuration. As the previous functionality, the displayed state will be valid while it is not asked to display the measure again.
It will open a new dialog in which the user will have to choose the measure type he wants to plot.
At this stage, one may exploit the sub selection label to add a specific category if the chosen table needs it (example: a chemical analysis table, that contain a chemical element column).
One may add a new measure type into the configuration with button, hence making the change permanent.
This button will open a QGIS dialog where the user will have to configuration all the parameters associated to the measure, in order to add it into the plugin configuration. The source means the measure (respectively, the table from the database), the type means either Stratigraphic
, Instantaneous
or Continuous
, and other fields refer to the table columns.
One may remove a configured measure type from the configuration or remove all configuration for the layer using the button.
This button will open a QGIS dialog where the user will select the measure type to remove. The user can also remove the global configuration by clicking on the Remove layer configuration
.
Taking advantage of the plugin design, and the richness of QGIS symbologies, one may customize the plot style with the button. The measure type that will be tuned must be selected beforehand.
This functionality open the QGIS symbology dialog, where the plot style may be enhanced. The style modifications are applied every time the corresponding measure type is plotted, whatever the selected station. They are stored in the plugin configuration, and may be saved on the file system for further exploitation as the rest of the configuration content (see Import/export Configuration).
<<<<<<< Updated upstream - One may display the legend of the cell with the button.
Available plot can be selected to be stacked in the current cell.