QRealTime icon indicating copy to clipboard operation
QRealTime copied to clipboard

spatialite fields with name len > 10 no longer imported!

Open yorkfrog opened this issue 3 years ago • 3 comments

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

yorkfrog avatar Feb 15 '21 16:02 yorkfrog