-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
117 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
Package: esri2sf | ||
Type: Package | ||
Title: What the Package Does (Title Case) | ||
Title: Create Simple Features from ArcGIS Server REST API | ||
Version: 0.1.0 | ||
Author: Who wrote it | ||
Maintainer: The package maintainer <yourself@somewhere.net> | ||
Description: More about what it does (maybe more than one line) | ||
Use four spaces when indenting paragraphs within the Description. | ||
License: What license is it under? | ||
Author: Yongha Hwang | ||
Maintainer: Yongha Hwang <yongha.hwang@gmail.com> | ||
Description: This package enables you to create simple features directrly from ArcGIS servers REST API. | ||
License: MIT | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Imports: | ||
dplyr, | ||
jsonlite, | ||
httr, | ||
sf | ||
RoxygenNote: 6.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
title: "esri2sf-vignettes" | ||
author: "Yongha Hwang" | ||
date: "August 23, 2017" | ||
output: rmarkdown::html_vignette | ||
vignette: > | ||
%\VignetteIndexEntry{esri2sf-vignettes} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
\usepackage[utf8]{inputenc} | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
``` | ||
|
||
## esri2sf | ||
|
||
Still many geographic data is delivered through ESRI's ArcGIS Server. It is not easy to utilize the geographic data in the server. This package enables users to use vector data in ArcGIS Server through the server's REST API. It download geographic features from ArcGIS Server and saves it as Simple Features. | ||
|
||
## How it works | ||
|
||
This program sends a request to ArcGIS Server and gets json responses containing coordinates. Unfortunately, ESRI's json format is not the same as geojson. So it converts the json into WKT strings and creates simple feature geometries from them. Then it combines attributes to the geometries to create sf dataframe. Often ArcGIS servers limits the maximum number of result sets. So this program creates features by 500 in one request and send a request until it gets all features. | ||
|
||
## Install | ||
|
||
I recommend devtools to install this package.This package has dependency on dplyr, sf, httr, jsonlite | ||
|
||
```{r} | ||
devtools::install_github("yonghah/esri2sf") | ||
library("esri2sf") | ||
``` | ||
|
||
## How to use | ||
|
||
The key is to get the endpoint of REST service that you want. Once you get the URL of the REST service, follow this. | ||
|
||
|
||
### Point data | ||
|
||
```{r} | ||
url <- "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0" | ||
outFields <- c('Height', "Leaf_Area") | ||
df <- esri2sf(url, outFields) | ||
plot(df) | ||
``` | ||
|
||
|
||
```{r cars} | ||
summary(cars) | ||
``` | ||
|
||
## Including Plots | ||
|
||
You can also embed plots, for example: | ||
|
||
```{r pressure, echo=FALSE} | ||
plot(pressure) | ||
``` | ||
|
||
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. |