{"id":28393789,"url":"https://github.com/mazamascience/mazamaspatialutils","last_synced_at":"2025-07-03T21:39:54.713Z","repository":{"id":56934616,"uuid":"46367920","full_name":"MazamaScience/MazamaSpatialUtils","owner":"MazamaScience","description":"Harmonized spatial datasets and spatial search functions","archived":false,"fork":false,"pushed_at":"2024-11-01T21:33:52.000Z","size":56659,"stargazers_count":5,"open_issues_count":10,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-01T04:14:48.192Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mazamascience.github.io/MazamaSpatialUtils/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MazamaScience.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-17T18:47:55.000Z","updated_at":"2024-11-01T21:33:42.000Z","dependencies_parsed_at":"2024-11-01T21:22:36.992Z","dependency_job_id":"bebcc8b9-54a7-4fc2-89d8-932956fd339a","html_url":"https://github.com/MazamaScience/MazamaSpatialUtils","commit_stats":{"total_commits":446,"total_committers":18,"mean_commits":24.77777777777778,"dds":0.5695067264573991,"last_synced_commit":"2042f7dc7e0f70c14cdb23e2f819a76b6eb37952"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/MazamaScience/MazamaSpatialUtils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazamaScience%2FMazamaSpatialUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazamaScience%2FMazamaSpatialUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazamaScience%2FMazamaSpatialUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazamaScience%2FMazamaSpatialUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MazamaScience","download_url":"https://codeload.github.com/MazamaScience/MazamaSpatialUtils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazamaScience%2FMazamaSpatialUtils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262056232,"owners_count":23251631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-31T17:08:11.034Z","updated_at":"2025-06-26T11:32:36.948Z","avatar_url":"https://github.com/MazamaScience.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![CRAN\\_Status\\_Badge](https://www.r-pkg.org/badges/version/MazamaSpatialUtils)](https://cran.r-project.org/package=MazamaSpatialUtils)\n[![Downloads](https://cranlogs.r-pkg.org/badges/MazamaSpatialUtils)](https://cran.r-project.org/package=MazamaSpatialUtils)\n[![DOI](https://zenodo.org/badge/46367920.svg)](https://zenodo.org/badge/latestdoi/46367920)\n\nA dedicated Slack channel has been created for announcements, support and to help build a community of practice around this open source package. You may request an invitation to join from jonathan.callahan@dri.com.\n\n# MazamaSpatialUtils\n\n```\nA suite of conversion functions to create internally standardized\nspatial polygons data frames. Utility functions use these data sets to\nreturn values such as country, state, time zone, watershed, etc. associated\nwith a set of longitude/latitude pairs. (They also make cool maps.)\n```\n\n## Background\n\nThe **MazamaSpatialUtils** package was created to regularize \nwork with spatial data. Many sources of shapefile\ndata are available and can be used to make beautiful maps in R. Unfortunately,\nthe data attached to these datasets, even when fairly complete, often lacks\nstandardized identifiers such as the ISO 3166-1 alpha-2 encodings for countries.\nMaddeningly, even when these ISO codes are used, the dataframe column in which\nthey are stored does not have a standardized name. It may be called \"ISO\" or \"ISO2\"\nor \"alpha\" or \"COUNTRY\" or any of a dozen other names we have seen.\n\nWhile many mapping packages provide _\"natural\"_ naming of countries, those who\nwish to develop operational, GIS-like systems need something that is both\nstandardized and language-independent. The ISO 3166-1 alpha-2 encodings have\nemerged as the _de facto_ standard for this sort of work. In similar fashion, ISO\n3166-2 alpha-2 encodings are available for the next administrative level down --\nstate/province/oblast, _etc._ For time zones, the _de facto_ standard is the set of\nOlson time zones used in all UNIX systems.\n\nThe main goal of this package is to create an internally standardized set of\nspatial data that can be used in various projects. Along with three built-in\ndatasets, this package provides `convert~()` functions for other spatial datasets\nof interest. These convert functions all follow the same recipe:\n\n * download spatial data into a standard directory\n * convert spatial data into a **sf** simple features data frame\n * modify the dataframe so that it adheres to package internal standards\n\nOther datasets can be added following the same procedure.\n\nThe 'package internal standards' are very simple.\n\n1) Every spatial dataset **must** contain the following columns:\n\n* polygonID -- unique identifier for each polygon\n* countryCode -- country at centroid of polygon (ISO 3166-1 alpha-2)\n\n2) Spatial datasets with time zone data **must** contain the following column:\n\n* timezone -- Olson timezone\n\n3) Spatial datasets at scales smaller than the nation-state **should** contain the following column:\n\n* stateCode -- 'state' at centroid of polygon (ISO 3166-2 alpha-2)\n\nIf other columns contain these data, those columns must be renamed or duplicated with the \ninternally standardized name. This simple level of consistency makes it possible to generate \nmaps for any data that is ISO encoded. It also makes it possible to create functions that \nreturn the country, state or time zone associated with a set of locations.\n\n## Installation\n\nThis package is designed to be used with [R](https://cran.r-project.org) (\u003e= 4.0)\nand [RStudio](https://posit.co/) so make sure you have those installed first.\n\nInstallation from CRAN is standard:\n\n```\ninstall.packages(\"MazamaSpatialUtils\")\n```\n\nOr you can use the **devtools** package to install the latest version from GitHub:\n\n```\ndevtools::install_github('mazamascience/MazamaSpatialUtils', build_vignettes=TRUE)\n```\n\n## Spatial Datasets\n\n### Package Datasets\n\nThe package comes with the following simplified spatial spatial datasets:\n\n```\n * 367K\tdata/SimpleCountries.rda\n * 1.3M\tdata/SimpleCountriesEEZ.rda\n * 1.4M\tdata/SimpleTimezones.rda\n```\n\nThese datasets allow you to work with low-resolution country outlines and\ntime zones.\n\n### Additional Datasets\n\nAdditional datasets are available at \nhttp://data.mazamascience.com/MazamaSpatialUtils/Spatial_0.8/\nand can be loaded with the following commands:\n\n```\n# Create a location where spatial datasets will be stored\ndir.create('~/Data/Spatial_0.8', recursive = TRUE)\n\n# Tell the package about this location\nsetSpatialDataDir('~/Data/Spatial_0.8')\n\n# Install spatial datasets by name\ninstallSpatialData(\"EPARegions\")\n```\n\nYou can review your currently install**ed** datasets by running:\n\n```\ninstalledSpatialData()\n```\n\nFurther details about each dataset are provided in the source code of\nthe associated `convert~()` \nfunction. Datasets appearing with, *e.g.*, `_05` are simplified datasets whose \npolygons retain only 5% of the vertices in the full resolution dataset.\n\n\n## Examples\n\n### Demos\n\nThere are three demos associated with the package:\n\n```\ndemo(package = 'MazamaSpatialUtils')\n```\n\n----\n\nDevelopment of this R package has been supported with funding from the \nfollowing institutions:\n\n* USFS [AirFire Research Team](https://www.airfire.org)\n\nQuestions regarding further development of the package or inclusion of additional\ndatasets should be directed to \u003cjonathan.callahan@dri.edu\u003e.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazamascience%2Fmazamaspatialutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazamascience%2Fmazamaspatialutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazamascience%2Fmazamaspatialutils/lists"}