diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 199005b..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/DESCRIPTION b/DESCRIPTION index cbab8a2..758c5e8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,4 +26,4 @@ Imports: rgdal, maptools Encoding: UTF-8 -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.2 diff --git a/R/points_elided.R b/R/points_elided.R index 5486b8e..1dc305e 100644 --- a/R/points_elided.R +++ b/R/points_elided.R @@ -20,6 +20,7 @@ points_elided <- function(sp) { } orig_proj <- sp::proj4string(sp) + # convert it to Albers equal area sp <- sp::spTransform(sp, sp::CRS("+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs")) @@ -31,15 +32,14 @@ points_elided <- function(sp) { # from the original points ak_l <- sp::over(sp, ak_poly) ak <- sp[!is.na(ak_l),] - - # sp <- sp[is.na(ak_l),] + sp <- sp[is.na(ak_l),] if (length(ak)) { # Elide the points, the key here is to set "bb" to what the original # transformation's bounding box was! ak <- maptools::elide( ak, - scale=max(apply(ak_bb, 1, diff)) / 2.3, + scale = max(apply(ak_bb, 1, diff)) / 2.3, rotate = -50, bb = ak_bb ) # NEED the bb option here @@ -48,7 +48,7 @@ points_elided <- function(sp) { } hi_bb <- readRDS(system.file("extdata/hawaii_bb.rda", package="albersusa")) - #hi_bb <- readRDS("inst/extdata/hawaii_bb.rda") + # hi_bb <- readRDS("inst/extdata/hawaii_bb.rda") # hi_bb <- matrix(c(-160.2471, 18.9117, -154.8066, 22.2356), 2, 2) # rownames(hi_bb) <- c("x", "y") # colnames(hi_bb) <- c("min", "max") @@ -58,10 +58,13 @@ points_elided <- function(sp) { sp::proj4string(hi_poly) <- "+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs" # Determine which points fall in the Alaska bounding box, subset and remove - # from the original points + # from the original points hi_l <- sp::over(sp, hi_poly) hi <- sp[!is.na(hi_l),] +# <<<<<<< HEAD sp <- sp[is.na(hi_l),] +# ======= +# >>>>>>> 6dabfc9dcf6d3c2dcbdb743622d692e600e82443 if (length(hi)) { hi <- maptools::elide( @@ -75,7 +78,11 @@ points_elided <- function(sp) { # Bring them back together with original projection if (length(ak) && length(hi)) { +# <<<<<<< HEAD sp <- rbind(sp, ak, hi) +# ======= +# sp <- rbind(ak, hi) +# >>>>>>> 6dabfc9dcf6d3c2dcbdb743622d692e600e82443 } else if (length(ak)) { sp <- ak } else if (length(hi)) { diff --git a/inst/.DS_Store b/inst/.DS_Store deleted file mode 100644 index 2bddfa1..0000000 Binary files a/inst/.DS_Store and /dev/null differ diff --git a/inst/extdata/.DS_Store b/inst/extdata/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/inst/extdata/.DS_Store and /dev/null differ diff --git a/man/albersusa.Rd b/man/albersusa.Rd index 1156e6b..504be02 100644 --- a/man/albersusa.Rd +++ b/man/albersusa.Rd @@ -3,7 +3,6 @@ \docType{package} \name{albersusa} \alias{albersusa} -\alias{albersusa-package} \title{Tools, Shapefiles & Data to Work with an 'AlbersUSA' Composite Projection} \description{ Creating a composite projection for states and counties of the United States diff --git a/man/us_aeqd_proj.Rd b/man/us_aeqd_proj.Rd index 61d3cc8..4330a58 100644 --- a/man/us_aeqd_proj.Rd +++ b/man/us_aeqd_proj.Rd @@ -24,8 +24,10 @@ us <- usa_composite(proj="aeqd") counties <- counties_composite("aeqd") } \seealso{ -Other convenience projections: \code{\link{us_eqdc_proj}}, - \code{\link{us_laea_proj}}, \code{\link{us_lcc_proj}} +Other convenience projections: +\code{\link{us_eqdc_proj}}, +\code{\link{us_laea_proj}}, +\code{\link{us_lcc_proj}} } \concept{convenience projections} \keyword{datasets} diff --git a/man/us_eqdc_proj.Rd b/man/us_eqdc_proj.Rd index 4f9f703..e7fa65a 100644 --- a/man/us_eqdc_proj.Rd +++ b/man/us_eqdc_proj.Rd @@ -25,8 +25,10 @@ counties <- counties_composite("eqdc") } \seealso{ -Other convenience projections: \code{\link{us_aeqd_proj}}, - \code{\link{us_laea_proj}}, \code{\link{us_lcc_proj}} +Other convenience projections: +\code{\link{us_aeqd_proj}}, +\code{\link{us_laea_proj}}, +\code{\link{us_lcc_proj}} } \concept{convenience projections} \keyword{datasets} diff --git a/man/us_laea_proj.Rd b/man/us_laea_proj.Rd index 8791520..629e563 100644 --- a/man/us_laea_proj.Rd +++ b/man/us_laea_proj.Rd @@ -22,8 +22,10 @@ us <- usa_composite(proj="laea") counties <- counties_composite("laea") } \seealso{ -Other convenience projections: \code{\link{us_aeqd_proj}}, - \code{\link{us_eqdc_proj}}, \code{\link{us_lcc_proj}} +Other convenience projections: +\code{\link{us_aeqd_proj}}, +\code{\link{us_eqdc_proj}}, +\code{\link{us_lcc_proj}} } \concept{convenience projections} \keyword{datasets} diff --git a/man/us_lcc_proj.Rd b/man/us_lcc_proj.Rd index c141d0f..31f645d 100644 --- a/man/us_lcc_proj.Rd +++ b/man/us_lcc_proj.Rd @@ -22,8 +22,10 @@ us <- usa_composite(proj="lcc") counties <- counties_composite("lcc") } \seealso{ -Other convenience projections: \code{\link{us_aeqd_proj}}, - \code{\link{us_eqdc_proj}}, \code{\link{us_laea_proj}} +Other convenience projections: +\code{\link{us_aeqd_proj}}, +\code{\link{us_eqdc_proj}}, +\code{\link{us_laea_proj}} } \concept{convenience projections} \keyword{datasets}