What is the data?
OpenAQ collects and aggregates air quality data from 114 government level and research-grade sources; the data is produced by 10,210 locations coming from 68 countries. The data is aggregated into a single location for their community to analyse and build technical solutions around.
Like with previous air quality data integrations, by making this data available for free on Streamr, it widens the audience viewing the data being collected by OpenAQ, and enables air quality based smart contract applications to be built with ease. It also allows visualisation of the data within canvases on the Streamr editor. Eventually, it is planned that other data streams will be onboarded that can be merged and cross analysed with this data (a real smart city solution!).
Where is the data?
The data can be found on the Marketplace (for free) here. This includes a separate stream for each country present (so check it out to see if your country of interest is available).
Data points arrive at the Streamr platform as soon as they are added to the OpenAQ platform (no polling on a time interval!). Some sensors generate a lot more data points than others (in other words, beware that some country streams or individual sensors might not have frequent data points).
How do I access it?
After subscribing to the data via the Marketplace link, you can either access the data directly or from within a canvas.
An example canvas accessing the data is available here. See the notes here, under the ‘how do I access it?’ section, for pointers on running a shared canvas; most importantly, save the canvas so that it becomes yours and you can edit it, and remember to hit start in either historical or real-time mode to start seeing data. (Note if duplicating the canvas to be your own, and then running in real-time, you wont see data points until the next sensor updates).
Alternatively, if you don’t have a Streamr account, you can still view the canvas here.
The below shows a screenshot of the canvas:
The below explains the workings of this example canvas:
- In blue box 1, a number of modules are being used to show the locations of all available sensors. Note that the incoming data is coming from the United Kingdom stream so only those sensors are shown (see the final points of this post for details on changing the country). The location name of each sensor is extracted from the raw data and provided to the map as an ID. IDs are provided so that multiple markers can be shown on the map; each location/ID has its own longitude and latitude and marker. If just longitude and latitude were being provided to the map (without associated IDs), only one marker would ever be shown. Hovering over the markers in this map will display their location name / ID.
- In blue box 2, a filter is being applied so that data from only one sensor (location name / ID) is being processed at later points (in box 3 etc). Events coming in are checked for their location name and a filter is applied. The measurement type is also being filtered to be PM10.
- In blue box 3, the longitude and latitude of one sensor is being shown. This time only one sensor is shown as only data for that sensor is getting through to this point (due to the filtering described in the previous bullet point). Note, if a precise timestamp is needed for each measurement, this can be retrieved from the ‘extra -> date -> utc or local’ attribute present in each data point. The chart is currently showing the time at which the measurement entered the Streamr platform.
- The red boxes indicate parameters you might be interested in changing; changing these will allow data from other sensor locations to be viewed, and also other pollutant types.
- The data in the canvas is currently coming from the United Kingdom sensor stream. If you want to change the incoming data so that it is from another country, this can be done by clicking on the current stream in the Stream module (top left of canvas) and starting to type the name of another country stream (a list of stream names are found on the marketplace product, linked above). Changing the stream is likely to remove some links between the stream module and modules it is currently connected to. Remember to reattach the links so the flows remain intact.
- Remember if changing the country, the red box in the centre of the canvas will need to be changed to be filtering for a new sensor location within that new country. Names of locations can be seen by hovering over the markers in the map in box 1 (once the canvas is running using a new country).
Finally I would like to thank the OpenAQ team / community for their help during this integration, and for providing and maintaining a great platform!