Learn R Programming

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

#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

library(arcpullr)
#> Loading required package: sf
#> Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
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)

Copy Link

Version

Install

install.packages('arcpullr')

Monthly Downloads

503

Version

0.3.2

License

GPL-3

Maintainer

Paul Frater

Last Published

December 12th, 2025

Functions in arcpullr (0.3.2)

raster_colors,RasterBrick-method

Convert RasterBrick into data.frame of colors that can be used for plotting
sf_objects

Create sf objects from coordinates
valid_sp_rel

Check to see which spatial relation types are applicable to the feature classes being queried and the sf objects use do to a spatial query
sp_rel_lookups

Spatial relationship descriptor and lookup tables
raster_colors

Convert RasterLayer into data.frame of colors for each pixel that can be used for plotting
sf_example_polys

Various example sf polygons
plot_layer,sf-method

Plot an sf object
plot_layer

Plot a spatial layer
get_service_type

Get elements of a Service or Layer from an ArcGIS REST endpoint
raster_colors,RasterStack-method

Convert RasterStack into data.frame of colors that can be used for plotting
raster_colors,SpatRaster-method

Convert SpatRaster into data.frame of colors that can be used for plotting
raster_colors,RasterLayer-method

Convert RasterLayer into data.frame of colors that can be used for plotting
sp_rel_xref

Lookup function for shorthand versions of spatial relation text strings
sql_where

Format a SQL where clause from arguments
example_urls

Various URLs used in examples
get_geometry_type

Get Geometry Type
format_coords

Convert coordinates from an 'sf' object to formatted well-known text
get_map_layer

Retrieve a map service layer from an ArcGIS REST API
get_layer_html

Pull the HTML body from a web page
get_layer_legend

Returns a legend for a raster layer
plot_layer,RasterStack-method

Plot a RasterStack object
get_raster_layer

Pull a raster layer from a map service or image service layer of an ArcGIS REST API
plot_layer,RasterLayer-method

Plot a RasterLayer object
match_legend_colors

Match colors in SpatRaster coltab to the provided legend values
get_image_layer

Retrieve an image service layer from an ArcGIS REST API
get_layers_by_spatial

Retrieve ArcGIS REST API spatial layer by spatial query
get_layer_info

Retrieve metadata for a layer
plot_layer,RasterBrick-method

Plot a RasterBrick object
get_sf_crs

Return CRS value of an sf object
get_table_layer

Retrieve a table from an ArcGIS REST API
plot_layer,SpatRaster-method

Plot a SpatRaster object
arcpullr-package

arcpullr
get_spatial_layer

Retrieve a feature service layer from an ArcGIS REST API