I had a look at the how the location data can be inserted in the Map for Luftdaten and Smart Citizen Kit.
main.py calls each plugin i.e [Luftdaten]() and SmartCitizen python files as shown in Main.py L69
If we see transform_luftdaten function, it creates a field geo_json, which takes latitude, longitude co-ordinates.
We can write our code here, so create a function get_coord_to_location(latitude, longitude) which takes co-ordinates as inputs and return location as output.
Inside the function, would suggest the logic such that
Would suggest create a CSV file with three columns lat, long and location)(store the CSV in logs folder)
First, check if lat,long is stored locally in the CSV.
If yes, return the location
If no, query the API by passing lat,long and store the result in the CSV (so that we don't query the API always and repeatedly
Hello @anshulgaikwad01 and Aman,
I had a look at the how the location data can be inserted in the Map for Luftdaten and Smart Citizen Kit.
main.py calls each plugin i.e [Luftdaten]() and SmartCitizen python files as shown in Main.py L69
If we see
transform_luftdaten
function, it creates a field geo_json, which takes latitude, longitude co-ordinates.We can write our code here, so create a function
get_coord_to_location(latitude, longitude)
which takes co-ordinates as inputs and return location as output.Inside the function, would suggest the logic such that
logs
folder)The same needs to be done for Smart Citizen Kit
I think we can use https://positionstack.com/ or some other Free API to get the details.
Also, we need to change the schema of the Luftdaten resource and SCK resource to add one more column
location
into that.Let me know if you have any further queries.