Skip to content

Commit

Permalink
Merge branch 'release/v1.00'
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Stepner committed Mar 24, 2015
2 parents 69a4334 + 4acbbea commit cc4f8af
Show file tree
Hide file tree
Showing 27 changed files with 487 additions and 170 deletions.
40 changes: 40 additions & 0 deletions map_shapefiles/can_er_maptile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
**maptile {hline 2} Geography: can_er**

# Description

**can_er** generates a map of Canadian economic regions.

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)

This template uses the boundaries from the 2011 Census.

# Geographic ID variables

Table: col1width=16

---------------- -----------------------------
**er** 4-digit economic region codes
---------------- -----------------------------

# Geography-Specific Options

Table: col1width=22

--------------------- -----------------------------
**mapifprov** excludes the territories from the map, only mapping the 10 provinces
--------------------- -----------------------------

{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.

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

Table: col1width=22

--------------------- -----------------------------
{opt legendoffset(#)} manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.
--------------------- -----------------------------

# Author

Michael Stepner{break}
stepner@mit.edu
26 changes: 12 additions & 14 deletions map_shapefiles/can_er_maptile.smcl
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
{smcl}

{pstd}
{hi:maptile {hline 2} Geography: can_er}
{pstd}{bf:maptile {hline 2} Geography: can_er}{p_end}


{marker description}{...}
{title:Description}

{pstd}
{hi:can_er} generates a map of Canadian economic regions.
{pstd}{bf:can_er} generates a map of Canadian economic regions.{p_end}

{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]}
{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}

{pstd}This template uses the boundaries from the 2011 Census.
{pstd}This template uses the boundaries from the 2011 Census.{p_end}


{marker idvar}{...}
{marker geographic-id-variables}{...}
{title:Geographic ID variables}

{synoptset 15 tabbed}{...}
{synopt :{hi:er}} 4-digit economic region codes{p_end}
{synoptset 16 tabbed}{...}
{synopt:{bf:er}}4-digit economic region codes{p_end}


{marker geooptions}{...}
{marker geography-specific-options}{...}
{title:Geography-Specific Options}

{synoptset 22 tabbed}{...}
{synopt :{opt mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}
{synopt:{bf:mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}

{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}

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

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


{marker author}{...}
{title:Author}

{pstd}Michael Stepner{p_end}
{pstd}stepner@mit.edu{p_end}
{pstd}Michael Stepner{break} stepner@mit.edu{p_end}
47 changes: 47 additions & 0 deletions map_shapefiles/can_prov_maptile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
**maptile {hline 2} Geography: can_prov**

# Description

**can_prov** generates a map of Canadian provinces and territories.

This template uses the boundaries from the 2011 Census.

# Geographic ID variables

Table: col1width=16

---------------- -----------------------------
**prov** 2-letter postal abbreviations
**provcode** 2-digit SGC codes (Standard Geographical Classification)
**provcode_old** older Statistics Canada province codes: 0-9 for provinces, 10-12 for territories
**provname** full province names, in English
---------------- -----------------------------

# Geography-Specific Options

Table: col1width=22

--------------------- -----------------------------
{opth geoid(varname)} specifies the geographic ID variable to use; default is **geoid(prov)**
--------------------- -----------------------------

Table: col1width=22

--------------------- -----------------------------
**mapifprov** excludes the territories from the map, only mapping the 10 provinces
--------------------- -----------------------------

{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.

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

Table: col1width=22

--------------------- -----------------------------
{opt legendoffset(#)} manually shifts the legend downward. # must be non-negative. When not specified, the legend offset is computed automatically.
--------------------- -----------------------------

# Author

Michael Stepner{break}
stepner@mit.edu
33 changes: 16 additions & 17 deletions map_shapefiles/can_prov_maptile.smcl
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
{smcl}

{pstd}
{hi:maptile {hline 2} Geography: can_prov}
{pstd}{bf:maptile {hline 2} Geography: can_prov}{p_end}


{marker description}{...}
{title:Description}

{pstd}
{hi:can_prov} generates a map of Canadian provinces and territories.
{pstd}{bf:can_prov} generates a map of Canadian provinces and territories.{p_end}

{pstd}This template uses the boundaries from the 2011 Census.
{pstd}This template uses the boundaries from the 2011 Census.{p_end}


{marker idvar}{...}
{marker geographic-id-variables}{...}
{title:Geographic ID variables}

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


{marker geooptions}{...}
{marker geography-specific-options}{...}
{title:Geography-Specific Options}

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

{synopt :{opt mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}
{synoptset 22 tabbed}{...}
{synopt:{bf:mapifprov}}excludes the territories from the map, only mapping the 10 provinces{p_end}

{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}

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

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


{marker author}{...}
{title:Author}

{pstd}Michael Stepner{p_end}
{pstd}stepner@mit.edu{p_end}
{pstd}Michael Stepner{break} stepner@mit.edu{p_end}
15 changes: 12 additions & 3 deletions map_shapefiles/county1990_maptile.ado
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*! 6sep2014, Michael Stepner, stepner@mit.edu
*! 22mar2015, Michael Stepner, stepner@mit.edu

program define _maptile_county1990
syntax , [ geofolder(string) ///
mergedatabase ///
map spmapvar(varname) var(varname) binvar(varname) clopt(string) legopt(string) min(string) clbreaks(string) max(string) mapcolors(string) ndfcolor(string) ///
savegraph(string) replace resolution(string) map_restriction(string) spopt(string) ///
/* Geography-specific options */ ///
stateoutline(string) ///
stateoutline(string) conus ///
]

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

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

if ("`conus'"=="conus") {
* Hide AK and HI from stateoutline
local polygon_select select(drop if inlist(_ID,27,8))

* Hide AK and HI from main map
if ("`map_restriction'"=="") local map_restriction if !inlist(floor(county/1000),2,15)
else local map_restriction `map_restriction' & !inlist(floor(county/1000),2,15)
}

if ("`stateoutline'"!="") {
cap confirm file `"`geofolder'/state_coords_clean.dta"'
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...))
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...) `polygon_select')
else if (_rc==601) {
di as error `"stateoutline() requires the {it:state} geography to be installed"'
di as error `"--> state_coords_clean.dta must be present in the geofolder"'
Expand Down
25 changes: 25 additions & 0 deletions map_shapefiles/county1990_maptile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**maptile {hline 2} Geography: county1990**

# Description

**county1990** generates a map of United States counties using 1990 boundaries.

It displays Alaska and Hawaii rescaled and moved to the bottom left of the map, below the continental US, for ease of viewing.

# Geographic ID variable

**county** {hline 2} FIPS county codes

# Geography-Specific Options

Table: col1width=32

----------------------------------- -----------------------------
{opth stateoutline(linewidthstyle)} overlays the map with a (potentially thicker) line on state boundaries
**conus** hides Alaska and Hawaii, on the map **and** the state outline
----------------------------------- -----------------------------

# Author

Michael Stepner{break}
stepner@mit.edu
21 changes: 9 additions & 12 deletions map_shapefiles/county1990_maptile.smcl
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
{smcl}

{pstd}
{hi:maptile {hline 2} Geography: county1990}
{pstd}{bf:maptile {hline 2} Geography: county1990}{p_end}


{marker description}{...}
{title:Description}

{pstd}
{hi:county1990} generates a map of United States counties using 1990 boundaries.
{pstd}{bf:county1990} generates a map of United States counties using 1990 boundaries.{p_end}

{pstd}It displays Alaska and Hawaii rescaled and moved to the bottom left of the map, below the continental US, for ease of viewing.
{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}


{marker idvar}{...}
{marker geographic-id-variable}{...}
{title:Geographic ID variable}

{pstd}
{hi:county} {hline 2} FIPS county codes
{pstd}{bf:county} {hline 2} FIPS county codes{p_end}


{marker geooptions}{...}
{marker geography-specific-options}{...}
{title:Geography-Specific Options}

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


{marker author}{...}
{title:Author}

{pstd}Michael Stepner{p_end}
{pstd}stepner@mit.edu{p_end}
{pstd}Michael Stepner{break} stepner@mit.edu{p_end}
15 changes: 12 additions & 3 deletions map_shapefiles/cz_maptile.ado
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*! 6sep2014, Michael Stepner, stepner@mit.edu
*! 22mar2015, Michael Stepner, stepner@mit.edu

program define _maptile_cz
syntax , [ geofolder(string) ///
mergedatabase ///
map spmapvar(varname) var(varname) binvar(varname) clopt(string) legopt(string) min(string) clbreaks(string) max(string) mapcolors(string) ndfcolor(string) ///
savegraph(string) replace resolution(string) map_restriction(string) spopt(string) ///
/* Geography-specific options */ ///
stateoutline(string) ///
stateoutline(string) conus ///
]

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

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

if ("`conus'"=="conus") {
* Hide AK and HI from stateoutline
local polygon_select select(drop if inlist(_ID,27,8))

* Hide AK and HI from main map
if ("`map_restriction'"=="") local map_restriction if !inlist(floor(cz/100),341,347,356)
else local map_restriction `map_restriction' & !inlist(floor(cz/100),341,347,356)
}

if ("`stateoutline'"!="") {
cap confirm file `"`geofolder'/state_coords_clean.dta"'
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...))
if (_rc==0) local polygon polygon(data(`"`geofolder'/state_coords_clean"') ocolor(black) osize(`stateoutline' ...) `polygon_select')
else if (_rc==601) {
di as error `"stateoutline() requires the {it:state} geography to be installed"'
di as error `"--> state_coords_clean.dta must be present in the geofolder"'
Expand Down
26 changes: 26 additions & 0 deletions map_shapefiles/cz_maptile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
**maptile {hline 2} Geography: cz**

# Description

**cz** generates a map of United States 1990 Commuting Zones.

It displays Alaska and Hawaii rescaled and moved to the bottom left of the map, below the continental US, for ease of viewing.

# Geographic ID variable

**cz** {hline 2} 1990 Commuting Zone codes

# Geography-Specific Options

Table: col1width=32

----------------------------------- -----------------------------
{opth stateoutline(linewidthstyle)} overlays the map with a (potentially thicker) line on state boundaries
**conus** hides Alaska and Hawaii, on the map **and** the state outline
----------------------------------- -----------------------------


# Author

Michael Stepner{break}
stepner@mit.edu

0 comments on commit cc4f8af

Please sign in to comment.