Ergonomic Ville Centrale

Chandrasekhar Gudipati
3 min readMay 15, 2020

--

Most countries tend to have their capitals far from a central geographic location. As most countries prefer to have their capitals on a shoreline, those countries with multiple shorelines far from one another tend to have major cities far from their capitals. Take the USA for example. Major cities on the West Coast like Los Angeles, San Francisco, Seattle and San Diego are far from the capital. This makes the citizens of these cities feel alienated and apart from the central national issues. These are precursors to civil unrest and divisional ideologies.

Countries like Brazil and India understood these problems. They shifted their capitals to more central regions in order to prevent such uprisings. This is especially important in India due to the vast number of religions and customs which could easily be used to spark communal hatred and violence.

After thinking about this, I decided to come up with an algorithm that helps authorities to find a central location for a new capital. This is not just the geometric mean of all extremities of a country, but a specialized focal point that takes into account where the most important cities in a country are.

This algorithm can also be used by companies or organizations with multiple branches. They can provide all their branches in descending order of importance and the algorithm will find an ideal location for new headquarters.

The code for the algorithm is written in Python. The libraries used are ‘pandas’ for dataframes, ‘requests’ for HTTP requests, ‘bs4’ (BeautifulSoup) for HTML and XML parsing i.e. Web Scraping and ‘Folium’ for map plotting.

https://github.com/cgudipati/Coursera_Capstone/blob/master/FinalSubmissionCapstone.ipynb

The above link leads directly to the Jupyter notebook file that contains the entire code for this project.

The example that was used to analyze the code was that of the USA. I took the top twenty most important cities of the USA by population count (you could take a bigger or smaller number, I just picked the number twenty randomly) from Wikipedia and plotted my new location, which happens to be near Geneva, Nebraska.

Here are several problems that I encountered while typing the code up:

For starters, note that °W is an indication that we must take the negative value of the location coordinate in front of it because the conventional coordinates are written in °E.

Also, note how difficult it is to separate data from the Pandas dataframe. I realized that an easy way to analyze this data is to convert the data into a string form and then split the unwanted parts away. The residual strings can then be converted into float form in order to make them ready for the algorithm steps.

Finally, while scraping the web, it is important to understand the table class and the number of tables of the same class that lie before the table that you want to use.

The Final Location of our new Capital

Et voilà ! Hope you enjoyed this article!

--

--

Chandrasekhar Gudipati
Chandrasekhar Gudipati

Written by Chandrasekhar Gudipati

An avid tech enthusiast with a keen interest in Data Science, IOT and Graphic Design.

No responses yet