This Choreo allows for easy updating of a feed's location metadata and waypoints.
Xively allows for an option to automatically store 'waypoints', which are snapshots of current latitude, longitude, and elevation data in time, triggered whenever any latitude, longitude or elevation data changes.
To enable the ability to store waypoints, you must set the Disposition input to "mobile", otherwise updating the feed location will only overwrite the curent data.
To view a list of waypoints for a waypoint-enabled feed (Disposition is set to "mobile"), you must use historical queries when reading a feed.
The documentation for this Xively resource can be found here and here (see location and waypoint attributes tables under Feed Attributes) .
For most parameters you can leave the input empty to keep the previous settings (if any). If you add a value to an input it will overwrite the previous data. If you wish to clear out the data in the input variable enter "BLANK". This includes waypoint data (latitude, longitude and elevation) as well.
For recording waypoint data for waypoint-enabled feeds, if you do not enter a complete set of waypoint data (latitude, longitude, elevation), the waypoint will automatically include the previously recorded waypoint data for that missing value if available.
The following is an example list of acceptable inputs:
APIKey: {YOUR XIVELY API KEY}
FeedID: {THE FEEDID YOU WISH TO UPDATE}
Disposition: mobile
Latitude: 40.728194
Longitude: -73.957316
Elevation: "BLANK" (to erase elevation value)
Here's an example of a feed with waypoint location data (acquired by running the ReadFeed Choreo using a historical query):
{
"id":123456789,
"feed":"https://api.xively.com/v2/feeds/123456789.json",
"auto_feed_url":"https://api.xively.com/v2/feeds/123456789.json",
"status":"frozen",
"updated":"2013-05-22T17:02:44.496009Z",
"created":"2013-05-15T17:50:23.453235Z",
"creator":"https://xively.com/users/testuser",
"version":"1.0.0",
"datastreams":[
{
"id":"datastream",
"current_value":"1337",
"at":"2013-05-22T13:33:20.099908Z",
"max_value":"1337.0",
"min_value":"16.0",
"datapoints":[
{
"value":"1337",
"at":"2013-05-22T13:33:20.099908Z"
}
]
}
],
"location":{
"disposition":"mobile",
"name":"Devicenameinlocation",
"domain":"virtual",
"waypoints":[
{
"at":"2013-05-22T16:51:26.183053Z",
"lat":49.728194,
"lon":-81.957316,
"ele":"100"
},
{
"at":"2013-05-22T16:59:23.443182Z",
"lat":49.728194,
"lon":-82.957316,
"ele":"110"
},
{
"at":"2013-05-22T17:02:44.318373Z",
"ele":""
}
]
},
"product_id":"NCoNgXsKHfMrM-ddAihx",
"device_serial":"DeviceSerial"
}
In the above example:
- The second waypoint datapoint was recorded by updating the Longitude and Elevation inputs only (the Latitude was the same as the previous value, and the Latitude input was left empty), so the waypoint recorded the previous Latitude value as part of the snapshot.
- The last waypoint datapoint represents erasing waypoint/geolocation data by entering "BLANK" in the Latitude, Longitude, and Elevation inputs.
For a successful feed location update, the ResponseStatusCode should be 200.