Giter Site home page Giter Site logo

shivareddyiirs / qrealtime Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 35.0 2.47 MB

This is a QGIS plugin which enables automatic survey form creation from GIS layers and uploading to ODK aggregate server. User can import existing data into GIS layers or enable sync with regular interval.

Home Page: http://shivareddyiirs.github.io/QRealTime

License: GNU General Public License v2.0

Makefile 1.96% Python 96.68% Batchfile 0.68% Shell 0.40% QML 0.26% QMake 0.03%
qgis sync qgis-plugin data-collection form-generator odk

qrealtime's Introduction

Welcome to QRealTime Plugin

flowchart

QRealTime Plugin allows you to:

  • Create new survey form directly from GIS layers in QGIS
  • Synchronise data from ODK Aggregate, KoboToobox, and ODK Central servers
  • Import data from server

Getting Started

Installation

Prerequisites:
  • QGIS installed

Installation steps:

  1. Open Plugin Manager and search for QRealTime plugin and install it.
  2. And restart QGIS so that changes in environment take effect.

Configuration:

From the main menu choose Plugins --> QRealTime --> QRealTime Setting
Here you have three tabs one for Aggregate, KoboToolBox, and Central Choose one of the tabs and Enter url (required).
For Kobo server url can be:
https://kobo.humanitarianresponse.info/ or https://kf.kobotoolbox.org/ for humanitarian and researcher account respectively
Other fields are optional.

You can create a free account in KoboToolbox here
You can set up ODK Central here

QRealTimePic

Using the Plugin:


Right click over any existing layer --> QRealTime and choose desired option:

Make Online (to create new form), import (to import data of existing form), sync (to automatically update your layer)

options


QRealTime plugin is capable of converting QGIS layer into data collection form. To design a data collection form for humanitarian crisis, we have to create appropriate vector layer. For the demonstration purpose, you can create the shapefile with following fields:

tables

Resources:


If you are not sure how to create value map in QGIS, visit this link

For a tutorial on how to use the QRealTime Plugin, check out this video :

qrealtime's People

Contributors

chandnirajasekaran avatar ianmahoney1 avatar joeflack4 avatar maracarolinarojas avatar prabhakaralok avatar rentsendorj avatar rosaguilar avatar samlevy3 avatar shivareddyiirs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qrealtime's Issues

error on installing or enabling

Couldn't load plugin 'QRealTime' due to an error when calling its classFactory() method

FileNotFoundError: [Errno 2] No such file or directory: 'python3': 'python3'
Traceback (most recent call last):
File "/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 50, in
from pyxform.builder import create_survey_element_from_dict
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 665, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'pyxform'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 54, in
subprocess.call(['python3', '-m', 'pip', 'install','pyxform'])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python3': 'python3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 337, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/init.py", line 34, in classFactory
from .QRealTime import QRealTime
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 665, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 58, in
subprocess.call(['python3', '-m', 'pip', 'install','pyxform','--user'])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python3': 'python3'

Python version: 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
QGIS version: 3.2.0-Bonn Bonn, exported

Python Path:
/Applications/QGIS3.app/Contents/MacOS/../Resources/python
/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/gavinfleming/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/mmqgis/forms
/data/CapeTownMarathonGIS/2018

Branch naming: master --> QGIS2

Description

To be consistent with the other branch naming, it might be a good idea to do this. Currently master is rather ambiguous.

Additional information

I can't make a PR because this would require admin permissions, but the following would probably work:

git checkout master; \
git branch -m QGIS2; \
git push -u origin QGIS2

Then go to GitHub settings and designate a new master branch. Possibly QGIS3?
Then:

git push origin --delete master

QRealTime settings window is too small (UI issue)

Hello! This is not a huge issue, but I am on Windows and when I open up the QRealTime settings it has a really small window, and even if I drag to enlarge it it wouldn't automatically resize the window correctly, as shown below. If there is any potential fix I would be happy to help out to iron out this issue.
image
image

please complete the following information):

  • OS: [Windows 10 Pro, 64 bit]
  • QGIS Version [3.16.3]
  • Plugin Version [3.8.1]

Additional context
Add any other context about the problem here.

spatialite fields with name len > 10 no longer imported!

Describe the bug
Using v3.15, spatialite fields with name > 10 chars are no longer imported. The data appears in the import logs but the field in the layer is set to NULL.
Using KoboToolbo server.

To Reproduce

  • Create a Spatialite Db with a geo table and 2 field. One field has a field name = 10 char (e.g. f234567890) and one with a field name of 11 chars (e,g, f12345678901). Create the spatialite layer in QGis.
  • Make online with QRT.
  • Add form data on Kobo Toolbox
  • import the form data in to QGis

Expected behaviour
Expect to see all data imported in to QGis record.
What I see instead, is that data is imported in to the 10char field name. The 11 char field name has value NULL.

At the very least, if fields are truncated at 10 chars, a warning should be issues to the user, but really the 10 limit should only be applied to ESRI shape files.

Screenshots
Data added to the spatialite layer using add point feature.
image

Data after import of record collected in Kobo
image

please complete the following information):

  • OS: Win 10
  • QGIS Version : 3.10.14
  • Plugin Version: QrealTime 3.15

Additional context
The 10 char limit on field names only seems to apply to ESRI Shapefile format. SpatialLite fields can be much longer.
See https://gis.stackexchange.com/questions/21639/why-attribute-name-length-in-qgis-is-limited-to-10-characters

This is the import log from QGis/QRT for the test data above.

2021-02-15T15:52:06 INFO {'nodeset': '/data/Point_Location', 'type': 'geopoint', 'required': 'true()'}None
2021-02-15T15:52:06 INFO geometry field is =Point_Location
2021-02-15T15:52:06 INFO {'nodeset': '/data/f234567890', 'type': 'string'}None
2021-02-15T15:52:06 INFO not writing fieldsNone
2021-02-15T15:52:06 INFO not writing fieldsNone
2021-02-15T15:52:06 INFO 'type'None
2021-02-15T15:52:06 INFO {'nodeset': '/data/f2345678901', 'type': 'string'}None
2021-02-15T15:52:06 INFO not writing fieldsNone
2021-02-15T15:52:06 INFO not writing fieldsNone
2021-02-15T15:52:06 INFO 'type'None
2021-02-15T15:52:06 INFO {'nodeset': '/data/meta/instanceID', 'type': 'string', 'readonly': 'true()', '{http://openrosa.org/javarosa}preload': 'uid'}None
2021-02-15T15:52:06 INFO not writing fieldsNone
2021-02-15T15:52:06 INFO 'type'None
2021-02-15T15:52:06 INFO not writing fieldsNone
2021-02-15T15:52:06 INFO 'type'None
2021-02-15T15:52:06 INFO https://kf.kobotoolbox.org/None
2021-02-15T15:52:06 INFO urldata is https://kf.kobotoolbox.org//api/v2/assets/aciQ4WM4DDTVHDzNkG2UoK/data/None
2021-02-15T15:52:06 INFO requesting url ishttps://kf.kobotoolbox.org//api/v2/assets/aciQ4WM4DDTVHDzNkG2UoK/data/?format=jsonNone
2021-02-15T15:52:06 INFO {'count': 1, 'next': None, 'previous': None, 'results': [{'_id': 85590020, '_notes': [], '_geolocation': [51.7396529, -2.2034051], '_validation_status': {}, '_uuid': 'afad6c95-fdf4-4d68-a126-b4632ea86b4f', '_tags': [], 'f234567890': 'The3', '_submitted_by': 'sladebankwoods', '_xform_id_string': 'aciQ4WM4DDTVHDzNkG2UoK', 'meta/instanceID': 'uuid:afad6c95-fdf4-4d68-a126-b4632ea86b4f', '_status': 'submitted_via_web', 'formhub/uuid': 'a5de41b9fe344913a496af50276eaeec', '_submission_time': '2021-02-15T15:51:49', '_attachments': [], 'f2345678901': 'Three', 'Point_Location': '51.7396529 -2.2034051 138.96000915527344 32.099', 'version': 'vSZzUpLDxxnPFQdEUr4wSK'}]}None
2021-02-15T15:52:06 INFO _idNone
2021-02-15T15:52:06 INFO _notesNone
2021-02-15T15:52:06 INFO _geolocationNone
2021-02-15T15:52:06 INFO _validation_statusNone
2021-02-15T15:52:06 INFO _uuidNone
2021-02-15T15:52:06 INFO _tagsNone
2021-02-15T15:52:06 INFO f234567890None
2021-02-15T15:52:06 INFO _submitted_byNone
2021-02-15T15:52:06 INFO _xform_id_stringNone
2021-02-15T15:52:06 INFO meta/instanceIDNone
2021-02-15T15:52:06 INFO _statusNone
2021-02-15T15:52:06 INFO formhub/uuidNone
2021-02-15T15:52:06 INFO _submission_timeNone
2021-02-15T15:52:06 INFO _attachmentsNone
2021-02-15T15:52:06 INFO f2345678901None
2021-02-15T15:52:06 INFO Point_LocationNone
2021-02-15T15:52:06 INFO Point_LocationNone
2021-02-15T15:52:06 INFO __version__None
2021-02-15T15:52:06 INFO ODKUUIDNone
2021-02-15T15:52:06 INFO before Update LayerNone
2021-02-15T15:52:06 INFO table have some dataNone
2021-02-15T15:52:06 INFO ODKUUIDNone
2021-02-15T15:52:06 INFO [NULL, NULL]None
2021-02-15T15:52:06 INFO geofield isPoint_Location
2021-02-15T15:52:06 INFO {'f234567890': 'The3', 'f2345678901': 'Three', 'Point_Location': '51.7396529 -2.2034051 138.96000915527344 32.099', 'ODKUUID': 'uuid:afad6c95-fdf4-4d68-a126-b4632ea86b4f'}None
2021-02-15T15:52:06 INFO odk id isuuid:afad6c95-fdf4-4d68-a126-b4632ea86b4f
2021-02-15T15:52:06 INFO {'f234567890': 'The3', 'f2345678901': 'Three', 'Point_Location': '51.7396529 -2.2034051 138.96000915527344 32.099', 'ODKUUID': 'uuid:afad6c95-fdf4-4d68-a126-b4632ea86b4f'}None
2021-02-15T15:52:06 INFO POINT(-2.2034051 51.7396529)None
2021-02-15T15:52:06 INFO geom is

