Thus far Ive been able to plot out points from a database table selecting the latitude and longitude. I want to be able to add a third parameter, accuracy in meters, and plot the map with GeoCircles with the accuracy in meters as the radius. I cant seem to figure out how to get that third variable working.
So I get to GeoGraphics[GeoCircle @@@ data], which works with latitude and longitude alone ({latitude,longitude}), but I cant figure out a way to add the accuracy piece to specify the circle radius in meters ({latitude,longitude,radius} doesnt work).
Im pulling this data from a database (latitude, longitude, accuracy), so how would it format for that? Ive got GeoCircle @@@ data, but is there a way to select a specific field in data so I could structure it like GeoCircle [{{data.latitude, data.longitude}, Quantity[data.accuracy,m]}?
Sorry, but Im still confused. Im pulling the data from an SQLite database, and your response suggests that Im supposed to enter it all manually. This language has got a steep learning curve.
Needs[DatabaseLink`"]
conn = OpenSQLConnection["Dash"]; data =
SQLExecute[conn,
"SELECT latitude, longitude, accuracy FROM points WHERE DATETIME(time/1000,'unixepoch','localtime') >= DATETIME('now','start of day','-1 days') AND DATETIME(time/1000,'unixepoch','localtime') < DATETIME('now','start of day') ORDER BY time"];
This is going to give me tuplets (triplets, if you will) in response
Well, you did not supply any data earlier so I had to cook something up.
If I understand correctly, the data you extract should look like what you get from
(ds[Values] // Normal)
in the example I attached. It is a vector of three numbers for each record. Can you bring it to this form?
The output from the query looks like this (showing just the first part because its 57,000 points in the database and growing); basically triplets/vectors of {latitude, longitude, accuracy in meters}:
I suppose these are {{lat,lon,R},..} data each. So you extract the data from the sqldata base, call this resulting table “dbdata” or whatever and you replace
(ds[Values] // Normal)
(which is so to say the query from my dataset) with dbdata
Note that according to your spec “km” should be replaced with “m”, but if you do so the resulting images will not show much interesting stuff due to the limited resolution of th emap
This is an example of what I started with; I wanted to create a new script that instead of the line would show the points with the accompanying margin of error. Most resulting maps would be zoomed enough to see large differences in the accuracy (the long excursion up to Atlanta and back was evacuating from Hurricane Irma in 2017).
Apparently you have set the “]” brackets differently which you can spot if yoe look at the very end of your command (yours → dbdata], mine → dbdata]] )