Added a new set of country code conversion functions whose names match those for state and county conversions:
countryCodeToName()countryCodeToFIPS()countryFIPSToName()countryCodeToCode()countryNameToCode()countryNameToFIPS()
These are now preferred over the older codeToCountry() and countryToCode()
functions which, while deprecated, are still supported for backwards compatibility.
- Addressed CRAN package documentation issue.
- Package-internal datasets can be loaded by
getCountryCode()andgetTimezone()without invokinglibrary MazamaSpatialUtils.
- Tweaks to satisfy CRAN submission checks.
- Added dependency on sf.
This addresses the following error seen when using internal data in a dplyr context:
> IS <- SimpleCountriesEEZ %>% dplyr::filter(countryCode == "IS")
Error in `vec_size()`:
! `x` must be a vector, not a <sfc_MULTIPOLYGON/sfc> object.
This error is explained here:
https://www.mm218.dev/posts/2022-12-01-sf-in-packages/ and the simplest
solution for this spatially-oriented package is to simply move sf from an
import to a dependency (by moving it to the "Depends:" section of DESCRIPTION).
- Added handling of "Sparse geometry binary predicate list of length 1" error in
getSpatialData()by simply choosing the first polygon returned. - Added
convertWBDHUC()and pre-generated spatial data files:WBDHU2,WBDHU4,WBDHU6,WBDHU8andWBDHU10. - Added
getHUC()andgetHUCName().
Added the following datasets to the archive at: http://data.mazamascience.com/MazamaSpatialUtils/Spatial_0.8/
WBDHU2(and simplified versions)WBDHU4(and simplified versions)WBDHU6(and simplified versions)WBDHU8WBDHU10
- Documentation fixes associated with change from sp to sf.
- Tweaks to satisfy CRAN submission checks.
Version 0.8.x is a complete refactoring of MazamaSpatialUtils to upgrade from dependence on the sp package to use of the sf package. As much as possible, the suite of functions and arguments will remain the same.
The following changes have been made:
- The
datasetparameter has been renamed todatasetNamein all functions where a name is expected rather than a sf dataframe object. This should have no effect on existing code which should "fuzzy match"dataset => datasetName.
- Removed links to slow-to-respond http://www.naturalearthdata.com/ to pass CRAN submission tests.
- Updated out-of-date URLs.
- Updated
ebolamap.Rmdvignette to pass R CMD check.
- Minor documentation improvements.
- Removed unused dependency on tidyr.
- Replaced non-ASCII characters to satisfy CRAN checks.
- Consistent parameter validation in all
get~()functions.
- URL corrections for CRAN submission.
- Vignette wordsmithing.
- Test updates.
- URL corrections after testing with win-builder.
- Reordered parameters in
installSpatialData()so thatdatasetcomes first. installSpatialData()attempts to install simplified versions of datasets: "_05", "_02" and "_01".- Replacement of
lonandlatingetHUC()andgetHUCName(). subsetHUC()now handlesNAvalues inSFDF$allStateCodes.- Congressional districts dataset name now includes session number:
USCensus116thCongress.
Version 0.7 includes more datasets that have all been through identical processing and harmonization steps. In general, this release represents a clean-and-update revision that brings all aspects of the package up to modern standards.
Improvements include:
- Fewer package dependencies.
- Minor updates to vignettes and articles.
- Consistent replacement of
lonandlat withlongitudeandlatitude` in all functions.
- Updated
convertWikipediaTimezeonTable(). - Updated
convertWorldTimezones()and package internal datasetSimpleTimezones. - Updated
convertGADM()to support GADM version 3.6. - Updated
convertEEZCountries()andSimpleCountriesEEZdataset. - Updated
SimpleCountriesdataset
- Added
US_countyCodesdataset withstateCode,stateFIPS,countyName,countyFIPS.
New functions for converting between US county names/FIPS:
US_countyNameToFIPS()US_countyFIPSToName()
- Fixed a bug in
loadSpatialData()that was returning dataset names with".rda".
- Updated
convertWorldEEZ.R. - Updated
convertHMSSmoke.R. - Updated
convertStateLegislativeDistricts.R. - Updated
convertTMWorldBordersSimple.R. - Updated
convertTMWorldBorders.R. - Updated
convertSimpleCountries.R. - Updated
convertGACC.R. - Updated
convertNWSFireZones.R.
- Updated
convertMTBSBurnArea.R. - Updated
convertNaturalEarthAdm1.R.
- Removed non-working
app/directory and dependency on shiny. - Corrected Bosnia country code in
convertWikipediaTimezoneTable.R. - Updated
convertEPARegions.R. - Updated
convertOSMTimeZones.R. - Updated
convertTerrestrialEcoregions.R. - Updated
convertWeatherZones.R.
- Updated
convertGACC.Rto use 2020 data. - Removed outlying territories from
US_stateCodes. - Updated
convertUSCensusStates.Rto use 2019 data. - Updated
convertCARBAirBains.Rto latest coding style. - Updated
convertUSCensusCBSA.Rto latest coding style. - Updated
convertIndianLands.Rto latest coding style. - Now using the cleangeo package to fix topology errors and geometry validity issues.
New functions for converting among US state names/codes/FIPS:
US_stateCodeToName()US_stateCodeToFIPS()US_stateFIPSToCode()US_stateFIPSToName()US_stateNameToCode()US_stateNameToFIPS()
- Changed
US_stateCodesdataset to include onlystateName,stateCodeandstateFIPScolumns. It is now more complete with codes for all states and territories. convertLayer()now properly passes encoding torgdal::readOGR().- Updated
convertUSCensusCounties()to use 2019 data.
- New "Developer Style Guide" article.
- New "Basic GIS in R" article.
loadSpatialData()now recognizes both.RDataand.rdafiles.- Improved documentation
- New convert functions:
convertEPARegions()convertMTBSBurnArea()convertUSCensusUrbanAreas()convertUSFSRangerDistricts()
- New
convertHILFDFederalLands()function. - Added tidyr package to Imports.
- Updated docker image.
- Modified test infrastructure to address CRAN issues.
- Added
useBufferingargument togetUSCounties(). - Addressed bug in
loadSpatialData()which errored out when a directory existed with the same name as the dataset trying to be loaded. - Updated
summarizeByPolygon()to modern dplyr syntax. - Added
%>%operator. - Code style refactoring.
- made
simplify()function exampledonotrunso as to avoid a CRAN testing failure on fedora only -- Ugh.
- changes associated with minor version bump
- refactored shiny app from localShiny and added it to package in inst
- added
runExample()to run shiny examples - updated
README.md
- New convert function for public health districts
- New convert function for GACCs
- more testing
- New convert functions for weather zones
- Argument consistency with
getHUC() - added
dissolve()wrapper forrmapshaper::ms_dissolve()
- documentation with pkgdown
- various cleanup: spell check, reformatted NEWS.md, etc.
- added
simplify()wrapper forrmapshaper::ms_simplify()
- added
CONUSandUS_52vectors of US state codes as package data - added
US_stateCodesdataframe as package data
- added
convertStateLegislativeDistricts()function to download and convert US state level legislative districts on demand - now using countrycode package for all code/name conversions
ebolamap.Rmdconverted to vignette, moved tovignettes/andlocalNotebooks/deleted- usages of
cat()replaced withmessage(),warning(), orerror()
- corrected GADM URL in documentation for
convertGADM()
- added
convertUSCensusCBSA()to convert Metropolitan-/Micropolitan Statistical Areas - removed
verboseargument fromgetStateCode()function signature
- fixed use of
allStateCodesinWBD~datasets - converted
USIndianLands@datadata fromfactortocharacter - updated
docker/Dockerfile - added
ebolaMapvignette
- tweaks to satisfy CRAN
- package now
Dependson sp package so that sp plotting is used by default - package includes higher resolution
SimpleCountriesandSimpleTimezonesdatasets - internal standard now requires unique
polygonIDcolumn for every dataset organizePolygons()now uniformly usespolygonIDfor rownames andpolygons@IDso you can say:plot(SimpleCountries['IT',])- fixed bug in processing of
USCensusCountiesdataset - changed
codeToCode()to two functions:iso2ToIso3()andiso3ToIso2() - package now includes SimpleCountriesEEZ dataset which is used as the default
dataset for
getCountry().SimpleCountriesEEZincludes a 200-mile offshore buffer for more efficient and accurate spatial searches - new datasets include:
TerrestrialEcoregions,USCensus115thCongress,USCensusStates,USCensusIndianLands
- new .tar.gz file available containing spatial datasets
- new
installSpatialData()installs all required datasets loadSpatialData()no loads one or more datasets based on a pattern- removed
initializeSpatialData() convertGADM()updated to GADM version 2.8 (handles .rds files)- updated
localVignettes/ebolaMap.Rmd - new docker/ directory for building docker images to run MazamaSpatialUtils
- new app/ directory demonstrates dockerized web-service based on MazamaSpatialUtils
- locations that do not intersect any polygon now return
NArather than generating warnings - various minor bug fixes.
convertHMSSmoke()now handles shapefiles with newDensityinformation
- Fixed bug/typo in
findTimezonesdemo. - Fixed bugs/typos in
convertWBDHUC()andconvertHMSSmoke().
- New
convertHMSSmoke()function for smoke data from the NOAA Hazard Mapping Service. - Shapefiles with no projection information are assigned
"+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs". - Added dependency on lubridate package.
- Added
encodingargument toconverLayer(). - Modified
convertUSCensusCounties()to useencoding='latin1'.
- Added
useBufferingargument togetState(),getCountry()andgetTimezone().
getSpatialData()no longer fails on invalid/missing locations, now returns dataframe rows with all NA.
- Updated included datasets to use
"+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs". - Addition of buffered search so that locations can find nearby polygons.
- Addition of
convertWorldEEZ()function.
- Updated default projection from
"+proj=longlat"to"+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs"to support libproj >= 4.9.1
- Removed unneeded test that failed with sp version 1.1-0.
- User specification of
SpatialDataDiris now required. - Minor documentation improvements.
- Convert functions for GADM administrative boundaries and and USGS watershed datasets.
- Addition of code-name, name-code and code-code conversion utilities.
- Addition of
organizePolygons()function.