Search code examples
pythonjsonfolium

Plotting with folium


The task is to make an adress popularity map for Moscow. Basically, it should look like this:

https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/GeoJSON_and_choropleth.ipynb

For my map I use public geojson: http://gis-lab.info/qa/moscow-atd.html

The only data I have - points coordinates and there's no information about the district they belong to.

Question 1: Do I have to manually calculate for each disctrict if the point belongs to it, or there is more effective way to do this?

Question 2: If there is no way to do this easier, then, how can I get all the coordinates for each disctrict from the geojson file (link above)?


Solution

  • Thanks to @BobHaffner, I tried to solve the problem using geopandas.

    Here are my steps:

    1. I download a shape-files for Moscow using this link click
    2. From a list of tuples containing x and y (latitude and logitude) coordinates I create list of Points (docs)
    3. Assuming that in the dataframe from the first link I have polygons I can write a simple loop for checking if the Point is inside this polygon. For details read this.