I have at my dispositions a JSON list with all the bike stations called Velib in Paris with their latitude, longitude, number of bikes and capacity.
I am trying to calculate proportion averages(number_of_bikes/bike_capacity) of the number of bikes for the bike stations in different districts of Paris. I would like to create a mapping/function of a city that differentiates different districts(= so that when i put coordinates it sends me back the number or the district ) so that when i try to calculate an average per part of the city i can insert coordinates of the bike stations and it goes directly into the average of the number of bikes of the district it is in.
I can do it when the districts are parallel one to each other delimited by horizontal/ vertical strait lines.
for k in range(len(bike_station_list): if lat(bike_station_k)<lat_district_1 and lng(bike_station_k <lng_disctrict_1 ... and so on However in reality Paris districts are far more complex.
How can I create a mapping of the city that can tell me in which district I am.
My first idea was to create a huge matrix with all longitudinal and latitudinal coordinates with the number of the district it is in but it looks a bit exaggerated.
Thanks for helping !