It’s time to stabilize our relationship with Google setting an API key for go2streetview plugin as from Terms of Service:
The Google Maps API key allows to control Streetview service quota usage. The new plugin release allows to specify the Google Maps API key in the licence dialog window:
A new key can be obtained going to the Google Maps APIs or clicking on “Get a new Google Maps API key” hyperlink in the licence text window.
clicking on Get a Key and specifying a new project
you will finally obtain a API key:
copy the API key text and paste it back into the plugin licence window:
The Qgis plugin allows to build a “on field” mobile survey in few minutes starting from a Qgis layer and get back collected data with the help of Open Data Kit tools and services.
Open Data Kit (ODK) is a free and open-source set of tools which help to manage mobile data collection solutions.
The typical ODK collection workflow is based on the following activities:
- survey form design (XlsForm/XForm)
- deployment of survey forms on ODK collect Android App
- on field data collection by a mobile device
- data aggregation on server
The dedicated Android App suitable for ODK aggregate system is ODK collect and can be freely installed from (Google play store)
The QgisODK plugin generates forms (XlsForm/XForm) directly from loaded datasources converting the Qgis field Types to Odk Types according to Qgis Field Widget, upload ready to use forms to ODK aggregate server (at the moment the plugin supports ona.io and google drive) and retrieve collected data back to QGis.
Let’s follow a QgisODK survey from form creation to data retrieving
1 survey design from layer properties
Design layer properties structure editing the forms tab under qgis layer properties. In this tab fields can be added defining their data type. Furthermore each field can be associated with a specific “edit widget”, the other field properties (comment, alias, WMF, WMS) are not significant for the Qgis ODK plugin. In this case the first field ‘OBJECTID’ is set to Hidden widget, the fields ‘SETTORE’ and ‘CATEGORIA’ are set to a Value Map widget, the fields ‘VETRINA’ and ‘INSEGNA’ are set to Photo widget and all the others are set to Text edit widget (default)
Switching to QgisODK from menu, toolbar or layer context menu appears the main dialog windows showing the field arrangement table and the function buttons. Together with layer fields are exported a geometry field needed for geolocation and a metadata field set, containing some autocompiled field related to submission and the collecting device.
The generated table is ready to be exported or submitted, but it can be edited to customize contents and behaviours of the ODK form. In this case fields with default Edit Widget (TextEdit widget) are casted to the respective ODK types: integer, decimal, text and datetime. The following table describes ODK types, or Question types as mentioned in ODK documentation:
|Question type||Answer input|
|integer||Integer (i.e., whole number) input.|
|text||Free text response.</td>|
|select_one [options]||Multiple choice question; only one answer can be selected.|
|select_multiple [options]||Not supported by QgisODK plugin.|
|note||Not supported by QgisODK plugin|
|geopoint||Collect a single GPS coordinates.|
|geotrace||Record a line of two or more GPS coordinates.|
|geoshape||Record a polygon of multiple GPS coordinates; the last point is the same as the first point.|
|dateTime||Accepts a date and a time input.|
|image||Take a picture.|
|audio||Take an audio recording.|
|video||Take a video recording.|
|barcode||Scan a barcode, requires the barcode scanner app to be installed.|
|calculate||Not supported by QgisODK plugin|
|acknowledge||Not supported by QgisODK plugin|
further details on ODK types and their usage in <a href=”http://xlsform.org/ref-table/”>http://xlsform.org/ref-table/
2 the main dialog window
Fields associated to other Edit widgets are adapted to specific ODK types: CheckBox and ValueMap widgets are converted in select one ODK type translating the user defined values into ODK choices. Hidden edit widget are imported as disabled fields.
Different ODK types define different behaviours in survey forms once imported in mobile device. Here are reported examples the results in the mobile device for each ODK type prompt.
Each field is organized in colums:
- the field name the draggable and collapsible field item, can be dragged to change the survey order or dropped with other fields in group items to generate compacted forms. Each field has several properties:
- enabled to include exclude field from the generated form
- map to to link ODK field to Qgis field making possible syncronization of collected data
- label to insert a friendly answer for the survey field. If leaved blank the field name is uses as label
- ODK type the question type for the survey field, see the next table for all ODK types
- hint to show a hint to help filling the field
- required to set mandatory fields, that are required to close and record the form
- default to set the field to a predefined value
- choiches to define select one value/label table
- appearance to define different behaviors of the survey field in the app, depending from ODK type.
From the main dialog window other functions can be accessed:
- Select a new layer to export as ODK form
- Adding/removing new fields and groups in
- Open/Save the current dialog state as ODK project file
- Setting plugin and web services preferences
- export form to XlsForm file or Xform file
- upload form to current web service
- download collected data from current web service
Survey fields can be reordered and rearranged in groups dragging and dropping table items.
In this example three new groups have been created: DATI GENERALI, CLASSIFICAZIONE e MEDIA.
Single items are showed one by one in mobile app, while grouped items are showed as more compact stacked lists, useful to organize survey in thematic and subsequent steps.
3 Exporting the form
Once organized and rearranged survey fileds, they can be exported for the deployment in the collectors devices. The plugin can export XForm for the direct copy on mobile devioce, XlsForm, which is indeed an Excel spreadsheet and can be directy modified furthermore to implement ODK feature not yet implemented by the plugin or uploaded manually to a ODK-aggregate server that could be installed by the user (ODK-aggregate or FormHub), to a ODK cloud server (ona.io, SurveyCTO, a discontinued FormHub, etc ) or directy upload/download to personal Google Drive/Sheets
At the moment the plugin supports ona.io, with direct simple http authentication and google drive with OAuth2 authentication
4 QgisODK and ona.io
Ona.io is a complete ODK-aggregate service that offers at the moment a free access for 1 private form and for unlimited public forms. The users, the survey admin and the other contributors must sign up to ona.io and subscribe an account. Furthermore survey project have to be shared among data contributors giving proper permissions (can submit, can admim, can edit …). Once logged in we must annotate the project ID used for forms uploading that can be retrieved from the project URL. In this case the project ID of the project is 26283:
At this point the we can setup the plugin opening the setting dialog and inserting the project name, the project ID, the ona.io credentials and conferming with OK at the end:
We are ready now to export the form to ona web service pushing on “export to web service” button on main dialog. If everithing goes right we will get a new form, called as the Qgis layer.
We can now start to collect data using Enketo smart page, a web application integrated in ona.io or by ODK-collect android app once configured with the correct ona.io credentials: https://help.ona.io/guides/data-collection/ and start collecting data with mobile device
As the collectors send back collected data ona.io database is updated:
We are now ready to retrieve data to Qgis pushing “import collected data” button.
The requested data are enriched with a set of metadata related to survey, as submission time, instance UUID to avoid data replication, and geometry fields.
5 QgisODK and google drive
As alternative to Ona.io, QgisODK plugin can use Google drive as support server. In this case the export/import procedure is slightly different. Google drive tab has to be fill and set:
The required parameters helps survey administrator to share forms and import collected data.
- folder: if filled the plugin will export forms in the suggested root subfolder
- data collection table ID: contains the google sheet ID, can be filled manually, if known, or automatically set by plugin when uploading form
- google drive login: the admin google drive login. It will be used for autofill user login in OAuth2 google authenthication
- data collectors emails: a space separated emails of involved collectors. The plugin will automatically share folder and all needed files (forms and data collection table) with all the suggested google drive users
- notifications?: if YES the plugin will send by the supplied admin google login an email message with all needed settings for ODK collect Android App
Pushing “export to web service” button in main dialog, the user will be prompted for google authentication, once authorized the plugin will upload Survey XForm (xml) to google drive in the folder specified in plugin settings under google drive tab, will create a new void data collection table in the same folder filling the data collection table ID field of the setting tab and will share all these documents with the users provided in data collectors emails field.
ODK collect App has to be configured for Google drive:
6 Importing Collected Data
Once survey activity started, the survey admin can import collected data pushing on “import collected data” button. The user select the available table to be imported (only with Ona.io) then configure import parameters in the data in the “import collected data” dialog.
The table can be simply imported or syncronized with an existing layer. In the first case a new layer will be created, in the latter data in the existing layer will be integreted with new data from odk provider. In this case the layer will be set to edited and charged with the new features. A new field called “ODK-UUID” is appended to Qgis Table allowing check to avoid duplicate data.
The first colums of the table enable or disable importing of the field on the right, the second column report all available ODK fields and the third one report the correspondant Qgis field if found. Doing so ODK fields can be mapped to existing Qgis fields.
The last feature option is the ability to download locally the files attached to the survey forms such as images, signatures, videos or audios. The local path can be stored as absolute paths or relative to the project one.
Perfect explanation. I hope will be right for qt5/py3 too
We have begun to realize that there are parts of the QGIS GUI that are still in English, even though we have translated a large amount of the GUI now (up to 82% at time of writing). Of course these parts of the GUI stand out like a sore thumb when the rest of the GUI is in Norwegian. These strings come from elements that are not part of the core QGIS code – mainly plugins.
It is absolutely fantastic that whoever writes a QGIS plugin then decides to release the plugin into the main QGIS plugin repository so others can make use of it. I am a strong believer that if the plugin you write saves you time, there is bound to be someone else, somewhere, who will benefit from it as well.
Plugins are often coded to achieve a certain small task, and understandably, often do not take…
View original post 653 more words
In the last 7.0 release of the plular qgis plugi go2streetview the menu has been re-organized including an “Options” section including some new features. Is now possible to load a layer with the streetview coverage showing the location where the service is available. This new feature was made possible including code portions of TileLayerPlugin by Minoru Aka.
Furthermore, is now possible to toggle visibility of streetview controls checking/unchecking the respective options item.
The Qgis sketch plugin has been updated with one new feature: save and load sketches. Sketches normally are stored in a separate *.sketch file store alongside with project files. The new feature allows to save and load them to/from a user specified location and therefore keep them for backup and sharing with other users.
The plugin has received several main improvements and minor changes:
- Data sources browsing
- Bad Layers Handling
- Expression driven data sources replace
Data source browsing
New data source selection can now be performed by a Qgis browser widget between those currently available. Clicking on browse button in the contextual windows or in in the datasources tables now appears Qgis browser instance where can be specified the new datasource to apply.
Bad Layers Handling
This feature has been developed thanks to Baswein suggestions who contributed with a precious and accurate plugin testing during development.
The plugin can handle bad layers replacing the standard bad layer manager with the datasources table. The new feature has been developed thanks to The standard bad layer manager allows to fix only at the opening of the project.
If not reconciled at the opening of the project, bad layers and their related settings (for example symbologies, labels, joins …) are definitively lost. Furthermore datasources browsing is allowed only for file datasources (OGR and GDAL). For other datasources the only way is to manually modify connection string.
The new feature allows to specify bad layers with missing datasources later, during qgis project session, specifying them with the same plugin methods.
The bad layers handling have to be activated checking “Handle bad layers” checkbox located at the bottom of the main plugin dialog, and restarting QGis.
Once activated the improved Bad Layers Handling, if missing datasources are detected the following dialog appears after loading the project.
The dialog notifies that the bad layers are now handled by changeDatasource plugin.
The bad layers awaiting to be reconciled are keeped with all their properties and settings under the “unhandled layers” group located at the bottom of legend tree.
Bad layers are reconciled specifying a new valid and compatible datasource with the contextual dialog or by the datasources table. Unhandled layers are marked with light brown background
If successfully reconciled the layers are moved from the “unhandled layers” group to their original legend position, preserving in this way the right project draw order.
Expression driven data sources table replacing
The datasource table dialog allows a new method for massive change of layers datasources using expressions. The well known widget can be used to rewrite the datasources using layers properties (filename, data type, provider, geometry type ….) as fields:
Alternate schema support in query definition
Alternate schema support in spatial filters
Fixed issue loading unique values in attribute filter slot