pdil / usmap

🗺 Create US maps including Alaska and Hawaii in R
https://usmap.dev/
GNU General Public License v3.0
74 stars 16 forks source link

Documentation request: add these projection details to Intro/Vignette PDF #13

Closed ricobert1 closed 5 years ago

ricobert1 commented 5 years ago

https://github.com/pdil/usmap/blob/b3d285ecfdfd526157d922877ea075770f6f7a43/data-raw/maps/create-map-df.R#L32

This is an important piece of projection info that will let others use other dataframes, for instance, having unprojected geographic data (i.e., lat/long coordinates) transform to the right spatial projection. I would include this in the intro/vignette part where you describe which projection is used (i.e., page 17 of https://cran.r-project.org/web/packages/usmap/usmap.pdf).

pdil commented 5 years ago

@ricobert1 That's a good idea, I'll add it in for the next update.

pdil commented 5 years ago

@ricobert1 do you think there would be any value in also providing a function that allows the user to easily transform any shapefile using that transform?

I'm thinking of something like this:

shapefile <- readOGR("...")
transformed_shapefile <- usmap_transform(shapefile)

Where the usmap_transform function (open to name suggestions) would apply the transform that was used on the original map and maybe account for possible differences in shapefiles that are used as input.

pdil commented 5 years ago

@ricobert1 I've added a new vignette called "Advanced Mapping" which includes the projection details. There's also a new function usmap_crs() which provides the projection as a coordinate reference system (CRS) object used by the sp package. It will be in the next CRAN release, thanks for your suggestion.

pdil commented 5 years ago

@ricobert1 usmap 0.5.0 is now publicly available on CRAN which includes the aforementioned changes, thanks for your input!