Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensor things Data Provider, pt 1 #55840

Merged
merged 65 commits into from
Feb 15, 2024
Merged

Conversation

nyalldawson
Copy link
Collaborator

This is part 1 of a native data provider implementation for the OGC SensorThings API.

See qgis/QGIS-Enhancement-Proposals#257 for technical details

Introduced in this PR are:

Connection handling for SensorThings connections

These are exposed via data source manager and browser. Like other connection types (eg WMS) users can populate a set of frequently used connections for rapid access. I've used the modern approach we use for eg XYZ connections here, where the stored connection prepopulates all the connection settings BUT where users can easily modify these (or add ad-hoc connections) on a case by case basis:

image

image

Source widget implementation for configuring existing layer connections

I've added a source widget, so that users can modify the properties of an existing SensorThings layer in their projects WITHOUT having to add a new layer:

image

This is especially important for SensorThings layers as they tend towards an interactive source, where users will frequently modify filter configuration and other related settings.

Optimised data provider

The SensorThings data provider has been designed to provide the best possible user experience given what is available from the OGC SensorThings API standard. Some interesting things here are:

  • We always lazy fetch features and store in an session wide cache. (This was modelled off the existing ArcGIS REST feature server implementation)
  • Care was taken to ensure that constructing a data provider only fires off two VERY CHEAP requests to the server. (One to get the endpoints, the other to retrieve the layer's feature count). This ensures good performance when adding layers or reloading projects containing sensor things providers.
  • A local spatial index is used to store cached features, so that we can quickly query for rectangle based searches. There's a lot of (I think!) smart things at play here. Eg, we keep track of a unioned extent polygon for all previous spatial rect requests we've successfully fetched and if a new request falls within this polygon then we know we can safely just return cached features only. If part of the request falls outside the previously fetched extent, then we FIRST return all the locally cached features before requesting the remainder from the service (this ensures that panning the map is nice and responsive -- the features previously visible are all immediately drawn, and the newly visible ones are drawn as the requests are complete)

Future work

More work is coming, but this is the minimal PR I can submit which brings up the data provider in a functional way. Eg:

  • Further optimisations regarding geometry type filtering and layer extent calculations
  • Automatic integration with temporal controller
  • Filtering
  • Ability to "flatten" relationships in the layer, so that the relational SensorThings model is exposed in a more traditional flat row based table. (For easy use with eg temporal animations or with data analysis tools)

@github-actions github-actions bot added this to the 3.36.0 milestone Jan 15, 2024
@nyalldawson nyalldawson added Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Jan 15, 2024
@qgis-bot
Copy link
Collaborator

@nyalldawson
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Collaborator

@nyalldawson

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

Copy link

github-actions bot commented Jan 15, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 18e7391)

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 30, 2024
@github-actions github-actions bot closed this Feb 7, 2024
@nyalldawson nyalldawson reopened this Feb 13, 2024
@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Feb 13, 2024
@qgis qgis deleted a comment from github-actions bot Feb 13, 2024
@qgis qgis deleted a comment from github-actions bot Feb 13, 2024
@nyalldawson nyalldawson merged commit 6e12197 into qgis:master Feb 15, 2024
30 checks passed
@nyalldawson nyalldawson deleted the sensor_things_pt1 branch February 15, 2024 02:39
@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants