Webmaps

using python package folium

Clearing Data

Given the .list file(imdb dataset) which consists of more than 1 million lines with film names, the year that they were relesed and the set location(sometimes with some additional info), I neaded to get the clear data out of it, so that it would be easier to work with it. Obviously, the file was messy, but I did not need all the films(and there's the reson for that which will be depicted later). Therefore, I used pandas package in order to get the needed info and turn it into clear csv-file cleared_films.csv. All in all, I got clear DataFrame of more than 10000 films and info about them.


Coordinates

Having the places(countries, cities, streets etc.) where all the films were shot, I needed to get their accurate geographical coordinates location(to be able to set some Markers later). In order to do so, I used geopy python package. The thing is that with only one request per second is allowed there. So I launched geocoder.py overnight and managed to get coordinates for all the locations.


Creating Maps

The task itself(create the map and mark different types of film on it) is implemented using folium python package. main.py can be launched using comand line.

python3 main.py 2008 49.7714509 23.6730132 /Users/<'username'>/<'path_to_dataset'>/cleared_films.csv

It takes three arguments:

  1. year (integer)
  2. latitude (float)
  3. longitude (float)
  4. path to the dataset (csv-file: str)

The program will find up to ten films that were shot closest to the given location(latitude, longitude) in the given year. It will create an .html file named my_map1.html that you can open using your favorite browser

safari-icon.pnggoogle-chrome-icon-blue-black-33.pngFirefox-icon.pngInternet-Explorer-icon.png

After you opened the page you can do next things:

  • zoom in or out + enter or exit full-screen mode (topright) Screenshot 2022-02-08 at 16 54 20 Screenshot 2022-02-08 at 16 54 44 Screenshot 2022-02-08 at 16 55 27
  • display or remove layers of Markers + change dark and light modes of the map (topright) Screenshot 2022-02-08 at 16 38 07
  • change scrolling method (bottomleft) Screenshot 2022-02-08 at 16 39 31