I am creating an android app which will be used in Africa. My app is using Google map to show users the nearest businesses they are looking for. My question is, I want to know the district which the user is based on their GPS location (lat/lang). As you can see the attached image, Google knows the boundaries of the local districts (in this case Somalia). Do Google provide such information? or is there any other way I can do it myself. I searched online but couldn't find any useful information about this. Please help.
Asked
Active
Viewed 55 times
0
-
I'd check OpenStreetMap instead. – lexicore Feb 25 '18 at 19:02
-
Google doesn't expose boundaries in their APIs, you should get them from other sources. For example, https://stackoverflow.com/a/40172098/5140781 – xomena Feb 26 '18 at 10:31
-
Thank you guys. I managed to do it by using the [Ray Casting](http://vinsol.com/blog/2016/08/04/ray-casting-algorithm/) algorithm and defined the borders of districts as groups of latitudes and longitudes (in my case I have 7 districts, each group represents a district) then the application checks the user's location in each of these 7 groups and then returns with the group the user location is inside. This may not be the best solution but it works for me. – Programm-ist Mar 06 '18 at 23:27