1. Getting started - jkall/qgis-midvatten-plugin GitHub Wiki

Create a new and empty database

  1. Select Midvatten - Database Management- Create a new empty Midvatten DB
  2. In the pop-up window, select desired locale and coordinate reference system, CRS
  3. Set filepath and -name of database file (.sqlite)
  4. A new database will be created with predefined design. *

*_Warning! If you are running QGIS built on top of SpatiaLite 4.x, then your database will be created according to SpatiaLite 4.x standard. This means the database is NOT backwards compatible in that way it will not run, at least not without some problems, with a QGIS installation built on top of SpatiaLite < 4. If in doubt of your version, create a database and have a look into first row of table about_db. If you are running QGIS on top of SpatiaLite 4.x and want to assure backwards compatibility with SpatiaLite 4.x, then there is a conversion tool named spatialite_convert where you can change a database from spatialite version 4 to version 3. For windows you may download it from here: http://www.gaia-gis.it/gaia-sins/windows-bin-x86/

Midvatten settings

You can access the Midvatten settings panel by:

  • Midvatten Menu - Midvatten Settings
  • press F6
  • click the corresponding button in Midvatten toolbar

The settings panel will let you specify the database to work with.

img

In addition there is a number of tabs with corresponding settings:

  • TSplot -settings for time series plots (F8)

  • XYplot - settings for scatter plots (F9)

  • WQual report - settings for water quality reports (F12)

  • Piper - settings for Piper diagrams

Load default layers

  1. Check in Midvatten-Midvatten Settings that the database is selected in the field SQLite database (otherwise press the "DB" button and select your database)
    img

  2. Load default layers into your qgis project with symbology, custom edit forms and logics* by selecting Midvatten - Load default db-layers (or press F7) and the following layers should appear:
    img

  3. If your project has same CRS as your database, then the project will automatically zoom to the extent of obs_points layer when default layers are loaded.

  • Comment about edit forms for default layers For plugin version >=1.1: The edit forms have been simplified and the form logics removed. There is less user support for data input but a more stable plugin and also user-independent qgis project.

For plugin version <1.1: The custom edit forms and logics, associated with the default layers, were only valid for each user on each machine. Therefore, it was recommended to (re-)load all the default layers every time the project is opened by a new user or opened by the same user on a different machine. The custom form logics were indeed useful but can no longer be maintained due to changes in QGIS API, see for example bug 8636 and https://hub.qgis.org/issues/10739

The old style custom edit forms are still distributed (as .ui files) with the qgis plugin which means that you can, manually, set your layers to use the old forms (but there will be no working form logics). To do this, you will have to manually point to the ui file in midvatten plugin directory, for each layer.

Add observation points and lines

  1. Select the layer obs_points or obs_lines and start editing (click on pen)

  2. Digitize the point or line (eg planned drill point or planned seismic profile) on the map and

  3. Fill out the basic information in the dialog that pops up (the one thing that is absolutely necessary is unique obsid *) (the image shows same form when exploring the attribute table dual view): img
    In plugin version <1.1, the forms were different with som user guidance (pop-up info and red colored field background), here are some info about the old forms.

  4. Finish editing the layer by re-click on the pen

_* Note: you should try to define and use an obsid that applies and is unchanged throughout the project since it gets a little awkward to change it after you have added related information in any of the tables w_levels, stratigraphy, w_qual_lab etc. obsid is the primary link in tables obs_points and obs_lines, the other tables relates to the first two by the field obsid (see database design). _

Add isolated observations of stratigraphy or data for water level, flow or quality

  1. Select the table you want to edit:
  • w_levels to add some water level measurements
  • w_flow to add water flow readings
  • stratigraphy to add some stratigraphy information from e.g. drillings
  • w_qual_lab to add single water quality data from laboratory analysis
  • w_qual_field to add single water quality observation from field measurements
  1. Open the attribute table and

  2. Begin editing the table (click on the pen)

  3. Click "Add feature" icon to get a new row into the table

  4. Fill row (or form depending on which attribute table view you are using), the image below examplifies the forms for w_qual_... tables img

  5. Click save edits (floppy disk icon in attribute table)

  6. Repeat 4-6 for each observation

  7. Finish editing the table by re-click on the pen

  8. Note that more points will appear in the layers obs_p_w_lvl respective obs_p_w_strat indicating that data exists in the tables w_levels and stratigraphy. (In fact layers obs_p_w_lvl and obs_p_w_strat are spatial views in the database.) img

Reset Settings

The plugin stores information about database, tables and columns in the QGIS project file. This may cause the plugin to crash if e.g. the database has been moved.

Therefore an option to reset the settings is included in the plugin. The "reset settings" is found under the plugin submeny "utilities" (no toolbar icon).

Common tasks associated to Function Keys

A few common tasks are associated to function keys F6-F12, namely:

  • F6 - Midvatten Settings
  • F7 - Load Default Layers
  • F8 - Plot Time Series
  • F9 - Plot XY Scatter
  • F10 - Plot Stratigraphy
  • F11 - Show General Report
  • F12 - Show Water Quality Report