Custom Connector

Urban Observatory Sensor Connector

UK

The Urban Observatory Sensor Connector integrates with the Urban Observatory Sensor API, providing access to sensor locations, sensor data, variable metadata, and theme metadata. It acts as a proxy for listing sensor locations, downloading sensor data, retrieving pagination info, and accessing variable/theme metadata — in JSON, CSV, and ESRI Shapefile, for GCP.

Type
Virtual machines, Single VM, BYOL
Runs on
Google Compute Engine
Last update
24 Oct 2024
Category
Integration
Overview

Integration Overview

This document provides a detailed guide for each integration point using the Urban Observatory Sensor Connector within a GCP environment.

  • listSensorsJson. List sensor locations in JSON, with optional bounding-box filtering and pagination.
  • getSensorsPage. Retrieve pagination metadata for sensor datasets (total count, navigation URLs).
  • downloadSensorsCsv. Download sensor locations as CSV, with optional filtering and pagination.
  • downloadSensorsShp. Download sensor locations as a zipped ESRI Shapefile.
  • getSensorsDataJson / getSensorsDataCsv. Retrieve sensor data with time-range, variable, and bounding-box filters.
  • getSensorIndDataJson / getSensorIndDataCsv. Retrieve data for a specific sensor, with filters.
  • listVariables. List available measurement types and their metadata.
  • listThemes. List available themes for sensor variables.
Documentation

Detailed Integration Documentation

List Sensors (JSON)

ActionlistSensorsJson
PurposeRetrieves a comprehensive list of sensor locations in JSON, optionally filtered by bounding box — for geospatial applications and dashboards.
ConfigurationSet CONNECTOR_ENV_URBANOBSERVATORY_BASE_URL in GCP (e.g. https://api.v2.urbanobservatory.ac.uk).
ParametersOptional:
bbox_p1_x, bbox_p1_y (lower-left lon/lat); bbox_p2_x, bbox_p2_y (upper-right lon/lat); limit (default 1000, -1 disables pagination); offset (default 0).
OutputSuccessful: JSON with sensor details (name, location, centroid coordinates, height, broker, ID) and pagination metadata. Failure: JSON validation errors (HTTP 422).
Workflow exampleCall listSensorsJson with limit=10, then populate a geospatial visualization (e.g. Google Maps).

Get Sensors Page

ActiongetSensorsPage
PurposeRetrieves pagination metadata for sensor datasets — total count and page-navigation links — for managing large datasets.
ConfigurationSet CONNECTOR_ENV_URBANOBSERVATORY_BASE_URL in GCP (e.g. https://api.v2.urbanobservatory.ac.uk).
ParametersOptional:
bbox_p1_x, bbox_p1_y (lower-left lon/lat); bbox_p2_x, bbox_p2_y (upper-right lon/lat); limit (default 1000, -1 disables pagination); offset (default 0).
OutputSuccessful: JSON with total sensors, limit, offset, and next/previous page URLs. Failure: HTTP 422.
Workflow exampleCall getSensorsPage with limit=100 and use Total/Next to implement paginated retrieval.

Download Sensors (CSV / Shapefile)

ActiondownloadSensorsCsv / downloadSensorsShp
PurposeDownloads sensor locations as a CSV file, or as a zipped ESRI Shapefile (.shp, .shx, .dbf, .prj, .cpg) for GIS.
ConfigurationSet CONNECTOR_ENV_URBANOBSERVATORY_BASE_URL in GCP (e.g. https://api.v2.urbanobservatory.ac.uk). Use header Accept: text/csv (CSV) or Accept: application/zip (Shapefile).
ParametersOptional:
bbox_p1_x, bbox_p1_y (lower-left lon/lat); bbox_p2_x, bbox_p2_y (upper-right lon/lat); limit (default 1000, -1 disables pagination); offset (default 0).
OutputSuccessful: CSV (sensor_name, Location_WKT, centroid, heights, broker, raw ID) or zipped Shapefile. Failure: HTTP 422.
Workflow exampleCall downloadSensorsCsv with limit=100, then store the CSV in Cloud Storage for BigQuery processing.

Get Sensors Data (JSON / CSV)

ActiongetSensorsDataJson / getSensorsDataCsv
PurposeRetrieves sensor data (JSON or CSV) with filters for time range, variables, and bounding box — for real-time analysis or bulk export.
ConfigurationSet CONNECTOR_ENV_URBANOBSERVATORY_BASE_URL in GCP (e.g. https://api.v2.urbanobservatory.ac.uk). Start with small limits (e.g. 10) to avoid server 500 errors.
ParametersOptional:
start, end (UTC datetimes); last_n_hours / last_n_days (override time range); variables (e.g. [“O3”,“NO2”]); bbox_p1_x, bbox_p1_y (lower-left lon/lat); bbox_p2_x, bbox_p2_y (upper-right lon/lat); limit (default 1000, -1 disables pagination); offset (default 0).
OutputSuccessful: Readings (Sensor_Name, Variable, Value, Timestamp, Flagged), Sensors metadata, Start/End, and pagination. Failure: HTTP 422.
Workflow exampleCall getSensorsDataCsv with limit=10 and last_n_hours=24, store in Cloud Storage, analyze in BigQuery.

Get Individual Sensor Data (JSON / CSV)

ActiongetSensorIndDataJson / getSensorIndDataCsv
PurposeRetrieves data for a specific sensor (JSON or CSV) with optional filters — detailed, sensor-specific analysis.
ConfigurationSet CONNECTOR_ENV_URBANOBSERVATORY_BASE_URL in GCP (e.g. https://api.v2.urbanobservatory.ac.uk).
ParametersRequired:
sensor_name (e.g. PER_AIRMON_MESH1916150). Optional:
start, end; last_n_hours / last_n_days; variables; limit; offset.
OutputSuccessful: JSON/CSV with the same structure as the aggregate data endpoints. Failure: HTTP 422.
Workflow exampleCall getSensorIndDataJson with sensor_name=PER_AIRMON_MESH1916150 and last_n_hours=24 for sensor-specific monitoring.

List Variables & Themes

ActionlistVariables / listThemes
PurposeRetrieves available measurement types (with units, limits, and theme) and the list of themes — ideal for populating UI filter menus.
ConfigurationSet CONNECTOR_ENV_URBANOBSERVATORY_BASE_URL in GCP (e.g. https://api.v2.urbanobservatory.ac.uk).
ParametersRequired: None.
OutputSuccessful: JSON with Variables (Name, Units, Upper_Limit, Lower_Limit, Theme) or Themes (Name). Failure: HTTP 422.
Workflow exampleCall listVariables and listThemes to populate variable and category dropdowns in a web app.

Example Workflow: Sensor Data Collection & Analysis

Retrieve sensor locationsUse listSensorsJson with limit=10 and bounding box, then store the JSON in Cloud Storage.
Query sensor dataExecute getSensorsDataCsv with limit=10, last_n_hours=24, variables=[“O3”], save to Cloud Storage and load into BigQuery.
Analyze & visualizeUse listVariables and listThemes for UI filters, then visualize with Google Maps and Data Studio on App Engine.
Support

For technical support, contact custom-connectors-support@isolutions.sa.

free consultation

Schedule a Free Consultation With Our Specialists

Book a free demo
request

Begin Your Adventure With Experienced Professionals

Send request
help desk

Do You Have Questions or Want More Information? Call Now.

Contact support