Plotting each plaque as an individual marker would make the map hard to read, especially when zoomed out. There are 3370 markers in our historical Plaques dataset. Zoom_start =10, height =‘92%’, prefer_canvas = True ) We also reduce the map height to make room for a title. Folium uses OpenStreetMap as the base map by default, but we choose Stamen Toner because the style is cleaner and looks more historical. There are several parameters we can apply including defining the zoom_start and base map style. Initializing a map with Folium is as simple as calling the “Map” function with the coordinates of the map center. Now we have the data in the proper formats and are ready to plot on a map. We convert this is more intuitive square kilometers and calculate the Plaque density for each Borough polygon.īoroughs = boroughs / 100īoroughs = boroughs / boroughs The Boroughs GeoDataFrame contains an area field in hectares. Say you are planning a trip and would like to see as many Plaques as possible in a single day, knowing the Plaque density would be a more useful metric. Knowing how many markers are in each borough is a fairly useful metric, but we can do better. sjoin (plaques, boroughs ).groupby (“index_right” ).size ().rename (“numPlaques” ), # Find the number of plaques in each borough To connect our choropleth layer to the Plaques point features, we perform a spatial join to extract the number of historical Plaque points that are contained within each Borough polygon. In this example, we will incorporate both a clickable point layer and a polygon choropleth layer. read_json (“” ).dropna ().drop (‘updated_at’, axis =1 ) Using Pandas and GeoPandas, read the data into GeoDataFrames.įrom folium. We use data from the UK only, but the database includes historic markers across the globe (consider aiming your map at your favorite city!) OpenPlaques is a crowdsourced database of historical markers. We will source London borough boundaries and historic plaque data from the following sources. If you set up a geospatial Python environment following our tutorial here, you’re already good to go. If you find this tutorial helpful in making a map of your own please share it with us on Twitter Python 3.8 environment with the following packages: Folium 0.12.1, GeoPandas 0.9.0, and Pandas 1.4.2. We highly suggest you choose a location and dataset of interest to you - data research and acquisition are fantastically useful skills! See the post on “Free GIS Data and Where to Find it” for some good tips. Image from: Īlthough we choose historical plaques in London, the general workflow here can be followed for any other dataset and/or location. An interactive map is an ideal medium for users to explore and learn more about the history of London from a database of historical markers.Įxample of one of many historical markers spread across London and the rest of the UK. However, not everyone will have the chance to do this in person. When exploring London city streets, you can immerse yourself in history by reading some of the thousands of historical markers connecting locations with notable events, buildings, and people throughout history. We will walk through the entire workflow to produce an interactive map of London historical markers from data acquisition and processing, through map design and hosting online. Creating an interactive map also highlights the creator’s ability to conduct back-end data acquisition and processing, as well as to design an effective front-end user experience.įor this reason, adding an interactive map to your portfolio is a stellar way to showcase your ability to clients, make yourself stand out to potential employers, or share a personal project with the wider community. Most interactive maps have functionality for a user to pan & zoom around a map, click on markers, and get more data from popup windows. Interactive maps are a great medium for data visualization because they allow users to explore a dataset for themselves. Tutorial: Create and host an interactive web map with Python
0 Comments
Leave a Reply. |