TypeError on import of data--support for koboToolbox instances other than humanitarian

Describe the bug
Trying to import data from an example KoBoToolbox form published online and the import fails with this error.

An error has occurred while executing Python code: 

TypeError: string indices must be integers 
Traceback (most recent call last):
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 272, in importData
    service.importData(layer,selectedForm,True)
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 727, in importData
    self.collectData(layer,selectedForm,importData,self.layer_name,self.version,self.geoField)
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 421, in collectData
    response, remoteTable = self.getTable(xFormKey,importData,topElement,version)
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 794, in getTable
    if str(form['id_string'])==XFormKey:
TypeError: string indices must be integers


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.10.1-A Coruña A Coruña, ef24c526da 

Python Path:
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\networks
C:/OSGeo4W64/apps/qgis/./python
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W64/apps/qgis/./python/plugins
C:\OSGeo4W64\bin\python37.zip
C:\OSGeo4W64\apps\Python37\DLLs
C:\OSGeo4W64\apps\Python37\lib
C:\OSGeo4W64\bin
C:\Users\username\AppData\Roaming\Python\Python37\site-packages
C:\OSGeo4W64\apps\Python37
C:\OSGeo4W64\apps\Python37\lib\site-packages
C:\OSGeo4W64\apps\Python37\lib\site-packages\win32
C:\OSGeo4W64\apps\Python37\lib\site-packages\win32\lib
C:\OSGeo4W64\apps\Python37\lib\site-packages\Pythonwin
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\username\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QRealTime
Q:/User/username/Projects/QGIS

To Reproduce
Import data from KoBoToolbox to Memory Layer of type Point.

Expected behavior
Import will not fail on TypeError: string indices must be integers

Screenshots

QGIS version 3.10.1-A Coruña QGIS code revision ef24c526da
Compiled against Qt 5.11.2 Running against Qt 5.11.2
Compiled against GDAL/OGR 3.0.2 Running against GDAL/OGR 3.0.2
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
Compiled against SQLite 3.29.0 Running against SQLite 3.29.0
PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0
QWT Version 6.1.3 QScintilla2 Version 2.10.8
Compiled against PROJ 6.2.1 Running against PROJ Rel. 6.2.1, November 1st, 2019
OS Version Windows 10 (10.0)
Active python plugins CalculateGeometry; MemoryLayerSaver; networks; openlayers_plugin; PluginLoadTimes; QRealTime; realcentroid; refFunctions; snail; SpreadsheetLayers; db_manager; processing

Import while layer is in edit mode throws Error

Describe the bug
One small thing I have noticed is that if you try to import while the layer is in edit mode you get this error message. Would be nice to get a friendly message instead :slight_smile: I have some non-tech users who would be freeked by this!

Goto View-->Panels-->Log Message

An error has occurred while executing Python code: 

AssertionError 
Traceback (most recent call last):
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 278, in importData
    service.importData(layer,selectedForm,True)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime_dialog.py", line 736, in importData
    self.collectData(layer,selectedForm,importData,self.layer_name,self.version,self.geoField)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime_dialog.py", line 427, in collectData
    self.updateLayer(layer,remoteTable,geoField)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime_dialog.py", line 502, in updateLayer
    with edit(layer):
  File "/usr/lib/python3/dist-packages/qgis/core/additions/edit.py", line 38, in __enter__
    assert self.layer.startEditing()
AssertionError

Python version: 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0] 
QGIS version: 3.6.3-Noosa Noosa, 0c5774c 

Python Path:
/usr/share/qgis/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python36.zip
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/home/colin/.local/lib/python3.6/site-packages
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime
/home/colin/proj/qgis-test/relations

To Reproduce

  • put layer in edit mode
  • try to import from Kobo to the layer via QRT
  • see error

Expected behavior
Would be nice to get a message indicating that you cannot import while layer is in edit mode.

please complete the following information):
The system config is as follows:
Linux Ubuntu 18.04
QGIS version: 3.6.3-Noosa
QRealTime 3.12 (upgraded from 3.8.1)

Additional context
Add any other context about the problem here.

Add new Features

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

404.1 error when Importing from ODK Central 1.5

Describe the bug
I get the "not able to connect to server" warning when I connect to ODK Central 1.5.3 deployed with Central when I try to import data from a form. Even though the user and password passes the connection dialogue box and I am able to see all the forms in the project, I get the same error: "not able to connect to server".

To Reproduce
Steps to reproduce the behavior:
Usinng ODK Central version 1.5.3 deployed online

  1. Go to QRealTime
  2. Fille ODK Central credential and the project and validate - no error
  3. Righ click a shapefile layer and chose QRealTime in the menu, then Import
  4. In the dialogue, select the form you wan to import from
  5. Validate

Expected behavior
Normally we expect the layer to start receiving points from the form's data and appearing on the map

Screenshots
We instead receive nothing, but a wanring message saying: "not able to connect to server". After adding a code to read the entire error, I saw it being error 404.1 that says it could not find the requested items. (paraphrased)

please complete the following information):

  • OS: Windows 10
  • QGIS Version 3.22.11
  • Plugin Version [e.g. 4.2.2 (experimental)

Additional context
After checking the python code, I understood that the construction of the argument for the GET command was not correct. Instead of using the name of the form I used changed it to the xmlFormId of the form. The Import works well now with me. But I am not sure to share this version to the GitHub because I can't test the Upload in production. I will be happy to help and see the whole version corrected.

"Make online" no longer works

Describe the bug
I use 'make online' option to create form online and it generates a python error. This did work after the update 3.13 but seems to have stopped working after past week.

Goto View-->Panels-->Log Message
Stacktrace:

An error has occurred while executing Python code: 

KeyError: 'uid' 
Traceback (most recent call last):
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 286, in sendForm
    service.prepareSendForm(layer)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime_dialog.py", line 640, in prepareSendForm
    self.sendForm(layer.name(),payload)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime_dialog.py", line 668, in sendForm
    urlDeploy = self.getValue('url')+"/assets/"+responseJson['uid']+"/deployment/"
KeyError: 'uid'


Python version: 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0] 
QGIS version: 3.6.3-Noosa Noosa, 0c5774c 

Python Path:
/usr/share/qgis/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python36.zip
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/home/colin/.local/lib/python3.6/site-packages
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime
/home/colin/proj/qgis-test/relations

QRT messages

2020-06-01T16:24:35     INFO    not writing fieldsNone
2020-06-01T16:24:35     INFO    'type'None
2020-06-01T16:24:35     INFO    getFieldModelTextEdit
2020-06-01T16:24:35     INFO    getFieldModelTextEdit
2020-06-01T16:24:35     INFO    getFieldModelTextEdit
2020-06-01T16:24:35     INFO    getFieldModelTextEdit
2020-06-01T16:24:35     INFO    getFieldModelExternalResource
2020-06-01T16:24:35     INFO    got an image type fieldNone
2020-06-01T16:24:35     INFO    getFieldModelTextEdit
2020-06-01T16:24:35     INFO    getFieldModelTextEdit
2020-06-01T16:24:35     INFO    fieldDict[{'type': 'geopoint', 'required': True, 'label': 'Point Location'}, {'name': 'tag_no', 'label': 'tag_no', 'type': 'integer'}, {'name': 'tree_no', 'label': 'tree_no', 'type': 'integer'}, {'name': 'species', 'label': 'species', 'type': 'text'}, {'name': 'notes', 'label': 'notes', 'type': 'text'}, {'name': 'photo', 'label': 'Photo', 'type': 'image'}, {'name': 'testInt', 'label': 'testInt', 'type': 'integer'}, {'name': 'testTxt', 'label': 'testTxt', 'type': 'text'}]
2020-06-01T16:24:35     INFO    Payload= {'uid': 'tree-loc-layer', 'name': 'tree-loc-layer', 'asset_type': 'survey', 'content': '{"survey": [{"type": "geopoint", "required": true, "label": "Point Location"}, {"name": "tag_no", "label": "tag_no", "type": "integer"}, {"name": "tree_no", "label": "tree_no", "type": "integer"}, {"name": "species", "label": "species", "type": "text"}, {"name": "notes", "label": "notes", "type": "text"}, {"name": "photo", "label": "Photo", "type": "image"}, {"name": "testInt", "label": "testInt", "type": "integer"}, {"name": "testTxt", "label": "testTxt", "type": "text"}], "choices": []}'}

