-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathREADME.Rmd
52 lines (37 loc) · 1.65 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# arcpullr
<!-- badges: start -->
<!-- badges: end -->
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)
```