-
Notifications
You must be signed in to change notification settings - Fork 8
3. Export data
(introduced in plugin version 1.3)
- Select the objects to be exported: select the points in "obs_points" layer and lines in "obs_lines" layer.
- Go to Midvatten menu and select "Midvatten - Export data from database - Export to a set of csv files"
- A File dialog will come up and there you can select a folder for the exported csv files.
Result:
- A csv file will be created for each one of the database tables holding any data for the selected objects (obs_points and obs_lines).
- The csv files will have character encoding "utf-8" and field separators will be semicolon (;).
- The csv files corresponding to the "obs_points" and "obs_lines" tables will not include any geometries.
- The csv file correspondint to the "obs_points" table will include the fields for east and north coordinates so make sure they are updated prior to export.
- Please notice that any csv files that already exists in the selected export directory will silently be over-written.
(introduced in plugin version 1.3)
- Select the objects to be exported: select the points in "obs_points" layer and lines in "obs_lines" layer.
- Go to Midvatten menu and select "Midvatten - Export data from database - Export to another spatialite db"
- After a sanity check there will be a dialog to choose the CRS of the exported database and a file dialog where it is possible to set path and name for the new database.
Result:
- A spatialite database is created with the predefined Midvatten plugin design
- All data corresponding to the selected objects is transferred to the new database
- Geometries and east-north columns in obs_points are transformed to the chosen CRS (introduced in version 1.4)
- (All non-used CRS are deleted from the database to reduce file size)
- A message displaying differences between the old and new database is written to QGis Log Message Panel. Be sure to read this to make sure that everything has been transfered correctly.
(introduced in plugin version 1.4)
Locations/obsids can be exported to the format supported by the iphone and android app FieldLogger https://play.google.com/store/apps/details?id=nl.artesia.fieldlogger
A user wants to make a couple of water related measurements in the field and store them in the FieldLogger application to be able to import them easily to a Midvatten database. As an example, the measurements are depth to water in wells, water flow measurements, some water quality parameters, measure turbidity (while taking a water sample) in the field for some obsids named Rb1, Rb2 and Rb3. All parameters should be measured for Rb1, while at Rb2 only depth to water should be measured and for Rb3 only a comment should be written.
To do this, the user must create a FieldLogger wells-file that define the input fields (the parameters to register measurements for), the locations and their latitude and longitude and this can be done using the Export to FieldLogger Format tool for Midvatten plugin.
An input field in FieldLogger consists of a name, the input type (text, integers, decimals or a combination) and a hint to the user. A location is the name which will be shown in the FieldLogger app map. A location can have one or more sub-locations which can be used to create groups of input fields to make it easier for the field staff.
Setup in the Export to FieldLogger Format tool: (Higher res. image)
If location suffix is used, the final name of a location becomes location + location suffix. This is useful to make distinct locations when the same obsid is used for different wells in several Midvatten project databases *1. (Higher res. image)
If more than one sub-location suffix exists for a location in the fieldlogger app, a second menu will appear after clicking the location in the map. This menu contains all the existing combinations of location + location suffix + sub-location suffix for the chosen location. (Higher res. image)
Clicking on these sub-locations opens the menu containing the input fields for each group as specified in the Export to FieldLogger Format tool. (Higher res. image)
- Go to Midvatten menu and select Midvatten - Export data from database - Export to FieldLogger format
- If this is the first time using the Export to FieldLogger Format tool, only one column with empty boxes will exist under FieldLogger input fields and locations. (Higher res. image)
- Steps 4 to 9 creates input fields. A pre-made default setup can be activated by clicking Default settings and then restarting the Export to fieldlogger dialog. If the default settings isn't enough, then proceed with steps 3-8.
- First, input fields has to be defined using. Click Create Input Fields.
- Use Browse for paramater in database and Browse for unit in database to create an input field name as parameter.unit in the field input field name. When the field parameter and unit is filled, the input field name will be filled automatically (but can be changed by the user if needed).
- Choose a input field type. The most common type for comments is text and numberDecimal|numberSigned for other measurements. This setting tells the fieldlogger app what phone keyboard to use (numbers or text).
- Write a hint that will be presented to the field staff. For example depth to water from highest point. (optional)
- Click Add input field to add the new input field to the list.
- Continue to create all input fields needed. These input fields will be saved in the qgis project by clicking Save settings or Export on the Export fieldlogger dialog and then saving the qgis project. Example: (Higher res. image)
- The next step is to define groups of input fields. Go back to Export Fieldlogger dialog and keep the input field dialog open.
- Use ctrl+c and ctrl+v to copy input fields from the input field dialog into the Input fields box of the first input fields group on the Export Fieldlogger dialog. The input fields in the fieldlogger app will be in the same order as they are in the Input Fields-box
- Enter a sub-location suffix if there will be more than one group. The name of the new group will be location + location suffix + sublocation suffix
- Enter a location suffix if the same obsid is used in more than one database *1.
- If more groups are needed, click the button More Fields and Locations and repeat steps 11-13.
- The last step is to add the locations to the input fields groups. Select the layer obs_points and then select obsids using the map or using the attribute table. Then click the button Paste obs_points selection. The selected obsids will now appear in sorted order in the Locations-box. Use the same method to add locations to the other input fields groups or select locations in a locations-box and use ctrl+c ctrl+v to copy and paste between locations-boxes. *2.
*1: The field staff might want to keep the measurements-file from the Fieldlogger application in the phone to be able to see the previous measurement. But if the field staff make measurements from another project in between these measurements and the same obsid exist for both projects, the measurements would be mixed up if location suffix is not used. *2: If an obsid is located in more than one locations-box, the fieldlogger app will let the user choose between the sub-location when clicking on a location in the map. See the Example above. It's often the case that some obsids will be in all groups (all measurements should be made for them) while other obsid are only in a few groups.
Notes:
- The app will crash if lat and lon fields are not correct (if lat or lon is 'None' for example).
- !!! The exported file must be tested after the export before going onto the field to exclude errors. Check that it can be imported and that the locations are at resonably correct coordinates.
- A suggested setup could be to create groups for the different types of measurements that the field staff makes. For example one group for water level measurements which will be imported to table w_levels, one group for flow measurements (imported to table w_flow), one comment group (imported to table comments) and one or more groups for the table w_qual_field. The w_qual_field groups could be divided into one group for measurements only (ex. quality) and one group for taking water samples (ex. sample) to make it obvious for the field staff when to take water samples and when to only make measurements.
- An advice is to have a comment parameter with text as input type for each sub-location suffix.