Location data along fields vs channel settings

3 views (last 30 days)
Hello,
Could you please help in explaining what is the difference between location data along the 8 available fields and location data on channel settings? Shouldn't be it be the same data?
Below is an example:
I set the location data:
POST /update.json HTTP/1.1
Host: api.thingspeak.com
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Postman-Token: XX
api_key=XX&lat=45.01&lon=27.01&1=44.444&elevation=10.1
I get the data from channel fields:
{
"channel": {
"id": 1094740,
"name": "Caravan_ESP32",
"latitude": "44.412",
"longitude": "26.123",
"field1": "Humidity",
"field2": "Temperature",
"field7": "boot_count",
"field8": "h_thres",
"created_at": "2020-07-06T13:59:32Z",
"updated_at": "2020-07-10T06:11:42Z",
"last_entry_id": 11298
},
"feeds": [
{
"created_at": "2020-07-10T05:51:33Z",
"entry_id": 11298,
"field1": "44.444",
"latitude": "45.01",
"longitude": "27.01",
"elevation": "10.1"
}
]
}
I get the data from channel settings:
{
"id": 1094740,
"name": "Caravan_ESP32",
"description": "",
"latitude": "44.412",
"longitude": "26.123",
"created_at": "2020-07-06T13:59:32Z",
"elevation": "",
"last_entry_id": 11298,
"public_flag": false,
"url": "",
"ranking": 30,
"metadata": "",
"license_id": 0,
"github_url": null,
"tags": [],
"api_keys": [
{
"api_key": "XX",
"write_flag": true
},
{
"api_key": "XX",
"write_flag": false
}
]
}
As you can see above, location data is different. When I write location data as above, I would like to see it updated in the channel location. Is this possible?
Thanks,
George

Accepted Answer

Vinod
Vinod on 10 Jul 2020
The lat-lon of the channel is where the channel is located. The lat-lon of the feed is where the actual feed was measured.
To take a concrete example, say you had one channel for your farm. On your farm you had multiple sensors (maybe an autonomous lawn mower?). Each sensor might make a reading at a different GPS location, but, your farm itself (and the channel) doesn't move. The channel lat-lon is used to show the map on the channel view. The feed lat-lon may be used to overlay the location of each individual sensor reading on the map, like this example.
  5 Comments
George Popovici
George Popovici on 14 Jul 2020
Edited: George Popovici on 14 Jul 2020
Thanks Christopher.
I did that. I am not happy on how it looks like, referring to the map created with geoscatter and geobasemap commands. I could not change the scale, so the location is like a little dot on the whole earth map :). In addition, you cannot zoom in / out like you can do on the channel map.
Code is below:
George Popovici
George Popovici on 14 Jul 2020
mapData = thingSpeakRead(readChannelID,'ReadKey',readAPIKey,...
'numpoints',10,'location',1,'outputformat','timetable');
disp(mapData);
% gx = geoaxes;
geoscatter(mapData.Latitude,mapData.Longitude,'r');
%geobasemap('satellite');
geobasemap('streets');
% geobasemap(gx,'streets');

Sign in to comment.

More Answers (0)

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on Read Data from Channel in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!