MazamaSpatialUtils: Spatial Data Download and Utility Functions

A suite of conversion scripts to create internally standardized spatial polygons dataframes. Utility scripts use these datasets to return values such as country, state, timezone, watershed, etc. associated with a set of longitude/latitude pairs. (They also make cool maps.)

Install the latest version of this package by entering the following in R:
AuthorJonathan Callahan [aut, cre], Ruby Fore [aut], Will Leahy [aut], Henry Nguyen [aut], Robin Winstanley [aut], Alice Yang [aut]
Date of publication2017-03-17 07:24:05 UTC
MaintainerJonathan Callahan <>

View on CRAN

Man pages

codeToCode: Convert Between ISO2 and ISO3 Country Codes

codeToCountry: Convert Country Codes to Country Names

codeToState: Convert State Codes to State Names

convertGADM: Convert and Regularize Data from the GADM Database

convertHMSSmoke: Convert NOAA Hazard Mapping System Smoke Shapefiles

convertLayer: Convert Shapefile Layer to Spatial Polygon Dataframe

convertNaturalEarthAdm1: Convert Level 1 (State) Borders Shapefile

convertTMWorldBorders: Convert World Borders Shapefile

convertTMWorldBordersSimple: Convert (Simple) World Borders Shapefile

convertUSCensusCounties: Convert US County Borders Shapefile

convertWBDHUC: Convert USGS Hydrologic Unit Shapefiles

convertWikipediaTimezoneTable: Convert Wikipedia Timezone Table to Dataframe

convertWorldEEZ: Convert World Exclusive Economic Zones Boundaries Shapefile

convertWorldTimezones: Create Timezone Dataset

countryToCode: Convert Country Names to Country Codes

getCountry: Return Country Names at Specified Locations

getCountryCode: Return Country ISO Codes at Specified Locations

getCountryName: Return Country Names at Specified Locations

getHUC: Return HUCs at Specified Locations

getHUCName: Return HUC Names at Specified Locations

getSpatialData: Return Spatial Data Associated with a Set of Locations

getSpatialDataDir: Get Package Data Directory

getState: Return State Names at Specified Locations

getStateCode: Return State ISO Codes at Specified Locations

getStateName: Return State Names at Specified Locations

getTimezone: Return Olson Timezones at Specified Locations

getUSCounty: Return US County Name at Specified Locations

getVariable: Return SpatialDataframe Variable at Specified Locations

installSpatialData: Install Spatial Datasets

loadSpatialData: Load Spatial Datasets

MazamaSpatialUtils: Mazama Science spatial data and utility functions.

organizePolygons: Organize Ungrouped Polygons

setSpatialDataDir: Set Package Data Directory

SimpleCountries: World Country Polygons

SimpleTimezones: World Timezone Polygons

SpatialDataDir: Directory for Spatial Data

stateToCode: Convert State Names to State Codes

subsetHUC: Subset pre-formatted HUC files into smaller groupings.


codeToCode Man page
codeToCountry Man page
codeToState Man page
convertGADM Man page
convertHMSSmoke Man page
convertLayer Man page
convertNaturalEarthAdm1 Man page
convertTMWorldBorders Man page
convertTMWorldBordersSimple Man page
convertUSCensusCounties Man page
convertWBDHUC Man page
convertWikipediaTimezoneTable Man page
convertWorldEEZ Man page
convertWorldTimezones Man page
countryToCode Man page
getCountry Man page
getCountryCode Man page
getCountryName Man page
getHUC Man page
getHUCName Man page
getSpatialData Man page
getSpatialDataDir Man page
getState Man page
getStateCode Man page
getStateName Man page
getTimezone Man page
getUSCounty Man page
getVariable Man page
installSpatialData Man page
loadSpatialData Man page
MazamaSpatialUtils Man page
MazamaSpatialUtils-package Man page
organizePolygons Man page
setSpatialDataDir Man page
SimpleCountries Man page
SimpleTimezones Man page
SpatialDataDir Man page
stateToCode Man page
subsetHUC Man page


demo/findCountries.R demo/findTimezones.R demo/findStates.R
R/subsetHUC.R R/convertTMWorldBordersSimple.R R/getStateCode.R R/convertNaturalEarthAdm1.R R/convertWorldTimezones.R R/loadSpatialData.R R/convertWBDHUC.R R/getCountry.R R/getState.R R/organizePolygons.R R/getVariable.R R/convertTMWorldBorders.R R/getCountryName.R R/getStateName.R R/convertGADM.R R/convertHMSSmoke.R R/getTimezone.R R/convertWikipediaTimezoneTable.R R/convertUSCensusCounties.R R/convertWorldEEZ.R R/convertLayer.R R/getSpatialData.R R/getCountryCode.R R/getUSCounty.R R/getHUC.R R/installSpatialData.R R/MazamaSpatialUtils.R R/getHUCName.R
man/convertWorldEEZ.Rd man/SimpleCountries.Rd man/subsetHUC.Rd man/convertTMWorldBorders.Rd man/getCountry.Rd man/getSpatialDataDir.Rd man/getStateName.Rd man/installSpatialData.Rd man/getHUC.Rd man/getCountryCode.Rd man/convertWBDHUC.Rd man/MazamaSpatialUtils.Rd man/getCountryName.Rd man/convertLayer.Rd man/convertWikipediaTimezoneTable.Rd man/loadSpatialData.Rd man/SpatialDataDir.Rd man/convertWorldTimezones.Rd man/codeToCode.Rd man/setSpatialDataDir.Rd man/SimpleTimezones.Rd man/convertNaturalEarthAdm1.Rd man/getTimezone.Rd man/countryToCode.Rd man/convertHMSSmoke.Rd man/codeToCountry.Rd man/codeToState.Rd man/getState.Rd man/getUSCounty.Rd man/convertUSCensusCounties.Rd man/getVariable.Rd man/organizePolygons.Rd man/getSpatialData.Rd man/getHUCName.Rd man/convertGADM.Rd man/convertTMWorldBordersSimple.Rd man/stateToCode.Rd man/getStateCode.Rd

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.