top of page

Get to school

To get started, I need an address base. In this case, such a database is updated annually on the website of the electronic legal documentation fund http://docs.cntd.ru/document/432885269. I will use the latest from 01/23/2019.

 

I create a request through "get":

Новый рисунок.png

Checking the status:

Новый рисунок (1).png

For this example, I will select two parts of the table with id = ‘p0012’ and id = ‘p0013’ immediately renaming the column names:

2.PNG
Новый рисунок (3).png
Новый рисунок (2).png
3.PNG

I will combine in a common table:

4.PNG
5.PNG

Further, to form queries at the address, it is necessary to combine the columns "Street" and "Home" so that each house has its street. Create a list using .str.split (''):

6.PNG

I will compile the code for the table reorganization:

7.PNG

The result is an address table with full names !!

8.PNG

To get geolocation I will use geopy.geocoders:

11.PNG

Now we have a table completely ready for queries to 2Gis!

9.PNG

By making a request to the address:

'https://2gis.ru/perm/firm/70000001023551363%2C56.245837%2C57.984467/geo/2252435468852443%2C56.263304%2C57.983466/routeSearch/rsType/pedestrian/from/'+ df3['Longitude_from'] +'%2C'+ df3['Latitude_from'] +'%7CГероев%20Хасана%2C%2081%7C2252435468851481%7Cgeo/to/'+ df3['Longitude_to'] +'%2C'+ df3['Latitude_to'] +'%7CЛьв%20Шатрова%2C%2025%7C2252435468852574%7Cgeo?queryState=center%2F56.274419%2C57.987299%2Fzoom%2F15%2FrouteTab'

I will get the shortest distances from home to school.

10.PNG

Also, you can use the information to analyze the human workload of schools and redistribute students, possibly building a new school.

234.JPG
bottom of page