To Reproduce
Steps to reproduce the behavior:
Open project
goto layer to create online
from QRT menu, "make online"
See error
Check Kobo toolbox and see no form was created

Expected behavior
Create online like it used to.

please complete the following information):

  • OS: Ubuntu 18.04
  • QGIS Version 3.6.3
  • Plugin Version 3.13

Additional context
This used to work after 3.13 update, so I wonder if there has been some change to the Kobo API.
I can still import records from other layers that already have forms on Kobo
I did delete and reinstall the plugin but this made no difference.

"making online" a layer for a second time, an image field can get created with incorrect type.

Describe the bug
Once the ODKUUID field has been added by QRT, adding extra image fields to the layer can lead to 'make online' adding them with the wrong type to Kobo form.
Log:

2020-05-26T15:01:04     INFO    not writing fieldsNone
2020-05-26T15:01:04     INFO    'type'None
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelExternalResource
2020-05-26T15:01:04     INFO    got an image type fieldNone
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelTextEdit
2020-05-26T15:01:04     INFO    getFieldModelExternalResource
2020-05-26T15:01:04     INFO    got an image type fieldNone
2020-05-26T15:01:04     INFO    fieldDict[{'type': 'geopoint', 'required': True, 'label': 'Point Location'}, {'name': 'id', 'label': 'id', 'type': 'integer'}, {'name': 'text1', 'label': 'text1', 'type': 'text'}, {'name': 'int1', 'label': 'int1', 'type': 'integer'}, {'name': 'decimal1', 'label': 'decimal1', 'type': 'decimal'}, {'name': 'image1', 'label': 'image1', 'type': 'image'}, {'name': 'text2', 'label': 'text2', 'type': 'text'}, {'name': 'int2', 'label': 'int2', 'type': 'integer'}, {'name': 'decimal2', 'label': 'decimal2', 'type': 'decimal'}, {'name': 'image2', 'label': 'image2', 'type': 'text'}, {'name': 'text3', 'label': 'text3', 'type': 'image'}]
2020-05-26T15:01:04     INFO    Payload= {'uid': 'test-qrt-to-kobo-export', 'name': 'test-qrt-to-kobo-export', 'asset_type': 'survey', 'content': '{"survey": [{"type": "geopoint", "required": true, "label": "Point Location"}, {"name": "id", "label": "id", "type": "integer"}, {"name": "text1", "label": "text1", "type": "text"}, {"name": "int1", "label": "int1", "type": "integer"}, {"name": "decimal1", "label": "decimal1", "type": "decimal"}, {"name": "image1", "label": "image1", "type": "image"}, {"name": "text2", "label": "text2", "type": "text"}, {"name": "int2", "label": "int2", "type": "integer"}, {"name": "decimal2", "label": "decimal2", "type": "decimal"}, {"name": "image2", "label": "image2", "type": "text"}, {"name": "text3", "label": "text3", "type": "image"}], "choices": []}'}
2020-05-26T15:01:09     INFO    KoboToobox{"url":"https://kf.kobotoolbox.org/api/v2/assets/a6JYenVp9a3ysS8dmKEhYq/permission-assignments/p2nKdnGskPi3ts4ssMByHZ/","user":"https://kf.kobotoolbox.org/api/v2/users/AnonymousUser/","permission":"https://kf.kobotoolbox.org/api/v2/permissions/view_submissions/","label":"View submissions"}

I can see that the fieldDict line is has incorrect field types:

    {'type': 'geopoint', 'required': True, 'label': 'Point Location'}, 
    {'name': 'id', 'label': 'id', 'type': 'integer'}, 
    ....
    {'name': 'text2', 'label': 'text2', 'type': 'text'}, 
    {'name': 'int2', 'label': 'int2', 'type': 'integer'},
     {'name': 'decimal2', 'label': 'decimal2', 'type': 'decimal'},
   >>>  {'name': 'image2', 'label': 'image2', 'type': 'text'},
   >>>  {'name': 'text3', 'label': 'text3', 'type': 'image'}

To Reproduce

  • create a point layer and add an attribute.
  • "make online" this layer.
  • check that the layer is ok and fields are created correctly on Kobo (non-NGO version)
  • delete the form from Kobo
  • go back to the layer in QGis 3
  • add extra fields - a text field (text2), an integer field (int2), a decimal field (decimal2), another text field (image2) and another text field (text3) and save.
  • in the Properties|Attributes form, set the type of image2 to Attachment, untick "Display resource path" and set "integrated doc viewer|type" to "web view" and save.
  • "make online" the layer again
  • go to Kobo forms and edit the form.
  • you will see image2 has type "text" and text3 has type "image"

Expected behavior
image2 field should have type image in the Kobo form.

Screenshots
The incorrect kobo form:
image

please complete the following information):
The system config is as follows:
Linux Ubuntu 18.04
QGIS version: 3.6.3-Noosa
QRealTime 3.12 (upgraded from 3.8.1)

Additional context
This appears to be something to do with the ODKUUID field which is added to the layer the first time it is "made online". Image field seem to get processed out of line.

Also related, if you set ODKUUID field on the layer to be hidden, in the example layer above, the text2 field (after ODKUUID) will be hidden from the Kobo form.

Workaround
This can be corrected manually by exporting the form to XLS in Kobo, updating the field types and then creating a new form/project from the XLS. I think this will only work if there is no data associated with the form.

All Photo Attributs of one Point have the same URL

We have a survey, where we add to one point 2-3 Photos. When we import the collected data the data imports fine except the attributs with contains links to the photos. We usually get the URL of the last photo in every field.

Bildschirmfoto 2023-10-11 um 18 07 51

please complete the following information):

  • selfhosted Kobocollect server
  • OS: MacOS
  • QGIS Version 3.2
  • Plugin Version 4.1

Additional context
Add any other context about the problem here.

Install error in qgis v 3.28.5

I can't install qrealtime version 4.4.4 in QGIS 3.28.5. I receive this error.

No se pudo cargar el complemento 'QRealTime' debido a un error al llamar a su método initGui()

TypeError: setText(self, str): argument 1 has unexpected type 'int'
Traceback (most recent call last):
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 448, in startPlugin
plugins[packageName].initGui()
File "C:\Users/etorr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 216, in initGui
self.add_action(icon_path,text=self.tr(u'QRealTime Setting'),callback=self.run,parent=self.iface.mainWindow())
File "C:\Users/etorr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 174, in add_action
self.dlg = QRealTimeDialog(self)
File "C:\Users/etorr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 114, in init
serviceClass(container,caller)
File "C:\Users/etorr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 159, in init
self.cellWidget(row,1).setText(parameter[1])
TypeError: setText(self, str): argument 1 has unexpected type 'int'

Versión de Python: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Versión de QGIS: 3.28.5-Firenze Firenze, 50adba36f2

Ruta de Python:
C:/OSGeo4W/apps/qgis-ltr/./python
C:/Users/etorr/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/etorr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis-ltr/./python/plugins
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/etorr/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\etorr\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QRealTime
please complete the following information):

  • OS: windows
  • QGIS Version 3.28.5
  • Plugin Version 4.4.4

image

Kobo export/replace xls breaks import

Describe the bug
in Kobo, exporting a form to xls and then using replace to import the xls form def causes QRT import to warn of no version field on form.

Goto View-->Panels-->Log Message

