Which value to choose for GPS Location

Hi, can someone help point me to the correct location in the Docs to learn about how to choose the appropriate GPS Location value (ie, where.lat, best.lat, tower.lat, etc.) to use when passing a position in a JSONata-based Route, for example? I am using this for now, but I seem to often get the location of the tower itself rather than my exact location. I have tried “best” but don’t seem to get GPS positions at all. Thanks

{
“api_key”: $thingspeak_Write_Key_C,
“field1”: body.session,
“field2”: where_lat ? where_lat : tower_lat,
“field3”: where_lon ? where_lon : tower_lon,
“field4”: $round(body.pm25,1),
“field5” : body.trackName,
“field6”: body.icon,
“field7”: body.co2,
“field8”: body.comments,
“status”: body.device
}

I’d like to slightly alter the point of my post to "Why do I get “tower” locations rather than actual precise GPS locations? My Route JSONata is:

{
“api_key”: $thingspeak_Write_Key_C,
“field1”: body.session,
“field2”: where_lat ? where_lat : best_lat,
“field3”: where_lon ? where_lon : best_lon,
“field4”: $round(body.pm25,1),
“field5” : body.trackName,
“field6”: body.icon,
“field7”: body.co2,
“field8”: body.comments,
“status”: body.device
}
and some log JSON:

{
“event”: “e99267da-2f27-8ac1-aa01-323aa8e54b85”,
“when”: 1748287811,
“file”: “env.qo”,
“body”: {
“co2”: 1784,
“comments”: “Its really smokey here”,
“device”: “Blues 2”,
“humidity”: 19.89013481140137,
“icon”: “https://maps.google.com/mapfiles/kml/paddle/grn-circle_maps.png”,
“pm1”: 0,
“pm10”: 0,
“pm25”: 0,
“session”: 1,
“temperature”: 111.3018951416016,
“trackname”: “811 Smith Campus”,
“user”: “BackpAQ Blues Test”
},
“session”: “801834ca-d3ef-4576-af63-500c96690b6f”,
“transport”: “cell:lte:fdd”,
“best_id”: “dev:860322068097127”,
“device”: “dev:860322068097127”,
“product”: “product:xxxxxxxxxxxxxxxxx”,
“app”: “app:89b12bc4-bd51-409c-918c-5b48805faf42”,
“received”: 1748287853.72674,
“req”: “note.add”,
“best_location_type”: “triangulated”,
“best_location_when”: 1748286957,
“best_lat”: 37.88145,
“best_lon”: -122.52413,
“best_location”: “Tamalpais-Homestead Valley California”,
“best_country”: “US”,
“best_timezone”: “America/Los_Angeles”,
“tower_when”: 1748287853,
“tower_lat”: 37.900017,
“tower_lon”: -122.550996,
“tower_country”: “US”,
“tower_location”: “Tamalpais-Homestead Valley California”,
“tower_timezone”: “America/Los_Angeles”,
“tower_id”: “310,410,35629,168984073”,
“tri_when”: 1748286957,
“tri_lat”: 37.88145,
“tri_lon”: -122.52413,
“tri_location”: “Tamalpais-Homestead Valley California”,
“tri_country”: “US”,
“tri_timezone”: “America/Los_Angeles”,
“tri_points”: 15,
“status”: “success”,
“fleets”: [
“fleet:c3692b5c-51c7-46d8-bb77-55c219869846”
]
}

Hi @drewcssv,

I recommend using the best_lat and best_lon values, as those are calculated by Notehub and prioritized based on the method (e.g. GPS, Wi-Fi triangulation, cell tower triangulation, and cell tower location) and the timestamp . Both GPS/GNSS and Wi-Fi Triangulated values are incredibly accurate, while cell tower is less so.

Why do I get “tower” locations rather than actual precise GPS locations?

You should only get a cell tower location if the device is unable to ascertain a GPS position for quite some time. However, in your example, you’re getting the triangulated value: “best_location_type”: “triangulated”,. “tri_points”: 15 means you’re getting a location based on 15 Wi-Fi access points, so it should be quite accurate.

Thanks,
Rob