Skip to content

Commit

Permalink
updated ch13-transform - join points w polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDougherty committed Oct 21, 2024
1 parent 613c885 commit 56b58fd
Show file tree
Hide file tree
Showing 138 changed files with 147 additions and 141 deletions.
6 changes: 5 additions & 1 deletion 13-transform.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,11 @@ knitr::include_graphics("images/13-transform/mapshaper-clip-annotated.png")
```

#### Join points with polygon map {-}
Joining a spreadsheet of point data with geographical boundaries is also known as a *spatial join* and is a common task in data visualization. In this exercise, you will download this table of [Connecticut electric vehicle charging station data, including latitude and longitude coordinates for each location, in CSV format](data/ct-stations.csv), and also download this [Connecticut census tracts 2018 boundaries in GeoJSON format](data/ct-census-tracts-2018.geojson). Our goal is to use Mapshaper's powerful `-join` command to answer this question: in which census tract is each charging station located?
Joining a spreadsheet of point data with geographical boundaries is also known as a *spatial join* and is a common task in data visualization. Below we will download two files: a CSV table of points with latitude-longitudue coordinates and a GeoJSON file of census tract boundaries. Our goal is to use Mapshaper's powerful `-join` command to answer this question: in which census tract is each charging station located?

Before you start, download this table of [Connecticut electric vehicle charging station data, including latitude and longitude coordinates for each location, in CSV format](data/ct-stations.csv). Note: Safari browser users may need to File > Save As > Format: Page Source to download in CSV format.

Also, download this [Connecticut census tracts 2018 boundaries in GeoJSON format](data/ct-census-tracts-2018.geojson). Note: Safari browser users may need to File > Save As > Format: Page Source to download in GeoJSON format.

1. Import the CSV point data file you downloaded above into Mapshaper using its Quick import box. Click on the *inspect features* arrow tool and float over cells to confirm that they contain *Latitude* and *Longitude* data columns, as shown in Figure \@ref(fig:mapshaper-inspect-csv).

Expand Down
2 changes: 1 addition & 1 deletion docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/alternative.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/annotated-datawrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/audience-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/authors.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/bad-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/bar-column-google.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/believe.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/biased-comparisons.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/bookdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/bulk-geocode.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/calculate.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chart-datawrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chart-design.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chart-google.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chart-tableau.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chartcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chartjs-bar-column.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chartjs-bubble.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chartjs-error-bars.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chartjs-line.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/chartjs-scatter.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/choose.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/choropleth-datawrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/clean.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/combine-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/comparisons.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/convert-kmz.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/copy-leaflet.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/copy.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/create-repo.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/csv.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/data-bias.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/database.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/describe-comparisons.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/design-choropleth.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/detect.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/draw-attention.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/embed-code.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/filtered-line-tableau.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion docs/find-and-replace.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="author" content="Ilya Ilyankou" />


<meta name="date" content="2024-09-09" />
<meta name="date" content="2024-10-21" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
Loading

0 comments on commit 56b58fd

Please sign in to comment.