2020-05-28T13:09:04     INFO    {'nodeset': '/data/Point_Location', 'required': 'true()', 'type': 'geopoint'}None
2020-05-28T13:09:04     INFO    geometry field is =Point_Location
2020-05-28T13:09:04     INFO    {'nodeset': '/data/id', 'type': 'int'}None
2020-05-28T13:09:04     INFO    not writing fieldsNone
2020-05-28T13:09:04     INFO    'type'None
2020-05-28T13:09:04     INFO    {'nodeset': '/data/text1', 'type': 'string'}None
2020-05-28T13:09:04     INFO    not writing fieldsNone
2020-05-28T13:09:04     INFO    'type'None
2020-05-28T13:09:04     INFO    {'nodeset': '/data/int1', 'type': 'int'}None
2020-05-28T13:09:04     INFO    not writing fieldsNone
2020-05-28T13:09:04     INFO    'type'None
2020-05-28T13:09:04     INFO    {'nodeset': '/data/decimal1', 'type': 'decimal'}None
2020-05-28T13:09:04     INFO    not writing fieldsNone
2020-05-28T13:09:04     INFO    'type'None
2020-05-28T13:09:04     INFO    {'calculate': "'vxAwtUpfHU4cGoYiQYPveW'", 'nodeset': '/data/__version__', 'type': 'string'}None
2020-05-28T13:09:04     INFO    Reached HiddenNone
2020-05-28T13:09:04     INFO    setting hidden widgetNone
2020-05-28T13:09:04     INFO    {'calculate': "concat('uuid:', uuid())", 'nodeset': '/data/meta/instanceID', 'readonly': 'true()', 'type': 'string'}None
2020-05-28T13:09:04     INFO    not writing fieldsNone
2020-05-28T13:09:04     INFO    'type'None
2020-05-28T13:09:04     INFO    not writing fieldsNone
2020-05-28T13:09:04     INFO    'type'None
2020-05-28T13:09:04     INFO    https://kf.kobotoolbox.org/None
2020-05-28T13:09:04     INFO    urldata is https://kf.kobotoolbox.org//api/v2/assets/ajHjpZqT7E6g7A2gpZtrNt/data/None
2020-05-28T13:09:05     INFO    requesting url ishttps://kf.kobotoolbox.org//api/v2/assets/ajHjpZqT7E6g7A2gpZtrNt/data/?format=jsonNone
2020-05-28T13:09:05     INFO    {'count': 2, 'next': None, 'previous': None, 'results': [{'_notes': [], '__version__': 'vxAwtUpfHU4cGoYiQYPveW', 'meta/instanceID': 'uuid:32206cc9-5e34-4522-94e8-133c8af0bb20', '_attachments': [], '_submission_time': '2020-05-28T12:04:49', 'text1': 't1', '_uuid': '32206cc9-5e34-4522-94e8-133c8af0bb20', '_bamboo_dataset_id': '', '_tags': [], 'id': '886', '_geolocation': [51.746759, -2.197473], '_submitted_by': None, 'int1': '86', '_validation_status': {}, '_xform_id_string': 'ajHjpZqT7E6g7A2gpZtrNt', '_status': 'submitted_via_web', '_id': 54040378, 'Point_Location': '51.746759 -2.197473 0 0', 'decimal1': '86.66', 'formhub/uuid': '9a85a2fb961243698f10b3c93003a7f8'}, {'_notes': [], '__version__': 'vxAwtUpfHU4cGoYiQYPveW', 'meta/instanceID': 'uuid:59d55e9b-ea68-4235-907c-7ce9cb47cf84', '_attachments': [], '_submission_time': '2020-05-28T12:08:43', 'text1': 't2', '_uuid': '59d55e9b-ea68-4235-907c-7ce9cb47cf84', '_bamboo_dataset_id': '', '_tags': [], 'id': '85', '_geolocation': [51.746919, -2.197], '_submitted_by': None, 'int1': '85', '_validation_status': {}, '_xform_id_string': 'ajHjpZqT7E6g7A2gpZtrNt', '_status': 'submitted_via_web', '_id': 54040820, 'Point_Location': '51.746919 -2.197 0 0', 'decimal1': '85.5', 'formhub/uuid': '9a85a2fb961243698f10b3c93003a7f8'}]}None
2020-05-28T13:09:05     INFO    _notesNone
2020-05-28T13:09:05     INFO    __version__None
2020-05-28T13:09:05     INFO    meta/instanceIDNone
2020-05-28T13:09:05     INFO    _attachmentsNone
2020-05-28T13:09:05     INFO    _submission_timeNone
2020-05-28T13:09:05     INFO    text1None
2020-05-28T13:09:05     INFO    _uuidNone
2020-05-28T13:09:05     INFO    _bamboo_dataset_idNone
2020-05-28T13:09:05     INFO    _tagsNone
2020-05-28T13:09:05     INFO    idNone
2020-05-28T13:09:05     INFO    _geolocationNone
2020-05-28T13:09:05     INFO    _submitted_byNone
2020-05-28T13:09:05     INFO    int1None
2020-05-28T13:09:05     INFO    _validation_statusNone
2020-05-28T13:09:05     INFO    _xform_id_stringNone
2020-05-28T13:09:05     INFO    _statusNone
2020-05-28T13:09:05     INFO    _idNone
2020-05-28T13:09:05     INFO    Point_LocationNone
2020-05-28T13:09:05     INFO    Point_LocationNone
2020-05-28T13:09:05     INFO    decimal1None
2020-05-28T13:09:05     INFO    formhub/uuidNone
2020-05-28T13:09:05     INFO    ODKUUIDNone
2020-05-28T13:09:05     INFO    _notesNone
2020-05-28T13:09:05     INFO    __version__None
2020-05-28T13:09:05     INFO    meta/instanceIDNone
2020-05-28T13:09:05     INFO    _attachmentsNone
2020-05-28T13:09:05     INFO    _submission_timeNone
2020-05-28T13:09:05     INFO    text1None
2020-05-28T13:09:05     INFO    _uuidNone
2020-05-28T13:09:05     INFO    _bamboo_dataset_idNone
2020-05-28T13:09:05     INFO    _tagsNone
2020-05-28T13:09:05     INFO    idNone
2020-05-28T13:09:05     INFO    _geolocationNone
2020-05-28T13:09:05     INFO    _submitted_byNone
2020-05-28T13:09:05     INFO    int1None
2020-05-28T13:09:05     INFO    _validation_statusNone
2020-05-28T13:09:05     INFO    _xform_id_stringNone
2020-05-28T13:09:05     INFO    _statusNone
2020-05-28T13:09:05     INFO    _idNone
2020-05-28T13:09:05     INFO    Point_LocationNone
2020-05-28T13:09:05     INFO    Point_LocationNone
2020-05-28T13:09:05     INFO    decimal1None
2020-05-28T13:09:05     INFO    formhub/uuidNone
2020-05-28T13:09:05     INFO    ODKUUIDNone
2020-05-28T13:09:05     INFO    before Update LayerNone
2020-05-28T13:09:05     INFO    table have some dataNone
2020-05-28T13:09:05     INFO    ODKUUIDNone
2020-05-28T13:09:05     INFO    ['uuid:32206cc9-5e34-4522-94e8-133c8af0bb20']None
2020-05-28T13:09:05     INFO    geofield isPoint_Location
2020-05-28T13:09:05     INFO    {'__version__': 'vxAwtUpfHU4cGoYiQYPveW', 'text1': 't1', 'id': '886', 'int1': '86', 'Point_Location': '51.746759 -2.197473 0 0', 'decimal1': '86.66', 'ODKUUID': 'uuid:32206cc9-5e34-4522-94e8-133c8af0bb20'}None
2020-05-28T13:09:05     INFO    odk id isuuid:32206cc9-5e34-4522-94e8-133c8af0bb20
2020-05-28T13:09:05     INFO    {'__version__': 'vxAwtUpfHU4cGoYiQYPveW', 'text1': 't2', 'id': '85', 'int1': '85', 'Point_Location': '51.746919 -2.197 0 0', 'decimal1': '85.5', 'ODKUUID': 'uuid:59d55e9b-ea68-4235-907c-7ce9cb47cf84'}None
2020-05-28T13:09:05     INFO    odk id isuuid:59d55e9b-ea68-4235-907c-7ce9cb47cf84
2020-05-28T13:09:05     INFO    {'__version__': 'vxAwtUpfHU4cGoYiQYPveW', 'text1': 't2', 'id': '85', 'int1': '85', 'Point_Location': '51.746919 -2.197 0 0', 'decimal1': '85.5', 'ODKUUID': 'uuid:59d55e9b-ea68-4235-907c-7ce9cb47cf84'}None
2020-05-28T13:09:05     INFO    POINT(-244568.92127282324 6754493.886283772)None
2020-05-28T13:09:05     INFO    geom is

To Reproduce
Steps to reproduce the behavior:
'Make online' to create a form on Kobo non-ngo. Complete the form using the webform interface and then import the form data to see it all works ok.

  • on Kobo - export the form to XLS

  • on Kobo - replace the form using the exported XLS file.

  • on Kobo - Deploy the updated form

  • on Kobo - complete the form using the web-form interface

  • on kobo - check that the form data has sync'ed to the server and you can see the new form data in the summary.

  • use QRT to import the new form data.

  • see an warning dialog (and in messages) "Can't find __version__ field"

  • the form data point is imported but a new field called "__version_" is added to the layer and set to NULL.

Expected behaviour
The form should import correctly and the version is handled as normal. It should not add a new field to the layer.

please complete the following information):
The system config is as follows:
Linux Ubuntu 18.04
QGIS version: 3.6.3-Noosa
QRealTime 3.12 (upgraded from 3.8.1)

QRT defaults to using Aggregate server even though last used Kobo server

Describe the bug
QRT no longer remembers that I am using Kobo server and defaults to Aggregate server even though I last used Kobo server and Agg svr tab has blank settings. This occurs when trying to "make online" or import via QRT.

Goto View-->Panels-->Log Message
massages tab:

2020-06-01T16:16:22     WARNING    ODK Aggregate : Enter url in settings
2020-06-01T16:16:22     CRITICAL    ODK Aggregate : Can not connect to server

QRT Tab

