Skip to content

Commit cc4f8af

Browse files
author
Michael Stepner
committed
Merge branch 'release/v1.00'
2 parents 69a4334 + 4acbbea commit cc4f8af

27 files changed

Lines changed: 487 additions & 170 deletions

map_shapefiles/can_er_maptile.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
**maptile {hline 2} Geography: can_er**
2+
3+
# Description
4+
5+
**can_er** generates a map of Canadian economic regions.
6+
7+
An economic region is a grouping of complete census divisions (with one exception in Ontario) created as a standard geographic unit for analysis of regional economic activity. [[Source]](http://www.statcan.gc.ca/pub/92-195-x/2011001/geo/er-re/er-re-eng.htm)
8+
9+
This template uses the boundaries from the 2011 Census.
10+
11+
# Geographic ID variables
12+
13+
Table: col1width=16
14+
15+
---------------- -----------------------------
16+
**er** 4-digit economic region codes
17+
---------------- -----------------------------
18+
19+
# Geography-Specific Options
20+
21+
Table: col1width=22
22+
23+
--------------------- -----------------------------
24+
**mapifprov** excludes the territories from the map, only mapping the 10 provinces
25+
--------------------- -----------------------------
26+
27+
{p 32 32 2}This does not exclude the territories' data from the calculation of the quantiles (equal-sized color bins). To avoid counting the territories in the quantiles, add an **if** statement to your maptile command that excludes them.
28+
29+
{p 32 32 2}{opt mapifprov} is equivalent to {opt mapif( \<province, not territory\> )} but additionally adjusts the legend placement.
30+
31+
Table: col1width=22
32+
33+
--------------------- -----------------------------
34+
{opt legendoffset(#)} manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.
35+
--------------------- -----------------------------
36+
37+
# Author
38+
39+
Michael Stepner{break}
40+
stepner@mit.edu

map_shapefiles/can_er_maptile.smcl

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
11
{smcl}
22

3-
{pstd}
4-
{hi:maptile {hline 2} Geography: can_er}
3+
{pstd}{bf:maptile {hline 2} Geography: can_er}{p_end}
54

65

76
{marker description}{...}
87
{title:Description}
98

10-
{pstd}
11-
{hi:can_er} generates a map of Canadian economic regions.
9+
{pstd}{bf:can_er} generates a map of Canadian economic regions.{p_end}
1210

13-
{pstd}An economic region is a grouping of complete census divisions (with one exception in Ontario) created as a standard geographic unit for analysis of regional economic activity. {browse "http://www.statcan.gc.ca/pub/92-195-x/2011001/geo/er-re/er-re-eng.htm":[Source]}
11+
{pstd}An economic region is a grouping of complete census divisions (with one exception in Ontario) created as a standard geographic unit for analysis of regional economic activity. {browse "http://www.statcan.gc.ca/pub/92-195-x/2011001/geo/er-re/er-re-eng.htm":[Source]}{p_end}
1412

15-
{pstd}This template uses the boundaries from the 2011 Census.
13+
{pstd}This template uses the boundaries from the 2011 Census.{p_end}
1614

1715

18-
{marker idvar}{...}
16+
{marker geographic-id-variables}{...}
1917
{title:Geographic ID variables}
2018

21-
{synoptset 15 tabbed}{...}
22-
{synopt :{hi:er}} 4-digit economic region codes{p_end}
19+
{synoptset 16 tabbed}{...}
20+
{synopt:{bf:er}}4-digit economic region codes{p_end}
2321

2422

25-
{marker geooptions}{...}
23+
{marker geography-specific-options}{...}
2624
{title:Geography-Specific Options}
2725

2826
{synoptset 22 tabbed}{...}
29-
{synopt :{opt mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}
27+
{synopt:{bf:mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}
3028

3129
{p 32 32 2}This does not exclude the territories' data from the calculation of the quantiles (equal-sized color bins). To avoid counting the territories in the quantiles, add an {bf:if} statement to your maptile command that excludes them.{p_end}
3230

3331
{p 32 32 2}{opt mapifprov} is equivalent to {opt mapif( <province, not territory> )} but additionally adjusts the legend placement.{p_end}
3432

35-
{synopt :{opt legendoffset(#)}}manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.{p_end}
33+
{synoptset 22 tabbed}{...}
34+
{synopt:{opt legendoffset(#)}}manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.{p_end}
3635

3736

3837
{marker author}{...}
3938
{title:Author}
4039

41-
{pstd}Michael Stepner{p_end}
42-
{pstd}stepner@mit.edu{p_end}
40+
{pstd}Michael Stepner{break} stepner@mit.edu{p_end}

map_shapefiles/can_prov_maptile.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
**maptile {hline 2} Geography: can_prov**
2+
3+
# Description
4+
5+
**can_prov** generates a map of Canadian provinces and territories.
6+
7+
This template uses the boundaries from the 2011 Census.
8+
9+
# Geographic ID variables
10+
11+
Table: col1width=16
12+
13+
---------------- -----------------------------
14+
**prov** 2-letter postal abbreviations
15+
**provcode** 2-digit SGC codes (Standard Geographical Classification)
16+
**provcode_old** older Statistics Canada province codes: 0-9 for provinces, 10-12 for territories
17+
**provname** full province names, in English
18+
---------------- -----------------------------
19+
20+
# Geography-Specific Options
21+
22+
Table: col1width=22
23+
24+
--------------------- -----------------------------
25+
{opth geoid(varname)} specifies the geographic ID variable to use; default is **geoid(prov)**
26+
--------------------- -----------------------------
27+
28+
Table: col1width=22
29+
30+
--------------------- -----------------------------
31+
**mapifprov** excludes the territories from the map, only mapping the 10 provinces
32+
--------------------- -----------------------------
33+
34+
{p 32 32 2}This does not exclude the territories' data from the calculation of the quantiles (equal-sized color bins). To avoid counting the territories in the quantiles, add an **if** statement to your maptile command that excludes them.
35+
36+
{p 32 32 2}{opt mapifprov} is equivalent to {opt mapif( \<province, not territory\> )} but additionally adjusts the legend placement.
37+
38+
Table: col1width=22
39+
40+
--------------------- -----------------------------
41+
{opt legendoffset(#)} manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.
42+
--------------------- -----------------------------
43+
44+
# Author
45+
46+
Michael Stepner{break}
47+
stepner@mit.edu
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
11
{smcl}
22

3-
{pstd}
4-
{hi:maptile {hline 2} Geography: can_prov}
3+
{pstd}{bf:maptile {hline 2} Geography: can_prov}{p_end}
54

65

76
{marker description}{...}
87
{title:Description}
98

10-
{pstd}
11-
{hi:can_prov} generates a map of Canadian provinces and territories.
9+
{pstd}{bf:can_prov} generates a map of Canadian provinces and territories.{p_end}
1210

13-
{pstd}This template uses the boundaries from the 2011 Census.
11+
{pstd}This template uses the boundaries from the 2011 Census.{p_end}
1412

1513

16-
{marker idvar}{...}
14+
{marker geographic-id-variables}{...}
1715
{title:Geographic ID variables}
1816

19-
{synoptset 15 tabbed}{...}
20-
{synopt :{hi:prov}} 2-letter postal abbreviations{p_end}
21-
{synopt :{hi:provcode}} 2-digit SGC codes (Standard Geographical Classification){p_end}
22-
{synopt :{hi:provcode_old}} older Statistics Canada province codes: 0-9 for provinces, 10-12 for territories{p_end}
23-
{synopt :{hi:provname}} full province names, in English{p_end}
17+
{synoptset 16 tabbed}{...}
18+
{synopt:{bf:prov}}2-letter postal abbreviations{p_end}
19+
{synopt:{bf:provcode}}2-digit SGC codes (Standard Geographical Classification){p_end}
20+
{synopt:{bf:provcode_old}}older Statistics Canada province codes: 0-9 for provinces, 10-12 for territories{p_end}
21+
{synopt:{bf:provname}}full province names, in English{p_end}
2422

2523

26-
{marker geooptions}{...}
24+
{marker geography-specific-options}{...}
2725
{title:Geography-Specific Options}
2826

2927
{synoptset 22 tabbed}{...}
30-
{synopt :{opth geoid(varname)}}specifies the geographic ID variable to use; default is {hi:geoid(prov)}{p_end}
28+
{synopt:{opth geoid(varname)}}specifies the geographic ID variable to use; default is {bf:geoid(prov)}{p_end}
3129

32-
{synopt :{opt mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}
30+
{synoptset 22 tabbed}{...}
31+
{synopt:{bf:mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}
3332

3433
{p 32 32 2}This does not exclude the territories' data from the calculation of the quantiles (equal-sized color bins). To avoid counting the territories in the quantiles, add an {bf:if} statement to your maptile command that excludes them.{p_end}
3534

3635
{p 32 32 2}{opt mapifprov} is equivalent to {opt mapif( <province, not territory> )} but additionally adjusts the legend placement.{p_end}
3736

38-
{synopt :{opt legendoffset(#)}}manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.{p_end}
37+
{synoptset 22 tabbed}{...}
38+
{synopt:{opt legendoffset(#)}}manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.{p_end}
3939

4040

4141
{marker author}{...}
4242
{title:Author}
4343

44-
{pstd}Michael Stepner{p_end}
45-
{pstd}stepner@mit.edu{p_end}
44+
{pstd}Michael Stepner{break} stepner@mit.edu{p_end}

map_shapefiles/county1990_maptile.ado

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
*! 6sep2014, Michael Stepner, stepner@mit.edu
1+
*! 22mar2015, Michael Stepner, stepner@mit.edu
22

33
program define _maptile_county1990
44
syntax , [ geofolder(string) ///
55
mergedatabase ///
66
map spmapvar(varname) var(varname) binvar(varname) clopt(string) legopt(string) min(string) clbreaks(string) max(string) mapcolors(string) ndfcolor(string) ///
77
savegraph(string) replace resolution(string) map_restriction(string) spopt(string) ///
88
/* Geography-specific options */ ///
9-
stateoutline(string) ///
9+
stateoutline(string) conus ///
1010
]
1111

1212
if ("`mergedatabase'"!="") {
@@ -16,9 +16,18 @@ program define _maptile_county1990
1616

1717
if ("`map'"!="") {
1818

19+
if ("`conus'"=="conus") {
20+
* Hide AK and HI from stateoutline
21+
local polygon_select select(drop if inlist(_ID,27,8))
22+
23+
* Hide AK and HI from main map
24+
if ("`map_restriction'"=="") local map_restriction if !inlist(floor(county/1000),2,15)
25+
else local map_restriction `map_restriction' & !inlist(floor(county/1000),2,15)
26+
}
27+
1928
if ("`stateoutline'"!="") {
2029
cap confirm file `"`geofolder'/state_coords_clean.dta"'
21-
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...))
30+
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...) `polygon_select')
2231
else if (_rc==601) {
2332
di as error `"stateoutline() requires the {it:state} geography to be installed"'
2433
di as error `"--> state_coords_clean.dta must be present in the geofolder"'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**maptile {hline 2} Geography: county1990**
2+
3+
# Description
4+
5+
**county1990** generates a map of United States counties using 1990 boundaries.
6+
7+
It displays Alaska and Hawaii rescaled and moved to the bottom left of the map, below the continental US, for ease of viewing.
8+
9+
# Geographic ID variable
10+
11+
**county** {hline 2} FIPS county codes
12+
13+
# Geography-Specific Options
14+
15+
Table: col1width=32
16+
17+
----------------------------------- -----------------------------
18+
{opth stateoutline(linewidthstyle)} overlays the map with a (potentially thicker) line on state boundaries
19+
**conus** hides Alaska and Hawaii, on the map **and** the state outline
20+
----------------------------------- -----------------------------
21+
22+
# Author
23+
24+
Michael Stepner{break}
25+
stepner@mit.edu
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
{smcl}
22

3-
{pstd}
4-
{hi:maptile {hline 2} Geography: county1990}
3+
{pstd}{bf:maptile {hline 2} Geography: county1990}{p_end}
54

65

76
{marker description}{...}
87
{title:Description}
98

10-
{pstd}
11-
{hi:county1990} generates a map of United States counties using 1990 boundaries.
9+
{pstd}{bf:county1990} generates a map of United States counties using 1990 boundaries.{p_end}
1210

13-
{pstd}It displays Alaska and Hawaii rescaled and moved to the bottom left of the map, below the continental US, for ease of viewing.
11+
{pstd}It displays Alaska and Hawaii rescaled and moved to the bottom left of the map, below the continental US, for ease of viewing.{p_end}
1412

1513

16-
{marker idvar}{...}
14+
{marker geographic-id-variable}{...}
1715
{title:Geographic ID variable}
1816

19-
{pstd}
20-
{hi:county} {hline 2} FIPS county codes
17+
{pstd}{bf:county} {hline 2} FIPS county codes{p_end}
2118

2219

23-
{marker geooptions}{...}
20+
{marker geography-specific-options}{...}
2421
{title:Geography-Specific Options}
2522

2623
{synoptset 32 tabbed}{...}
27-
{synopt :{opth stateoutline(linewidthstyle)}}overlays the map with a (potentially thicker) line on state boundaries{p_end}
24+
{synopt:{opth stateoutline(linewidthstyle)}}overlays the map with a (potentially thicker) line on state boundaries{p_end}
25+
{synopt:{bf:conus}}hides Alaska and Hawaii, on the map {bf:and} the state outline{p_end}
2826

2927

3028
{marker author}{...}
3129
{title:Author}
3230

33-
{pstd}Michael Stepner{p_end}
34-
{pstd}stepner@mit.edu{p_end}
31+
{pstd}Michael Stepner{break} stepner@mit.edu{p_end}

map_shapefiles/cz_maptile.ado

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
*! 6sep2014, Michael Stepner, stepner@mit.edu
1+
*! 22mar2015, Michael Stepner, stepner@mit.edu
22

33
program define _maptile_cz
44
syntax , [ geofolder(string) ///
55
mergedatabase ///
66
map spmapvar(varname) var(varname) binvar(varname) clopt(string) legopt(string) min(string) clbreaks(string) max(string) mapcolors(string) ndfcolor(string) ///
77
savegraph(string) replace resolution(string) map_restriction(string) spopt(string) ///
88
/* Geography-specific options */ ///
9-
stateoutline(string) ///
9+
stateoutline(string) conus ///
1010
]
1111

1212
if ("`mergedatabase'"!="") {
@@ -16,9 +16,18 @@ program define _maptile_cz
1616

1717
if ("`map'"!="") {
1818

19+
if ("`conus'"=="conus") {
20+
* Hide AK and HI from stateoutline
21+
local polygon_select select(drop if inlist(_ID,27,8))
22+
23+
* Hide AK and HI from main map
24+
if ("`map_restriction'"=="") local map_restriction if !inlist(floor(cz/100),341,347,356)
25+
else local map_restriction `map_restriction' & !inlist(floor(cz/100),341,347,356)
26+
}
27+
1928
if ("`stateoutline'"!="") {
2029
cap confirm file `"`geofolder'/state_coords_clean.dta"'
21-
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...))
30+
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...) `polygon_select')
2231
else if (_rc==601) {
2332
di as error `"stateoutline() requires the {it:state} geography to be installed"'
2433
di as error `"--> state_coords_clean.dta must be present in the geofolder"'

map_shapefiles/cz_maptile.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
**maptile {hline 2} Geography: cz**
2+
3+
# Description
4+
5+
**cz** generates a map of United States 1990 Commuting Zones.
6+
7+
It displays Alaska and Hawaii rescaled and moved to the bottom left of the map, below the continental US, for ease of viewing.
8+
9+
# Geographic ID variable
10+
11+
**cz** {hline 2} 1990 Commuting Zone codes
12+
13+
# Geography-Specific Options
14+
15+
Table: col1width=32
16+
17+
----------------------------------- -----------------------------
18+
{opth stateoutline(linewidthstyle)} overlays the map with a (potentially thicker) line on state boundaries
19+
**conus** hides Alaska and Hawaii, on the map **and** the state outline
20+
----------------------------------- -----------------------------
21+
22+
23+
# Author
24+
25+
Michael Stepner{break}
26+
stepner@mit.edu

0 commit comments

Comments
 (0)