Python displaying dots on a city map

I am not very familiar with GIS systems in python. I am looking for a library to do the following:

Suppose I have a pandas data frame with one column of street addresses and another one of the categorical or numerical data tagged. Something like San Francisco:

df=pd.DataFrame({'Location': ['1 Dr Carlton B Goodlett Place','1390 Market Street','1100 Fillmore St' ],
                 'Type': ['G', 'G','C']})

And I want to build them on a map of San Francisco, where the Type column is in red for the data in ā€œGā€ and blue for ā€œCā€. How could I make such a simple plot? How will I also include streets on the map? Could there be a simple example?

I found a library called Geopy to change the data to longitude and latitude if it helps to convert the data. Also read what matplotlibcan do this with help basemap, but for areas, big cities.

+3
source share
1 answer

There are many ways to plot data on a map. The geophysical library includes geocoding libraries for converting addresses to gps coordinates, but you still need to look at the license (for example, Google asks you to buy a license or use the service only with their maps). An easy way to get the map background is to use the free tile service. Here are some useful URLs:

http://leafletjs.com/ ( "" js- )

http://www.openstreetmap.org/ ( "" )

+2

All Articles