2020-06-01T16:16:22     INFO    not writing fieldsNone
2020-06-01T16:16:22     INFO    'type'None
2020-06-01T16:16:22     INFO    getFieldModelTextEdit
2020-06-01T16:16:22     INFO    getFieldModelTextEdit
2020-06-01T16:16:22     INFO    getFieldModelTextEdit
2020-06-01T16:16:22     INFO    getFieldModelTextEdit
2020-06-01T16:16:22     INFO    getFieldModelExternalResource
2020-06-01T16:16:22     INFO    got an image type fieldNone
2020-06-01T16:16:22     INFO    getFieldModelTextEdit
2020-06-01T16:16:22     INFO    getFieldModelTextEdit
2020-06-01T16:16:22     INFO    fieldDict[{'name': 'GEOMETRY', 'type': 'geopoint', 'bind': {'required': 'true()'}, 'Appearance': 'maps', 'label': 'add point location'}, {'name': 'tag_no', 'map': 'tag_no', 'label': 'tag_no', 'hint': '', 'type': 'integer', 'bind': {}, 'fieldWidget': 'TextEdit', 'choices': {}}, {'name': 'tree_no', 'map': 'tree_no', 'label': 'tree_no', 'hint': '', 'type': 'integer', 'bind': {}, 'fieldWidget': 'TextEdit', 'choices': {}}, {'name': 'species', 'map': 'species', 'label': 'species', 'hint': '', 'type': 'text', 'bind': {}, 'fieldWidget': 'TextEdit', 'choices': {}}, {'name': 'notes', 'map': 'notes', 'label': 'notes', 'hint': '', 'type': 'text', 'bind': {}, 'fieldWidget': 'TextEdit', 'choices': {}}, {'name': 'photo', 'map': 'photo', 'label': 'Photo', 'hint': '', 'type': 'image', 'bind': {}, 'fieldWidget': 'ExternalResource'}, {'name': 'testInt', 'map': 'testInt', 'label': 'testInt', 'hint': '', 'type': 'integer', 'bind': {}, 'fieldWidget': 'TextEdit', 'choices': {}}, {'name': 'testTxt', 'map': 'testTxt', 'label': 'testTxt', 'hint': '', 'type': 'text', 'bind': {}, 'fieldWidget': 'TextEdit', 'choices': {}}]

To Reproduce
Steps to reproduce the behavior:

  • close QGIS
  • open QGIS and open project with QRT
  • go to layer and QRT menu and "make online"
  • See error message on screen and in log messages.

Expected behavior
To remember that I have set Kobo server settings and use them. OR remember last server used and use that when re-opening the project.

please complete the following information):

  • OS: Ubuntu 18.04
  • QGIS Version 3.6.3
  • Plugin Version 3.13

Additional context
Work around

  • open project
  • goto QRT settings
  • click on Kobo tab and save
  • connects to Kobo server as expected.

no trailing slash on kobo server url cause error with 'make online'

Describe the bug
When using 'make online' to createa layer form on the kobo server (non-ngo), an error is thrown if the kobo server url is missing the trailing slash. The form is created on the Kobo server.

Goto View-->Panels-->Log Message
exception report

An error has occurred while executing Python code: 

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='kf.kobotoolbox.orgapi', port=443): Max retries exceeded with url: /v2/assets/aaUApuSdSeKnaTPdQCioKQ/permission-assignments/ (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond')) 
Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\util\connection.py", line 79, in create_connection
    raise err
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\util\connection.py", line 69, in create_connection
    sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\connection.py", line 314, in connect
    conn = self._new_conn()
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\requests\adapters.py", line 445, in send
    timeout=timeout
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\urllib3\util\retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='kf.kobotoolbox.orgapi', port=443): Max retries exceeded with url: /v2/assets/aaUApuSdSeKnaTPdQCioKQ/permission-assignments/ (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Z600/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 286, in sendForm
    service.prepareSendForm(layer)
  File "C:/Users/Z600/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 640, in prepareSendForm
    self.sendForm(layer.name(),payload)
  File "C:/Users/Z600/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 677, in sendForm
    response3 = requests.post(urlShare, json=permissions, auth=(user,password),headers=headers)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\requests\api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\requests\sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\requests\sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\requests\adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='kf.kobotoolbox.orgapi', port=443): Max retries exceeded with url: /v2/assets/aaUApuSdSeKnaTPdQCioKQ/permission-assignments/ (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.6.3-Noosa Noosa, 0c5774c068 

Python Path:
C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python
C:/Users/Z600/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/Z600/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.6\bin\python37.zip
C:\PROGRA~1\QGIS3~1.6\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib
C:\Program Files\QGIS 3.6\bin
C:\Users\Z600\AppData\Roaming\Python\Python37\site-packages
C:\PROGRA~1\QGIS3~1.6\apps\Python37
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\Pythonwin
C:/Users/Z600/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\Z600\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QRealTime
C:/Users/Z600/Documents/qgis-363

QRealtime output

2020-05-28T14:26:26     INFO    not writing fieldsNone
2020-05-28T14:26:26     INFO    'type'None
2020-05-28T14:26:26     INFO    getFieldModelTextEdit
2020-05-28T14:26:26     INFO    getFieldModelTextEdit
2020-05-28T14:26:26     INFO    getFieldModelTextEdit
2020-05-28T14:26:26     INFO    getFieldModelTextEdit
2020-05-28T14:26:26     INFO    getFieldModelExternalResource
2020-05-28T14:26:26     INFO    got an image type fieldNone
2020-05-28T14:26:26     INFO    fieldDict[{'type': 'geopoint', 'required': True, 'label': 'Point Location'}, {'name': 'id', 'label': 'id', 'type': 'integer'}, {'name': 'text1', 'label': 'text1', 'type': 'text'}, {'name': 'int1', 'label': 'int1', 'type': 'integer'}, {'name': 'decimal1', 'label': 'decimal1', 'type': 'decimal'}, {'name': 'image1', 'label': 'image1', 'type': 'image'}]
2020-05-28T14:26:26     INFO    Payload= {'uid': 'kobo-qrt-test1', 'name': 'kobo-qrt-test1', 'asset_type': 'survey', 'content': '{"survey": [{"type": "geopoint", "required": true, "label": "Point Location"}, {"name": "id", "label": "id", "type": "integer"}, {"name": "text1", "label": "text1", "type": "text"}, {"name": "int1", "label": "int1", "type": "integer"}, {"name": "decimal1", "label": "decimal1", "type": "decimal"}, {"name": "image1", "label": "image1", "type": "image"}], "choices": []}'}

To Reproduce
Steps to reproduce the behavior:

  • set the kobo server url correctly (with slash) and 'make online' to see it work
    -- url: https://kf.kobotoolbox.org/
  • check on the kobo server to see that the form has been created
  • remove the trailing slash on the config url.
    -- url: https://kf.kobotoolbox.org
  • use 'make online' as before, and see the error.
  • check on the kobo server to see that the form has been created

Expected behavior
I would be nice if the plugin could detect this and add the slash, or least provide an error message to indicate the problem.

please complete the following information):

  • OS: Windows 10
  • QGIS Version : 3.6.3
  • Plugin Version : 3.13

Additional context
Add any other context about the problem here.

Password not read at project opening (kobo)

Hello, and thank you a lot for this plugin.

I do not know if the following is a bug or not, bug the plugin do not read the Kobo\password value in the QGIS3.ini at the QGIS project opening. So i have to manually write the password in the UI , each time I open the project to make the connexion happens. I don't know if this behaviour is wanted or not, but It would be nice to avoid this manual intervention.

Thank you a lot for your help.

François

404.1 error when Importing from ODK Central 5.1

Describe the bug
Same as issue #71.
It looks like the API needs xmlFormId and not name to retrieve xml form anymore.

To Reproduce
With ODK Central 5.1

  1. Go to QRealTime
  2. Fill ODK Central credential and the project and validate - no error
  3. Right click a shapefile layer and chose QRealTime in the menu, then Import
  4. In the dialogue, select the form you wan to import from
  5. Validate

Expected behavior
Normally we expect the layer to start receiving points from the form's data and appearing on the map

  • Windows 11 family
  • QGIS 3.28.5
  • Plugin Version 4.4.3

Additional context
Add any other context about the problem here.

Sync is not working in case of Kobo server

Describe the bug
Sync is not working in case of Kobo.

Goto View-->Panels-->Log Message
No error message

To Reproduce
Steps to reproduce the behavior

  1. Goto QRealTime setting
  2. Then choose kobo tab
  3. Enter username and password
  4. Enter sync interval time
  5. Now go to 'layer panel
  6. Right Click on the layer
  7. Enable the checkbox QRealTime-->sync

Expected behavior
It should sync in regular interval

please complete the following information):

  • OS: Windows
  • QGIS Version :3.10
  • Plugin Version:3.9.10

When server url is not written giving runtime error

Describe the bug
A clear and concise description of what the bug is.
Goto View-->Panels-->Log Message
Paste here the content of the 'QRealTime' tab.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

please complete the following information):

  • OS: [e.g. iOS]
  • QGIS Version [e.g. 3.4]
  • Plugin Version [e.g. 3.1]

Additional context
Add any other context about the problem here.

Use native QGIS networkAccessManager API in place of requests

Describe the bug
After installing the plugin, the following message is received:

The plugin is broken. Python said:
No module named requests

To Reproduce
Steps to reproduce the behavior:

  1. Open QGIS.
  2. Open the plugin manager dialogue box and search for QRealTime.
  3. Install
  4. See error

Expected behavior
No error message should be received.

