Closed rduivenvoorde closed 3 months ago
@rduivenvoorde https://github.com/qgis/QGIS/pull/57583 fixes this, but because we can't dynamically change the field value type based on the actual value for each feature, i've had to resort to using just a comma separated string for the multiple values
What is the bug or the crash?
Requesting 'FeaturesOfInterest' and expanding the 'Observations' of these, throw an exception:
I think (!?) this is related to the fact that QGIS (or the SensorThings provider), thinks that an Observation result always is a scalar value, being a number or a string.
But the specs also define so called 'MultiDatastreams', in which the result then consists of an array of values.
Another option (as the type of 'Observation/result' is 'any') is actually that the result value is json itself (in our case it is a geojson object).
Both these options should be handled (dirty hack: just create a string of them...)
Steps to reproduce the issue
See the screendump in which I connect to the public sta service on:
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/
The zoom in (for example to Utrecht in The Netherlands) to have just a few locations, and then request for FeaturesOfInterest and expand the Observations (again, see screendump).
You should now see Points on the map (like you seen without the expansion), but you do NOT see points.
Another observation is that if you try to open the Attribute Table, you get the json parse exception (visible in the screendump).
For reference: this is the url with data retrieved:
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/FeaturesOfInterest?$top=9948&$count=false&$expand=Observations($top=100)&$filter=(feature/type eq 'Point' or feature/geometry/type eq 'Point') and (geo.intersects(feature, geography'Polygon ((5.12173000000000034 52.10079999999999956, 5.13339999999999996 52.10079999999999956, 5.13339999999999996 52.10660000000000025, 5.12173000000000034 52.10660000000000025, 5.12173000000000034 52.10079999999999956))'))
I think it is because the result is an array (because it is a Multidatastream), see above and link below:
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Observations(522318087)
As said: my actual use-case is that the result is a json. Not sure how to handle this, but it should not throw a parse exception, but it could show the json as a string?
Versions
This copy of QGIS writes debugging output. | | | Active Python plugins SensorThingsAPI | 1.1.12 pdokservicesplugin | 5.0.1 QuickWKT | 3.1 db_manager | 0.1.20 grassprovider | 2.12.99 processing | 2.12.99 MetaSearch | 0.3.6
Supported QGIS version
New profile
Additional context
No response