This is a pretty cool tool built using Python and Streamlit. In addition, I also used geographic Python libraries, such as reverse_geocoder, geopy, and country_converter.
Initially we start with a map. When the user inputs their location, we show the user’s location on the map. In addition, we show the location on the exact opposite side of the world.
If the opposite location is on land, we display the country of the location. If it is in water, we show the location of the nearest country.
One challenge when working on this project was handling territories. I couldn’t figure out how to deal with antipodal locations in the water (many times, the closest “country” would end up being an overseas territory).
This was my solution: I created a dictionary connecting each territory to their respective countries. Thus, territories are included in the app (ex: some locations in the Indian Ocean show up as French due to overseas French territories).
You can view the code here.