QRealTime: A QGIS plug-in for ODK

Now I understood your problem.
Shapefile does not store the information related to value map or the style.
If you want to share these information then you need to share the layer ( .lyr file) alongwith your shapefile.
Loading the layer would do the trick

1 Like

Thank you very much!
Now it's working :slight_smile:

1 Like

@shiva_Reddy .
Another Question came up.
I used QRealTime with the sandbox aggregate server and it worked.
Now I try to connect it to the project's aggregate server, but it doesn't work out...
QRealTime plugin : Form is not sent is the only message which is shown (no additional information or hints about the failure cause).
We can't figure out a way to see the stacktrace so we can find the problem ourself.

Thanks for an answer.

I am sorry I am replying so late here.
You can goto panels and enable log messages .
There under QRealTime tab all messges are printed.

Hey,
Recent experimental release of QRealTime plugin is now available in Spanish too.
Looking for feedback from Spanish speaking people .
This would help in porting to stable release of the plugin.

cheers

1 Like

I have just been having problems installing QRealTime on QGis 3.6 on Ubuntu Linux 18:04. The install worked OK with QGis 2.18 on Win 10 and same linux install.

The issue I was having, after downloading the plugin via QGis plugin manager:

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

ModuleNotFoundError: No module named 'unicodecsv' 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 335, in startPlugin
plugins[packageName] = package.classFactory(iface)
  File "/home/colin/.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 686, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 44, in 
from pyxform.builder import create_survey_element_from_dict
...

It looks like the module 'unicodecsv' is not installed, so I installed it and another dependency using the following commands:

$ sudo apt-get install python3-unicodecsv

and then

$ sudo apt-get install python3-xlrd

Following a restart of QGis 3, all seems to be working as expected :slight_smile:
Wanted to share this as it took me, as a python noob, several hours to figure this out!

-C

Hey,
Thank you very much. In recent version, I have included pyxform library in plugin itself.

I think I have to provide these lib too.

Earlier I used to call system command via pip3 to install the packages.

Thanks for your valuable suggestion.

I would fix it soon. Once again thank you very much

Hey,
This issue is resolved.
Please comment on https://github.com/shivareddyiirs/QRealTime/issues/34

So following are latest versions without this bug:

  • stable: 3.8.0 (3.8.1 deleted): if in 3.8.1 downgrade to 3.8
  • Experimental: 3.9.7

I would request to enable experimental plugin and test its functionality. It has many new features and bug fixes. I am waiting for user feedback before porting it into stable release.

1 Like

Hi all,

I am trying to line out a procedure to develop forms in QGIS with the QRealTime plugin, and link them to an Aggregate VM server using VirtualBox. Is this also supposed to work?

I use QGis since all data is very geographical. I use Aggregate VM since I operate from an internet limited environment.

Thanks!

Sure it would work.
Nevertheless if you encounter any issue or need support you are most welcome.

2 Likes

That's great shiva_Reddy! I have some experience with using Google drive as ODK server, instead of aggregate. Does the plug-in also work when using the Google drive link? I tried but this does not seem to work?

Cheers,
Ruben

Hey,
It does not support google drive.

But it support kobotoolbox( in experimental version)

1 Like

Great, then I will try out the Kobo-toolbox as link between QGIS and ODK.

Cheers,
Ruben

Hi @shiva_Reddy, thanks for all your hard work with QRealTime - it's been a life saver to be able to migrate off QGis v2 and still use ODK collect.

I have been using the latest dev release 3.12 and working with KoboToolbox and it is working great.

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!

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

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

thanks, Colin

Hi @shiva_Reddy - a bit more testing and another little bug I think. When "making online" a layer for a second time, an image field can get created with incorrect type.

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.

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"

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.

From the QGis log, this is output for QRT.

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'}**

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

I have logged this on Github too

thanks again for all your work on this.

Colin

added to Github as bug

@shiva_Reddy, the guy I am working for, Martin Jakes, wanted me to pass on his thanks for your work with this plug in. We are using QGis, Kobo and KoboCollect to survey his community woodland for Ash die back, part of his management plan. He operates as a non-profit opening the woodland to the local community and schools so the opensource software is key to this.

Once again thank you and to the wider ODK and QGis team for all your hard work and dedication.

Soon to have a new website (jun 20) featuring QGis based map :smiley:

thanks, Colin and Martin

2 Likes

Hi all! @ianmahoney, @samlevy, and I are a part of UW Impact++, a volunteer student-run organization at the University of Washington. For the past few months, we have been working on adding support for ODK Central to the QRealTime plugin. The changes are now live in an experimental version of the plugin! To use the experimental version, open QGIS and navigate to: Plugins -> Manage and Install Plugins -> Settings -> Show also experimental Plugins. Then navigate to Plugins -> Manage and Install Plugins -> Installed -> QRealTime -> Upgrade to experimental plugin.

Here is a link to the GitHub with the ODK central branch which has an updated README with instructions how to use the plugin for ODK Central. If you run into issues please add them as in issue in the GitHub or as a comment on this thread.

6 Likes

I have been trying to use QRealTime with ODK Central. I have found have found that if I have a form with a geoshape type field in it QRealTime will not import any records. Have I done something wrong?

I have also incidentally found that if form_id is not the same as the form name QRealTime crashes.

Congratulations for your work. I've been testing your plugin, but in the last update, I got an error. And when I import the form from Kobotoolbox, it only brings some fields with data and Null appears in the others. Can you give me any solution regarding this? Thank you,