Fast and easy plotting of extensive sets of GPS coordinates stored in ThingSpeak

32 views (last 30 days)
Tens of thousands of stored GPS data on ThingSpeak can be plotted much faster on a map in a simple way, if MATLAB would be willing to change the order of variables in the channel feed csv-file to make it match directly as input file for the ROUTECONVERTER program.
I use a NEO-6M GPS module to store GPS data on ThingSpeak. I tried to find an easy way to plot many GPS coordinates on a map. However, within ThingSpeak there is no possibility to do so. Each time I was linked to Google maps for which I needed an API key to show my GPS results (it is a cumbersome method to finally see the GPS data on a map). I discovered that there is a much easier way to achieve this. ROUTECONVERTER ( www.routeconverter.com ) is a free, user friendly GPS tool to display, edit, enrich and convert routes, tracks and waypoints. It enables the use of a large number of maps, download of maps and supports specific Google maps for which an API key has to be filled in within the program. ROUTECONVERTER supports more than 81 of the most common GPS file formats. It automatically detects a file format, which thereafter can be converted to any other file format. One of the file types is the csv-file format which is also used by ThingSpeak.
For THINGSPEAK the channel feed csv-file looks like this:
Date&Time, Entry_id, Latitude, Longitude
2021-01-21 12:27:11 +0100, 15, 52.612135, 4.722695
But for ROUTECONVERTER the csv-file should have a format like this:
Longitude, Latitude, a string of text (double quotes are needed, if comma’s or semicolons occur in this text string!)
4.722695, 52.612135, 2021-01-21 12:27:11 +0100
If the export csv-file of ThingSpeak would have the same format as the input csv-file for ROUTECONVERTER, it could be used immediately as an input file for ROUTECONVERTER and would therefore immediately show all GPS positions on a map.
I presume that ThingSpeak/MATLAB would prefer to have “Entry_ID” and “Date&Time” to be inserted in their csv-file. This might be realized in the “text string” by using a specific character e.g. “#” (no comma’s and semicolons!) to separate both as can be seen below:
Longitude, Latitude, Entry_ID # Date&Time
4.722695, 52.612135, 1 # 2021-01-21 12:27:11 +0100
Both items in the text string still enable immediate plotting of the GPS coordinates on a map by opening this file in ROUTECONVERTER and still enable easy splitting of the text string in an Excel spreadsheet.
ThingSpeak only presents the field charts of both latitude and longitude against time, but these are absolutely not very helpful or clarifying. An adjusted export feed csv-file and a reference to ROUTECONVERTER in ThingSpeak would enable the GPS-ThingSpeak users to see immediate GPS results on a map.
Therefore my question: Is ThingSpeak/MATLAB willing to adjust the format of their export feed csv-file in order to enable immediate plotting of GPS coordinates on a map by ROUTECONVERTER?

Answers (1)

Vinod
Vinod on 25 Jan 2021
MATLAB has the ability to write CSV, or more generally text files, in any format of your choice. See this documentation page. So, if a user wants to export their ThingSpeak data into a CSV file directly usable by routeconverter, you can use the thingSpeakRead function to retrieve the data and write it out in the corresponding format.
Also note that MATLAB has extensive mapping functionality in Mapping Toolbox that allows you to do graphing of your ThingSpeak data on a map directly on ThingSpeak. This example is a great starting point.

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on Write Data to Channel in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!