After creating a location node in the workspaces tree, we can drag the location directly onto the map in order to get a labeled map marker. In this case, my Floating Location has been dragged randomly into eastern Australia somewhere inland between Sydney and Brisbane.
But this isn't where the map marker actually needs to be...
Luckily, we have a data source called SuperBuoy within the location that is receiving data from a buoy for the purpose of measuring ocean temperatures. This buoy is also sending it's GPS coordinates along with the temperature, so we have latitude and longitude parameters. In order for the marker to accurately locate itself on the map, we can use the latitude and longitude parameters to update the location.
The first step is to adjust the location configuration; by default, it will have the Coordinates field set to Fixed Location:
We can change the Coordinates field to be any data source within the location. In this case, we will choose the buoy:
The second step is to adjust the data source configuration. If we go to the Series tab for SuperBuoy, there is a Location coordinates field. By default this is set to None, but we can change it to the table which contains the coordinate data; in this case it's the Main table:
After selecting the Main table, we now have to choose two data series within that table (containing latitude and longitude respectively):
After saving this configuration, the next time the buoy sends data, the map marker of the location will be moved to the correct position on the map. In this case, the actual location of SuperBuoy is revealed to be just off the coast near Sydney:
The next day, SuperBuoy has sent new data to indicate it's now floating off the coast of Brisbane (where the water appears to be slightly warmer):
You may not have a buoy that moves quite this fast, but you can use this exact technique to correctly locate and move any of your own location map markers, as long as you have latitude and longitude parameter data.
A final point to note: the location requires latitude and longitude to be expressed in decimal degrees. If your location data is using a different notation, you will have to convert it to decimal degrees. Using transforms or processing may be required for this purpose.
Comments
0 comments
Article is closed for comments.