CodeForAfrica / sensors.AFRICA-api

The sensors.AFRICA API receiving, storing, and processing data received from sensors across the continentent. Accessible at https://api.sensors.africa/
https://api.sensors.africa/
18 stars 7 forks source link

Ft sensors cities #105

Closed esirK closed 3 years ago

esirK commented 3 years ago

Description

Adds management command to reverse geocode nodes locations and update the city names for nodes with no city associated with them

Fixes # (issue)

Type of change

Screenshots

Screenshot 2021-02-04 at 13 48 07

Checklist:

esirK commented 3 years ago
  1. Why do we need the geo reversing in the api itself? Each function responsible of pushing data should provide correct location moving foward, right?

Yes moving forward we expect that. But we aren't guaranteed that will always be the case so I'm just leaving the management command here just in case anyone needs it in the future.

Shouldn't cities be part of location with countries in meta?

I've attached the screen shot to show how it will look like. I asked @KobbyMmo before adding sensors_cities as their own object

kilemensi commented 3 years ago

Shouldn't cities be part of location with countries in meta?

I've attached the screen shot to show how it will look like. I asked @KobbyMmo before adding sensors_cities as their own object

Nah, you can't have sensors_locations to mean countries only and have separate _sensorscities... either have sensors_countries and sensors_cities as standalone objects or one sensors_locations return countries and their count as well as cities and their count.

It should even be cities in their respective countries but it's too late for today I think.

KobbyMmo commented 3 years ago

Yea @esirK , what you have will work for me

This will also be fine.

location:{
      cities:{
        count: 12, data: []
      },
      countries:{
        count: 12, data: []
      }
}
esirK commented 3 years ago

@KobbyMmo I'll stick to what we have for now. The only thing you will change is using sensors_countries instead of sensors_locations