You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.Rmd
+51-1Lines changed: 51 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -36,10 +36,60 @@ library(canmap)
36
36
tibble::as_tibble(shapefile_paths)
37
37
38
38
# then pick a shapefile and get the link:
39
-
shapefile_paths[1, c("filepath", "path")]
39
+
(url <- shapefile_paths[1, ]$path)
40
+
41
+
# then you can download it yourself, or use download_geography(url)
42
+
```
43
+
44
+
45
+
## Documentation
46
+
47
+
48
+
A list of useful links to clean up later:
49
+
50
+
*[Geography definitions and documentation](https://www.statcan.gc.ca/eng/subjects/standard/sgc/geography)
51
+
*[Root for geography downloads and documentation](https://www12.statcan.gc.ca/census-recensement/2016/geo/index-eng.cfm)
52
+
*[Direct link to download directory for 2016 shapefiles](https://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/bound-limit-2016-eng.cfm)
53
+
*[Heirarchy of geography](https://www150.statcan.gc.ca/n1/pub/92-195-x/2011001/other-autre/hierarch/h-eng.htm)
54
+
55
+
56
+
### Parsing the filename for metadata
57
+
58
+
Suppose you've downloaded the geography file ```lpr_000a16a_e.zip```. The filename defines the important geographic characteristics of the file (you can process using the ```code_pos``` dataset for code positions, or ```get_geoinfo```).
59
+
60
+
```{r codes, warning = FALSE, message = FALSE}
61
+
str(geoinfo("lpr_000a16a_e"))
62
+
```
63
+
64
+
And each of these codes has a meaning that can be found (sometimes) in the geography guide that accompanies a downloaded file (but you can't find out the details until *after* you've downloaded it, and is missing some information).
65
+
66
+
Your first default parameters should be:
67
+
68
+
-```file_type == "a"``` (digital boundary file---it doesn't look as good but it's smaller)
69
+
-```format == "a"``` (ArcGIS/ArcInfo®/.shp---for use with ```sf``` and other ```R``` geographic packages)
70
+
-```geo_coverage == "000"``` (Canada---the only option AFAIK)
71
+
-```projection == "g"``` (geographic projection/lat-long---this makes it less likely for the user to get caught up in coordinate reference systems [CRS] conversion issues)
72
+
73
+
The most important choices for the user are: year (2016 is the latest census year currently available), language (english or french) and geo_code/geo_level. A list of geo codes and geo levels are given in the ```code_book``` dataset:
Business data usually isn't released below the economic region level (```er_```), while census data can go down to census tract (```ct_```), dissemination area (```da_```) or dissemination block (```db_```).
80
+
81
+
These are english codes, while the french codes are also in the dataset---english and french maps are in different files, so they have different codes: ```lpr_000a16a_e.zip``` has the english province/territory maps and ```lpr_000a16a_f.zip``` has the french province/territory maps. The only difference, AFAIK, is that the guide and geography names are in french in the french version.
82
+
83
+
84
+
## Download and extract shapefiles to ```./geography/```
85
+
86
+
```{r eval = FALSE}
87
+
download_geography(url)
40
88
```
41
89
42
90
91
+
## Notes
92
+
43
93
Please note that the 'canmap' project is released with a
44
94
[Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md).
45
95
By contributing to this project, you agree to abide by its terms.
0 commit comments