berthubert / galmon

galileo open source monitoring
GNU General Public License v3.0
199 stars 53 forks source link

Feature: add lat/long lookup to automate volunteer info #95

Open akhepcat opened 4 years ago

akhepcat commented 4 years ago

An example script, using OpenCageGeocode takes a csv inputfile of lat,long outputs a csv of lat,long,city,state,country_code

https://github.com/akhepcat/Miscellaneous/blob/master/LatLongParse.py

This could be run once a day (at most, probably) to populate a cache for displaying the general location of users' receivers.

requires a free API key, which nets 2000+ lookups per day, which is plenty for seeding/updating a local cache on a server.

mahtin commented 4 years ago

While this is a good idea in principal, I would point out that the receivers are operated by volunteers and exposing their location maybe not be the right thing to do. The https://galmon.eu/observers.html information for latitude & longitude is very much rounded down to a single decimal point in order to provide some anonymity and yet make mapping perfectly acceptable (see https://galmon.eu/geo/ for the map).

That said, and using your code example above, I get the following:

$ curl -sS https://galmon.eu/observers.json | jq -r '.[]|.latitude,.longitude' | paste - - > latlongs.csv
$ head -5 latlongs.csv 
52,4.3
52,4.3
52.2,5.1
52,4.3
36.9,-122
$ ./LatLongParse.py > out.txt
$ head -5 out.txt
52.000000,4.300000,Midden-Delfland,South Holland,NL
52.000000,4.300000,Midden-Delfland,South Holland,NL
52.200000,5.100000,Wijdemeren,North Holland,NL
52.000000,4.300000,Midden-Delfland,South Holland,NL
36.900000,-122.000000,n/a,California,US
$

Looking at my station (number 5, i.e. the last one listed above), mapping those lat,long's shows how far off you can be with these rounded lat,long's can be:

image

I would recommend that city/country information isn't as useful as you believe. I believe the map shows enough information to trigger a new volunteer to sign-up within an open area of the map. (For example: Japan, anywhere in the Middle East, Central America, North Africa, etc etc).

mahtin commented 4 years ago

One more comment: I'm a ham radio operator and I use my callsign in the owner section (as do some others) within the observers data. In the US, my location information is public as conditions of being granted my license and I'm actually OK with that fact.