Screenshots
screen shot 2018-12-01 at 12 46 57 pm

Desktop (please complete the following information):

  • OS: MacOS 10.13.6
  • QGIS 2.18.18

Import media filenames not just URLs from Kobo (and maybe Central)

What's the issue?
When importing data from Kobotoolbox any media files (notably images) are represented as URLs in the field of that name. This is good for working online when the server can 'deliver' that content, but if I want to transfer the media files offline I have no easy way of identifying them to view locally (e.g. using the identify tool and using the 'attachment' type in the attributes form). I have also found that images are not always fully rendered, possibly due to bandwidth, so this doesn't work quite as intended (not your problem!).

Looking at the QRT panel I see that the server exposes the URLs in different formats for download
'_attachments': [{'mimetype': 'image/jpeg', 'download_small_url': [URL] 'download_url': [URL]'
as well as the 'raw' data for the field (e.g. 'Photo1': '1597837187890.jpg')

So I assume that QRT is extracting the string from 'download_url' and inserting it into the 'Photo1' field in the QGIS layer.

What would I like?
At the time of import (or possibly sync, for existing layers), it would be good to create a 'duplicate' field with the media filename (as stored on the server and downloaded in zip - see example above for 'Photo1'). This would allow me to use this field as type 'attachment' with a relative path to display media in the attribute form if I have downloaded it from the server to a local folder. For anyone working solely online this will be a redundant field, but if at any time the user wants to use the media attachment, it is immediately available.
I would suggest a suffix to the field e.g. _media so that a layer with Photo1 would also import Photo1_media. A prefix would also be easy to work with (e.g. media_Photo1). This would also avoid any backwards compatibility issues of overwriting previously imported rows / layers with filenames instead of URLs

Work around?
So at the moment I think an calculator expression to extract the filename from the 'end' of the URL into a new field might work or I need to download a csv from the server, join on the UUID field with the QRT layer to allow me to insert that field - but then I've done the hard work manually and QRT doesn't take me forwards :-)
Particularly tedious if the dataset is accumulating so the operation would need to be repeated.

Many thanks for your plugin - I hope this is a useful suggestion.

I don't get the data neither in the table of attributes nor the geometry

I don't get the data neither in the table of attributes nor the geometry
I connect to the server and download the form and its load the structure of the form in the attribute table but no data. I prepare the form in ODK Build. I tried it in the stable version and it works as long as it doesn't have grouped fields. However, in the experimental version it gives me a python error.

Goto View-->Panels-->Log Message
2020-05-15T08:01:54 INFO C:/Users/Mara/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\i18n\QRealTime_es.qm
2020-05-15T08:01:54 INFO None
2020-05-15T08:01:54 INFO None
2020-05-15T08:03:42 INFO key capturedbuild_Conociendo-odk-rev_1589495584None
2020-05-15T08:03:42 INFO [, , , , , , , , , , , , ]None
2020-05-15T08:03:42 INFO {'nodeset': '/data/meta/instanceID', 'type': 'string', 'readonly': 'true()', 'calculate': "concat('uuid:', uuid())"}None
2020-05-15T08:03:42 INFO attrib type isstring
2020-05-15T08:03:42 INFO first attributeinstanceIDNone
2020-05-15T08:03:42 INFO creating new field:instanceIDNone
2020-05-15T08:03:42 INFO Reached HiddenNone
2020-05-15T08:03:42 INFO setting hidden widgetNone
2020-05-15T08:03:42 INFO {'nodeset': '/data/apellido', 'type': 'string', 'required': 'true()', '{http://openrosa.org/javarosa}requiredMsg': "jr:itext('/data/apellido:requiredMsg')", '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/apellido:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isstring
2020-05-15T08:03:42 INFO first attributeapellidoNone
2020-05-15T08:03:42 INFO creating new field:apellidoNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO {'nodeset': '/data/nombre', 'type': 'string', 'required': 'true()', '{http://openrosa.org/javarosa}requiredMsg': "jr:itext('/data/nombre:requiredMsg')", '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/nombre:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isstring
2020-05-15T08:03:42 INFO first attributenombreNone
2020-05-15T08:03:42 INFO creating new field:nombreNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO {'nodeset': '/data/edad', 'type': 'int', 'required': 'true()', '{http://openrosa.org/javarosa}requiredMsg': "jr:itext('/data/edad:requiredMsg')", '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/edad:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isint
2020-05-15T08:03:42 INFO first attributeedadNone
2020-05-15T08:03:42 INFO creating new field:edadNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO {'nodeset': '/data/dia', 'type': 'date', '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/dia:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isdate
2020-05-15T08:03:42 INFO first attributediaNone
2020-05-15T08:03:42 INFO creating new field:diaNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO {'nodeset': '/data/GEOMETRY', 'type': 'geopoint', 'required': 'true()', '{http://openrosa.org/javarosa}requiredMsg': "jr:itext('/data/GEOMETRY:requiredMsg')", '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/GEOMETRY:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isgeopoint
2020-05-15T08:03:42 INFO first attributeGEOMETRYNone
2020-05-15T08:03:42 INFO {'nodeset': '/data/mate', 'type': 'select1', 'required': 'true()', '{http://openrosa.org/javarosa}requiredMsg': "jr:itext('/data/mate:requiredMsg')", '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/mate:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isselect1
2020-05-15T08:03:42 INFO first attributemateNone
2020-05-15T08:03:42 INFO creating new field:mateNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO {'nodeset': '/data/tipo_mate', 'type': 'select', 'relevant': "(selected(/data/mate, 'si'))", '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/tipo_mate:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isselect
2020-05-15T08:03:42 INFO first attributetipo_mateNone
2020-05-15T08:03:42 INFO creating new field:tipo_mateNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO {'nodeset': '/data/imagen', 'type': 'binary', '{http://openrosa.org/javarosa}constraintMsg': "jr:itext('/data/imagen:constraintMsg')"}None
2020-05-15T08:03:42 INFO attrib type isbinary
2020-05-15T08:03:42 INFO first attributeimagenNone
2020-05-15T08:03:42 INFO creating new field:imagenNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO now setting exernal resource widgtNone
2020-05-15T08:03:42 INFO {'nodeset': '/data/usuario', 'type': 'string', '{http://openrosa.org/javarosa}preload': 'property', '{http://openrosa.org/javarosa}preloadParams': 'username'}None
2020-05-15T08:03:42 INFO attrib type isstring
2020-05-15T08:03:42 INFO first attributeusuarioNone
2020-05-15T08:03:42 INFO creating new field:usuarioNone
2020-05-15T08:03:42 INFO Reached HiddenNone
2020-05-15T08:03:42 INFO setting hidden widgetNone
2020-05-15T08:03:42 INFO {'nodeset': '/data/fecha', 'type': 'date', '{http://openrosa.org/javarosa}preload': 'date', '{http://openrosa.org/javarosa}preloadParams': 'today'}None
2020-05-15T08:03:42 INFO attrib type isdate
2020-05-15T08:03:42 INFO first attributefechaNone
2020-05-15T08:03:42 INFO creating new field:fechaNone
2020-05-15T08:03:42 INFO Reached HiddenNone
2020-05-15T08:03:42 INFO setting hidden widgetNone
2020-05-15T08:03:42 INFO {'nodeset': '/data/start_time', 'type': 'dateTime', '{http://openrosa.org/javarosa}preload': 'timestamp', '{http://openrosa.org/javarosa}preloadParams': 'start'}None
2020-05-15T08:03:42 INFO attrib type isdateTime
2020-05-15T08:03:42 INFO first attributestart_timeNone
2020-05-15T08:03:42 INFO creating new field:start_timeNone
2020-05-15T08:03:42 INFO Reached HiddenNone
2020-05-15T08:03:42 INFO setting hidden widgetNone
2020-05-15T08:03:42 INFO {'nodeset': '/data/end_time', 'type': 'dateTime', '{http://openrosa.org/javarosa}preload': 'timestamp', '{http://openrosa.org/javarosa}preloadParams': 'end'}None
2020-05-15T08:03:42 INFO attrib type isdateTime
2020-05-15T08:03:42 INFO first attributeend_timeNone
2020-05-15T08:03:42 INFO creating new field:end_timeNone
2020-05-15T08:03:42 INFO Reached HiddenNone
2020-05-15T08:03:42 INFO setting hidden widgetNone
2020-05-15T08:03:42 INFO 'type'None
2020-05-15T08:03:42 INFO number of submissions are3
2020-05-15T08:03:42 INFO server lastID isuuid:b6c0c7d0-26a7-47ad-8f59-20d2c35cc93a
2020-05-15T08:03:42 INFO first DownloadNone
2020-05-15T08:03:42 INFO downloadingNone
2020-05-15T08:03:42 INFO http://rpgeo.ddns.net:8080/ODKAggregate/view/downloadSubmissionNone
2020-05-15T08:03:42 INFO errorNone
2020-05-15T08:03:42 INFO value isNone
2020-05-15T08:03:42 INFO value isRojas
2020-05-15T08:03:42 INFO value isMara
2020-05-15T08:03:42 INFO value is30
2020-05-15T08:03:42 INFO value is2020-05-14
2020-05-15T08:03:42 INFO value is-31.0119760200 -64.0780700900 534.1428222656 3.2160000801
2020-05-15T08:03:42 INFO value issi
2020-05-15T08:03:42 INFO value isamargo hierbas
2020-05-15T08:03:42 INFO value is1589495688199.jpg
2020-05-15T08:03:42 INFO Download url ishttp://rpgeo.ddns.net:8080/ODKAggregate/view/binaryData?blobKey=build_Conociendo-odk-rev_1589495584%5B%40version%3Dnull+and+%40uiVersion%3Dnull%5D%2Fdata%5B%40key%3Duuid%3Acea3b7e3-cc1f-4ab1-a3fa-53e41c3f49a2%5D%2Fimagen%5B%40ordinal%3D1%5D&as_attachment=true
2020-05-15T08:03:42 INFO value istaller
2020-05-15T08:03:42 INFO value is2020-05-14
2020-05-15T08:03:42 INFO value is2020-05-14T19:33:54.135-03:00
2020-05-15T08:03:42 INFO value is2020-05-14T19:34:52.112-03:00
2020-05-15T08:03:42 INFO value isuuid:cea3b7e3-cc1f-4ab1-a3fa-53e41c3f49a2
2020-05-15T08:03:42 INFO http://rpgeo.ddns.net:8080/ODKAggregate/view/downloadSubmissionNone
2020-05-15T08:03:42 INFO errorNone
2020-05-15T08:03:42 INFO http://rpgeo.ddns.net:8080/ODKAggregate/view/downloadSubmissionNone
2020-05-15T08:03:43 INFO errorNone
2020-05-15T08:03:43 INFO before Update LayerNone
2020-05-15T08:03:43 INFO table have some dataNone
2020-05-15T08:03:43 INFO ODKUUIDNone
2020-05-15T08:03:43 INFO []None
2020-05-15T08:03:43 INFO geofield isGEOMETRY
2020-05-15T08:03:43 INFO {'meta': None, 'apellido': 'Rojas', 'nombre': 'Mara', 'edad': '30', 'dia': '2020-05-14', 'GEOMETRY': '-31.0119760200 -64.0780700900 534.1428222656 3.2160000801', 'mate': 'si', 'tipo_mate': 'amargo hierbas', 'imagen': 'http://rpgeo.ddns.net:8080/ODKAggregate/view/binaryData?blobKey=build_Conociendo-odk-rev_1589495584%5B%40version%3Dnull+and+%40uiVersion%3Dnull%5D%2Fdata%5B%40key%3Duuid%3Acea3b7e3-cc1f-4ab1-a3fa-53e41c3f49a2%5D%2Fimagen%5B%40ordinal%3D1%5D', 'usuario': 'taller', 'fecha': '2020-05-14', 'start_time': '2020-05-14T19:33:54.135-03:00', 'end_time': '2020-05-14T19:34:52.112-03:00', 'ODKUUID': 'uuid:cea3b7e3-cc1f-4ab1-a3fa-53e41c3f49a2'}None
2020-05-15T08:03:43 INFO odk id isuuid:cea3b7e3-cc1f-4ab1-a3fa-53e41c3f49a2
2020-05-15T08:03:43 INFO {'meta': None, 'apellido': 'Rojas', 'nombre': 'Mara', 'edad': '30', 'dia': '2020-05-14', 'GEOMETRY': '-31.0119760200 -64.0780700900 534.1428222656 3.2160000801', 'mate': 'si', 'tipo_mate': 'amargo hierbas', 'imagen': 'http://rpgeo.ddns.net:8080/ODKAggregate/view/binaryData?blobKey=build_Conociendo-odk-rev_1589495584%5B%40version%3Dnull+and+%40uiVersion%3Dnull%5D%2Fdata%5B%40key%3Duuid%3Acea3b7e3-cc1f-4ab1-a3fa-53e41c3f49a2%5D%2Fimagen%5B%40ordinal%3D1%5D', 'usuario': 'taller', 'fecha': '2020-05-14', 'start_time': '2020-05-14T19:33:54.135-03:00', 'end_time': '2020-05-14T19:34:52.112-03:00', 'ODKUUID': 'uuid:cea3b7e3-cc1f-4ab1-a3fa-53e41c3f49a2'}None
2020-05-15T08:03:43 INFO POINT(-64.07807009 -31.01197602)None
2020-05-15T08:03:43 INFO geom is
2020-05-15T08:03:43 INFO {'meta': None, 'apellido': 'Rojas', 'nombre': 'Mara', 'edad': '20', 'dia': '2020-05-16', 'GEOMETRY': '-31.0119784600 -64.0780564300 534.1218261719 3.2160000801', 'mate': 'si', 'tipo_mate': 'amargo hierbas', 'imagen': None, 'usuario': 'taller', 'fecha': '2020-05-14', 'start_time': '2020-05-14T19:43:18.592-03:00', 'end_time': '2020-05-14T19:51:06.286-03:00', 'ODKUUID': 'uuid:e88cd799-2c7d-43e5-9493-579cfb6cea5e'}None
2020-05-15T08:03:43 INFO odk id isuuid:e88cd799-2c7d-43e5-9493-579cfb6cea5e
2020-05-15T08:03:43 INFO {'meta': None, 'apellido': 'Rojas', 'nombre': 'Mara', 'edad': '20', 'dia': '2020-05-16', 'GEOMETRY': '-31.0119784600 -64.0780564300 534.1218261719 3.2160000801', 'mate': 'si', 'tipo_mate': 'amargo hierbas', 'imagen': None, 'usuario': 'taller', 'fecha': '2020-05-14', 'start_time': '2020-05-14T19:43:18.592-03:00', 'end_time': '2020-05-14T19:51:06.286-03:00', 'ODKUUID': 'uuid:e88cd799-2c7d-43e5-9493-579cfb6cea5e'}None
2020-05-15T08:03:43 INFO POINT(-64.07805643 -31.01197846)None
2020-05-15T08:03:43 INFO geom is
2020-05-15T08:03:43 INFO {'meta': None, 'apellido': 'G', 'nombre': 'H', 'edad': '5', 'dia': '2020-05-22', 'GEOMETRY': '-31.0119552900 -64.0780424100 533.5878906250 8.5760002136', 'mate': 'si', 'tipo_mate': 'azucar', 'imagen': None, 'usuario': 'taller', 'fecha': '2020-05-14', 'start_time': '2020-05-14T19:51:16.024-03:00', 'end_time': '2020-05-14T19:51:57.531-03:00', 'ODKUUID': 'uuid:b6c0c7d0-26a7-47ad-8f59-20d2c35cc93a'}None
2020-05-15T08:03:43 INFO odk id isuuid:b6c0c7d0-26a7-47ad-8f59-20d2c35cc93a
2020-05-15T08:03:43 INFO {'meta': None, 'apellido': 'G', 'nombre': 'H', 'edad': '5', 'dia': '2020-05-22', 'GEOMETRY': '-31.0119552900 -64.0780424100 533.5878906250 8.5760002136', 'mate': 'si', 'tipo_mate': 'azucar', 'imagen': None, 'usuario': 'taller', 'fecha': '2020-05-14', 'start_time': '2020-05-14T19:51:16.024-03:00', 'end_time': '2020-05-14T19:51:57.531-03:00', 'ODKUUID': 'uuid:b6c0c7d0-26a7-47ad-8f59-20d2c35cc93a'}None
2020-05-15T08:03:43 INFO POINT(-64.07804241 -31.01195529)None
2020-05-15T08:03:43 INFO geom is

Python error tab
2020-05-15T08:03:43 WARNING Traceback (most recent call last):
File "C:/Users/Mara/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 278, in importData
service.importData(layer,selectedForm,True)
File "C:/Users/Mara/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 271, in importData
self.collectData(layer,self.formKey,importData,self.topElement,self.version,self.geoField)
File "C:/Users/Mara/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 427, in collectData
self.updateLayer(layer,remoteTable,geoField)
File "C:/Users/Mara/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime_dialog.py", line 504, in updateLayer
self.iface.messageBar().pushWarning(self.tag, self.tr("Can't find '%s' field") % fieldError)
TypeError: not all arguments converted during string formatting

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Import' doing right click on a empy point layer
  2. Click on 'Accept' to import the form that it is in the Server.
  3. See error

Expected behavior
Data in both attribute table and canvas (geometry).

Screenshots
Data_ODKAggregate
Layer_AttributeTable_Empty

please complete the following information):

  • OS: [Windows 10 Pro]
  • QGIS Version [3.6, 3.8]
  • Plugin Version [3.11 The experimental one]

Additional context

  • If I import the collected data as .csv in QGIS a can see it correctly.
  • In the stable version its works.

The plugin does not import forms QGIS 3.4 and 3.6

The plugin does not import forms QGIS 3.4 and 3.6
I install the plugin, then I complete the server URL, user and password in the settings. The server connects properly, I can see the forms in ODKAggregate correctly, nevertheless when I try to import the data, the plugin "do not make anything" and I can't import the data. Besides, any error messages is listed and the others options of the plugin works correctly (e.g "Make Online")

In the form (ODK Build) to take the location I'm writting "GEOMETRY" in the properties>Data Name.

In QGIS 2.x it's works propertly with QgisODK, but it's does not work with QRealTime neither.

I'm installing everything as the instructions suggest.
I'm using:

  • ODKbuild to create the forms.
  • ODKCollect from the phone.
  • ODKAggregate
  • Windows 7 and 10
  • Postgresql 10
  • QGIS 3.4.10 and 3.6 (we tried both)
  • Plugin Version 3.4, 3.5, 3.5.1, 3.5.2, 3.6 and 3.7 (we tried all)

Could you help me? maybe I'm doing something wrong.

Connection to other servers

Would it be possible in a future version for another Kobo server to be specified where an individual installation has been undertaken?

compatibility with odk-central?

Has anyone tested this with the new odk-central server?
If it is using the same API as odk-briefcase it is probably not working.

Would be great if this and maybe the cool odata feed functionality could be made to work.

Translate to Spanish

Is your feature request related to a problem? Please describe.
There are few Spanish users who would be benefited if the plugin is translated into Spanish
Describe the solution you'd like
There should be translation file created for Spanish language.
Describe alternatives you've considered
No Alternatives available
Additional context
Add any other context or screenshots about the feature request here.

pyxform not installed in xubuntu

Good morning,
I try to get QrealTime running on QGIS 3.2 over xubuntu 18.04 and i get this error message.

Impossible de charger l'extension 'QRealTime' provoque une erreur lors de l'appel à sa méthode classFactory()

NameError: name 'self' is not defined
Traceback (most recent call last):
File "/home/mathieu/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 50, in
from pyxform.builder import create_survey_element_from_dict
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 665, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'pyxform'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/mathieu/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 55, in
from pyxform.builder import create_survey_element_from_dict
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 665, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'pyxform'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 337, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/home/mathieu/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/init.py", line 34, in classFactory
from .QRealTime import QRealTime
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 665, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/mathieu/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 59, in
self.iface.messageBar().pushWarning(self.tr("QRealTime plugin"), self.tr('install pyxform package in python3 manually'))
NameError: name 'self' is not defined

Version de Python : 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0]
Version de QGIS : 3.2.0-Bonn Bonn, bc43194

Chemin Python :
/usr/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl
/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl
/usr/share/python-wheels/idna-2.6-py2.py3-none-any.whl
/usr/share/python-wheels/packaging-17.1-py2.py3-none-any.whl
/usr/share/python-wheels/pyparsing-2.2.0-py2.py3-none-any.whl
/usr/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl
/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl
/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl
/usr/share/python-wheels/six-1.11.0-py2.py3-none-any.whl
/usr/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl
/usr/share/python-wheels/wheel-0.30.0-py2.py3-none-any.whl
/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl
/usr/share/python-wheels/certifi-2018.1.18-py2.py3-none-any.whl
/usr/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl
/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl
/usr/share/python-wheels/distlib-0.2.6-py2.py3-none-any.whl
/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl
/usr/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl
/usr/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl
/usr/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl
/usr/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl
/usr/share/python-wheels/progress-1.2-py2.py3-none-any.whl
/usr/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl
/usr/share/qgis/python
/home/mathieu/.local/share/QGIS/QGIS3/profiles/default/python
/home/mathieu/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python36.zip
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
/home/mathieu/.local/share/QGIS/QGIS3/profiles/default/python

Support for Kobotoolbox?

A lot of organisations use the free institutional accounts sponsored by UN-OCHA of the Kobotoolbox:
https://www.kobotoolbox.org/

I believe Kobotoolbox is an Ona.io fork but significantly diverged. I tried connecting to it via QRealTime, but it didn't work. Help apprechiated!

Cant "Make Online" a Geopackage layer

Error after Click "Make Online" for my geopackage layer

2021-05-20T15:11:39 WARNING Traceback (most recent call last):
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 399, in sendForm
fieldDict= self.getFieldsModel(layer)
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 446, in getFieldsModel
fieldDef['type'] = QVariantToODKtype(field.type())
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QRealTime\QRealTime.py", line 92, in QVariantToODKtype
raise AttributeError("Can't cast QVariant to ODKType: " + q_type)
TypeError: can only concatenate str (not "Type") to str

  • OS: [e.g. Windows 10]
  • QGIS Version [e.g. 3.18.2]
  • Plugin Version [e.g. 3.8]

Update plugin to support kobo

Is your feature request related to a problem? Please describe.
User need to have working aggregate server to use this plugin. There are many users who uses kobotoolbox and would like to have GIS integration.

Describe the solution you'd like
Support for kobotoolbox would help users who can not host server and users who are already using kobotoolbox.

Describe alternatives you've considered
KOBO branch already provide support for kobotoolbox. But it needs to be integrated with main plugin

Submissions are not shared for koboToolbox server

Describe the bug
The link of the attachments is not accessible to anonymous user

To Reproduce
Steps to reproduce the behavior:

  1. Click on any feature using identity tool.
  2. The url in case of attachment should open.

Expected behavior
The image should be displayed by identity tool and also the link should open

please complete the following information):

  • OS: windows
  • QGIS Version [e.g. 3.10]
  • Plugin Version [e.g. 3.9.11]

Additional context
Add any other context about the problem here.

Layer form field order not respected in 'make online'

Describe the bug
Using a spatialite layer and the QGis 'drag & Drop designer', field ordering is not maintained in the generated Kobo form. It appears that the order of the fields in the Kobo form is taken from the underlying data scr (e.g. spatialite table) rather than the current layer form.

To Reproduce

  • create a SpatiaLite table with 3 fields.
  • In the layer D&D form designer, move the 3rd field to the top of the form.
  • QRT makeonline
  • In the exported Kobo form, see that the 3rd field appears at the bottom of the form.

Expected behavior

  • In the exported Kobo form, I expect to see the 3rd field appear as the first field as defined in the D&D form designer.

Screenshots
The QGis LAyer Form design :
image

The exported Kobo form:
image

please complete the following information):

OS: Win 10
QGIS Version : 3.10.14
Plugin Version: QrealTime 3.15

Additional context
QRT Export Log:

2021-02-15T16:42:48 INFO not writing fieldsNone
2021-02-15T16:42:48 INFO 'type'None
2021-02-15T16:42:48 INFO getFieldModelTextEdit
2021-02-15T16:42:48 INFO getFieldModelTextEdit
2021-02-15T16:42:48 INFO getFieldModelTextEdit
2021-02-15T16:42:48 INFO fieldDict[{'type': 'geopoint', 'required': True, 'label': 'Point Location'}, {'name': 'f234567890', 'label': 'f234567890', 'type': 'text'}, {'name': 'f2345678901', 'label': 'f2345678901', 'type': 'text'}, {'name': 'new-field', 'label': 'new-field', 'type': 'text'}]
2021-02-15T16:42:48 INFO Payload= {'uid': 'test-size-2.1.1', 'name': 'test-size-2.1.1', 'asset_type': 'survey', 'content': '{"survey": [{"type": "geopoint", "required": true, "label": "Point Location"}, {"name": "f234567890", "label": "f234567890", "type": "text"}, {"name": "f2345678901", "label": "f2345678901", "type": "text"}, {"name": "new-field", "label": "new-field", "type": "text"}], "choices": []}'}
2021-02-15T16:42:53 INFO KoboToobox{"url":"https://kf.kobotoolbox.org/api/v2/assets/a2qVQM3KsKKTuxvtWiKdnH/permission-assignments/p4Nd4v7dN6QRzXg5UQVU8t/","user":"https://kf.kobotoolbox.org/api/v2/users/AnonymousUser/","permission":"https://kf.kobotoolbox.org/api/v2/permissions/view_submissions/","label":"View submissions"}

Support for ODK-Central

Is your feature request related to a problem? Please describe.
Support upcoming replacement of Aggregate from ODK

Describe the solution you'd like
Code migration to QRealTime4.0 branch from odk-central and

Manual

I'm trying to connect my Google drive with the plugin.
I dont know how to fill url, user, pasword and lastID.
I'm tried several options but no exit.
(Sorry for the basic question)
Thanks in advance

Importing data with repeat groups

I have successfully imported a form from Kobotoolbox which has geopoints, but when trying to import a second form which uses a geopoint within a Repeat Group the plugin fails to import the data.

QRT appears to be able to read the schema and create a 'flattened' table in QGIS and correctly identifies the geofield within the form - taken from the plugin log:

2020-09-14T15:03:47 INFO {'nodeset': '/data/Work/Location', 'type': 'geopoint', 'required': 'false()'}None
2020-09-14T15:03:47 INFO geometry field is =Location

However when reading the dataset the plugin fails to find the geofield and doesn't import the rows.

Kobotoolbox server cannot display geo-data that is within repeat groups, so I wonder if this is a problem for QRT as well? I don't want to post this as a bug if it is simply not supported, but it might be a feature request!

I have upgraded to the experimental plugin 3.15 on QGIS 3.14 (windows 10)

Many thanks.

Dependencies and requirements.txt

Hello~

Great looking project. I just noticed that pyxform is included as a static library in the root directory. Also, I don't see dependencies listed anywhere.

Is pyxform the only dependency? Has the statically included pyxform been modified? If not, I can make a PR to make this change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.