An introduction to GIS with Python

Learning Outcomes

1) Introduction to open-source GIS with Python

2) How to geocode: coordinates from addresses

3) How to do vector overlay with Python

4) How to make web maps with Python

Lab Objective

We are going investigate at Police Involved Deaths in BC from June 2011 to May 2021. The data was obtained compiled from multiple sources to build on a dateset collected by the CBC. We will geocode the data to extract location information and determine where incidents are occurring. We will the intersect the points with census data and normalize by population to determine where rates of police-involved deaths are highest.

Why Police-Involved Deaths?

Canadian police institutions rely on the lack of information to perpetuate a narrative that police violence is "just an American issue" and that Canada is "better". We need to have discussions about the pervasiveness of this issue in Canada and make it part of the public discourse in order to hold Canadian institutions accountable.

Why Python?

Its a great language! But its not the only language. Just as English, Cantonese, or Punjabi could all be used to explain systemic racism; Python, Javascirpt, or R can all be used to quantify and visualize the scale of the problem. I like python because its very flexible, fairly easy to read / write, well suited for data analysis, has lots of packages for GIS, and it's completely free.

Geocoding

The process of attributing coordinates (Latitude/Longitude) to descriptive locations (Street Address). With Python, we can use a variety of web based services (google maps, mapbox, open street map, etc.) to perform geocoding. We're using mapbox today because it strikes a good balance between cost and accuracy. Google maps is arguably the best geocoding service, but it expensive :/ (5 USD per 1000 request). Mapbox is free (Up to 15,000 requests per month) and gives fairly reliable results.

Vector Overlay

We've already done some vector overlay in ArcGIS pro. In this lab we'll get a quick overview of how you would use Python to do a simple point in polygon overlay using a package called geopandas.

Web mapping

Web mapping takes cartography beyond static maps. Today, we'll use a Python package called Follium which allows us to create dynamic, interactive web maps that can be embedded in webpages.

Sound Intimidating?

Don't worry, you won't need to know any coding. We'll be using a python server that is already set up. We only need to install one extra package on it and I'll walk you through the whole process. I'll be giving you pre-written blocks of code and I'll walk you through the whole process step by step.