Cannot display the map and mapdata correctly

Dear Sir or Madam,
I am testing to use widget to display map and the plotted values.according to the example. But it always shows the big map (see upper picture) instead of showing the more detailed location map picture (see lower picture). Are the 'location' and 'Location', 'Timestamps' are the build-in variables? I put my fields names 'LatitudeX', 'LongitudeY' as in the setting. Please advise how to do and fix it. Many thanks.

 채택된 답변

Locations are not automatically filled in. If your device writes data to the fields Latitude and Longitude then they will exist
Like this
https://api.thingspeak.com/update.json?api_key=<write_api_key>&field1=123&lat=43.10&long=71.2
Then then you read the channel data and set location =1 (or true), you get the position data in the response.
mydata=thingSpeakRead(876466,'location',1,'outputformat','timetable')
mydata = 1x6 timetable
Timestamps CounterValue SoilMoisture TemperatureF Latitude Longitude Altitude ____________________ ____________ ____________ ____________ ________ _________ ________ 02-Oct-2019 12:46:58 37 767 66.74 42.299 -71.352 NaN
If you are writing the sensor data to your channel in fields called LattitudeY and LongitudeY you can get the data from those variables for plotting.
mydata=thingSpeakRead(yourChannel,'outputformat','timetable')
(psuedodata)
timeStamps sensordata1 sensordata2 LatitudeX LongitudeY
12:23 1.2 2.3 43.1 77.9
Can you share the link to the example you are refering to?

댓글 수: 6

Aaron
Aaron 2024년 12월 6일
이동: Walter Roberson 2024년 12월 6일
Thanks verh much. I cannot use the datatip or plot the coordinate labels (latituude and longitude vlues, timestamp) beside the map data points in the geoscatter map. Please advise how to resolve it. Many thanks.
No functions after adding the code below.
plot (sensorData.Timestamps,sensorData.LatitudX) ylabel('^0F'); hold;
yyaxis right plot(sensorData.Timestamps,sensorData.LongitudY); ylabel('position'); ylim([700 900]); hold off; and
geoscatter() plots on a GeographicAxes, which does not work with regular plot(). You need to geoplot() instead of regular plot()
However... it makes no sense at all to plot time based data on a geographic axis.
Aaron
Aaron 2024년 12월 6일
이동: Stephen23 2024년 12월 6일
Thanks. Could you advise how to use geoplot to display the values of latitude and longitude beside each ploted point. Many thanks.
I would use text function to get the valeus on it, after you do the geoplot. There is also annotation, but I think that is better for single callouts not general labeling.
Aaron
Aaron 2024년 12월 21일
이동: Walter Roberson 2024년 12월 21일

Dear Sir, Thanks very much. I cannot update a text character, say, abc into, say, field4 using https://api.thingspeak.com/update.json?api_key....... Only numeric number can be updated. Why? How can I update a text onto the field?

Aaron

I just confirmed that you can update the field values with text using this API. For example:
https://api.thingspeak.com/update?api_key=<YOUR_WRITE_API_KEY>&field1=abc
You can confirm the value by reading the value using this API. For example:
https://api.thingspeak.com/channels/<YOUR_CHANNEL_ID>/feeds.json?results=1&api_key=<CHANNEL_READ_API_KEY>
Note that if you insert non-numeric values into the fields, you will need to use MATLAB to generate the output visualization. Built-in field charts only work on numeric values.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

도움말 센터File Exchange에서 Geographic Plots에 대해 자세히 알아보기

제품

태그

질문:

2024년 12월 4일

댓글:

2024년 12월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by