GeoServices SenseBox - An OGC Feature Service on Arduino!
The GeoServices SenseBox is the continuation of the Google Summer of Code Project.
The programming code for the Arduino has been rewritten and is now working without the need of template files.
Hardware Requirements:
- GPS
- EthernetShield
- SD-Card Reader
- Arduino Mega2560 (or higher)
Features:
OGC GeoServices REST API candidate standard 0.0.4 Sensors are organized with the Sensors Pack Provides a Registry for Sensors to iterate attached Sensors Stores Measurements on SD-Card Simple deployment to your Arduino (Mega2560 or better) No Template Files, but on-the-fly-JSON generation with aJSON library Each Sensor is represented by a Layer Each Measurement is represented by a Feature Spatial and Temporal Information due to GPS-dependency
Future Work:
The recent source code can be found in the Repository:
https://svn.52north.org/svn/swe/incubation/sensebox/GeoServicesSB/
Dependencies:
The work depends on the following non native libraries:
// Flash
// License: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
// Access progmem more easy
// Version: 4.0
// URL: http://arduiniana.org/libraries/flash/
#include <Flash.h>
// TinyWebServer
// License: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
// Provides a library for a Webservice.
// Version: Sep 11, 2012
// URL: GIT https://github.com/ovidiucp/TinyWebServer
#include <TinyWebServer.h>
// TinyGPS
// License: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
// Provides Capabilities to read a GPS.
// Version: 12
// URL: http://arduiniana.org/libraries/tinygps/
#include <TinyGPS.h>
// Time
// License: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
// Provides: low level time and date functions
// Version: July 3, 2011
// URL: http://www.arduino.cc/playground/Code/Time
#include <Time.h>
// aJson
// License: MIT
// Provides: simple Json parsing capabilites, offspring of cJson
// Version: Nov 8, 2012
// URL: GIT https://github.com/interactive-matter/aJson.git
#include <aJSON.h>
In addition the Sensors Pack is necessary. This can be found here:
// Sensors Pack
#include <Sensors.h> //Requires TinyGPS
#include <SensorRegistry.h> //Requires Sensors
#include <Logger.h>
//URL https://svn.52north.org/svn/swe/incubation/sensebox/libraries/Sensors/trunk/
Examples for Quering and Responding:
- Query SenseBox Layers:
http://sensebox.url/geoservices/
Reponse: { "serviceDescription": "RESTful GeoServices SenseBox", "layers": [ { "id": "1", "name": "A Test Layer" } ] }
- Query SenseBox Feature Layer:
http://sensebox.url/geoservices/1/
Reponse: { "id": "1", "name": "A Test Layer", "type": "Feature Layer", "displayField": "value", "description": "", "copyrightText": "", "capabilities": "Query", "geometryType": "GeometryPoint", "minScale": 0, "maxScale": 0, "spatialReference": { "wkid": 4326 }, "objectIdField": "objectid", "globalIdField": "", "fields": [ { "name": "objectid", "type": "FieldTypeOID", "alias": "Object ID" }, { "name": "Value", "type": "FieldTypeString", "alias": "" }, { "name": "Time", "type": "FieldTypeDate", "alias": "Date and Time" } ] }
- Query the Features of a Feature Layer:
http://sensebox.url/geoservices/1/query
Response: { "objectIdFieldName": "objectid", "globalIdFieldName": "", "geometryType": "GeometryPoint", "spatialReference": { "wkid": 4326 }, "fields": [ { "name": "objectid", "type": "FieldTypeOID", "alias": "Object ID" }, { "name": "Value", "type": "FieldTypeString", "alias": "" }, { "name": "Time", "type": "FieldTypeDate", "alias": "Date and Time" } ], "features": [ { "geometry": { "point": { "x": 7.652118, "y": 51.934969 }, "spatialReference": { "wkid": 4326 } }, "attributes": { "ObjectID": "20000101000003", "Time": "2000-01-01T00:00:03Z", "Value": "5" } }, { "geometry": { "point": { "x": 7.652118, "y": 51.934969 }, "spatialReference": { "wkid": 4326 } }, "attributes": { "ObjectID": "20000101000008", "Time": "2000-01-01T00:00:08Z", "Value": "5" } }, { "geometry": { "point": { "x": 7.652118, "y": 51.934969 }, "spatialReference": { "wkid": 4326 } }, "attributes": { "ObjectID": "20000101000018", "Time": "2000-01-01T00:00:18Z", "Value": "5" } } ] }