https://github.com/pfrater/arcpullr
https://github.com/pfrater/arcpullr
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pfrater/arcpullr
- Owner: pfrater
- Created: 2020-09-04T16:55:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T18:32:02.000Z (about 1 year ago)
- Last Synced: 2024-06-04T23:02:35.754Z (11 months ago)
- Language: R
- Size: 4.35 MB
- Stars: 21
- Watchers: 2
- Forks: 8
- Open Issues: 7
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- jimsghstars - pfrater/arcpullr - (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# arcpullr
The `arcpullr` package provides functions for pulling spatial data from an ArcGIS REST API and formatting those layers into either `sf` or `Raster*` objects (depending on the layer being requested). These functions provide the basis for retrieving spatial data housed in an ArcGIS REST API using either spatial or relational queries. The output from these querying functions is intended to work seamlessly with other spatial packages already implemented and established in R. This package was neither produced nor is maintained by Esri.
## Installation
``` {r install,eval = FALSE}
#Install directly from CRAN:
install.packages("arcpullr")# Or the development version from GitHub:
# install.packages("devtools")
devtools::install_github("pfrater/arcpullr")
```## Example
The below example demonstrates how to use `arcpullr`
to query the [Wisconsin Department of Natural Resources County
ArcGIS Rest API](https://dnrmaps.wi.gov/arcgis/rest/services//DW_Map_Dynamic/EN_Basic_Basemap_WTM_Ext_Dynamic_L16/MapServer/3)```{r example, warning=FALSE}
library(arcpullr)
wdnr_server <-"https://dnrmaps.wi.gov/arcgis/rest/services/"
counties <- "DW_Map_Dynamic/EN_Basic_Basemap_WTM_Ext_Dynamic_L16/MapServer/3"
wi_counties_url <- paste(wdnr_server,counties, sep ="/")
wi_counties <- get_spatial_layer(wi_counties_url)ggplot2::ggplot() +
ggplot2::geom_sf(data = wi_counties)
```