Geographical projections of a mainland USA map


library(sf)
Linking to GEOS 3.7.1, GDAL 2.4.0, PROJ 5.2.0


load("US_flat.RData")
US_flat
   geometry                       State
1  MULTIPOLYGON (((-87.46201 3... Alabama
2  MULTIPOLYGON (((-114.6374 3... Arizona
3  MULTIPOLYGON (((-94.05103 3... Arkansas
4  MULTIPOLYGON (((-120.006 42... California
5  MULTIPOLYGON (((-102.0552 4... Colorado
6  MULTIPOLYGON (((-73.49902 4... Connecticut
7  MULTIPOLYGON (((-75.80231 3... Delaware
8  MULTIPOLYGON (((-77.13731 3... District of Columbia
9  MULTIPOLYGON (((-85.01548 3... Florida
10 MULTIPOLYGON (((-80.89018 3... Georgia
11 MULTIPOLYGON (((-117.0266 4... Idaho
12 MULTIPOLYGON (((-90.64192 4... Illinois
13 MULTIPOLYGON (((-88.02351 3... Indiana
14 MULTIPOLYGON (((-91.22634 4... Iowa
15 MULTIPOLYGON (((-94.63544 3... Kansas
16 MULTIPOLYGON (((-82.56895 3... Kentucky
17 MULTIPOLYGON (((-94.05103 3... Louisiana
18 MULTIPOLYGON (((-70.73737 4... Maine
19 MULTIPOLYGON (((-77.716 39.... Maryland
20 MULTIPOLYGON (((-70.45089 4... Massachusetts
21 MULTIPOLYGON (((-90.41273 4... Michigan
22 MULTIPOLYGON (((-96.42879 4... Minnesota
23 MULTIPOLYGON (((-88.18966 3... Mississippi
24 MULTIPOLYGON (((-95.75271 4... Missouri
25 MULTIPOLYGON (((-104.0491 4... Montana
26 MULTIPOLYGON (((-104.0606 4... Nebraska
27 MULTIPOLYGON (((-114.0415 3... Nevada
28 MULTIPOLYGON (((-72.47343 4... New Hampshire
29 MULTIPOLYGON (((-74.72516 4... New Jersey
30 MULTIPOLYGON (((-103.0063 3... New Mexico
31 MULTIPOLYGON (((-73.92874 4... New York
32 MULTIPOLYGON (((-75.89399 3... North Carolina
33 MULTIPOLYGON (((-104.0491 4... North Dakota
34 MULTIPOLYGON (((-80.51776 4... Ohio
35 MULTIPOLYGON (((-102.0495 3... Oklahoma
36 MULTIPOLYGON (((-116.9292 4... Oregon
37 MULTIPOLYGON (((-79.76718 4... Pennsylvania
38 MULTIPOLYGON (((-71.84318 4... Rhode Island
39 MULTIPOLYGON (((-83.10753 3... South Carolina
40 MULTIPOLYGON (((-96.43452 4... South Dakota
41 MULTIPOLYGON (((-89.71946 3... Tennessee
42 MULTIPOLYGON (((-94.49792 3... Texas
43 MULTIPOLYGON (((-114.0472 4... Utah
44 MULTIPOLYGON (((-73.36152 4... Vermont
45 MULTIPOLYGON (((-75.64188 3... Virginia
46 MULTIPOLYGON (((-123.0198 4... Washington
47 MULTIPOLYGON (((-79.49789 3... West Virginia
48 MULTIPOLYGON (((-87.80006 4... Wisconsin
49 MULTIPOLYGON (((-109.0511 4... Wyoming

plot(st_geometry(US_flat),
     graticule=TRUE,axes=TRUE)
/book/data-management-r/08-spatial-geographical-data/cartographic-projections/book_data-management-r_08-spatial-geographical-data_cartographic-projections_3_0.png

bbox_US <- st_bbox(US_flat)

c(xcenter = mean(bbox_US[c("xmin","xmax")]),
  ycenter = mean(bbox_US[c("ymin","ymax")]))
  xcenter   ycenter
-95.84438  37.25658

laea <- st_crs("+proj=laea +lon_0=-95.8 +lat_0=37.3")
US_proj <- st_transform(US_flat,laea)
plot(st_geometry(US_proj),
     graticule=TRUE,axes=TRUE)
/book/data-management-r/08-spatial-geographical-data/cartographic-projections/book_data-management-r_08-spatial-geographical-data_cartographic-projections_6_0.png

Downloadable R script and interactive version

Explanation

The link with the “jupyterhub” icon directs you to an interactive Jupyter1 notebook, which runs inside a Docker container2. There are two variants of the interative notebook. One shuts down after 60 seconds and does not require a sign it. The other requires sign in using your ORCID3 credentials, yet shuts down only after 24 hours. (There is no guarantee that such a container persists that long, it may be shut down earlier for maintenance purposes.) After shutdown all data within the container will be reset, i.e. all files created by the user will be deleted.4

Above you see a rendered version of the Jupyter notebook.5

1

For more information about Jupyter see http://jupyter.org. The Jupyter notebooks make use of the IRKernel package.

2

For more information about Docker see https://docs.docker.com/. The container images were created with repo2docker, while containers are run with docker spawner.

3

ORCID is a free service for the authentication of researchers. It also allows to showcase publications and contributions to the academic community such as peer review.. See https://info.orcid.org/what-is-orcid/ for more information.

4

The Jupyter notebooks come with NO WARRANTY whatsoever. They are provided for educational and illustrative purposes only. Do not use them for production work.

5

The notebook is rendered with the help of the nbsphinx extension.