Skip to content

Commit

Permalink
Use sf instead of geojsonio for geojson
Browse files Browse the repository at this point in the history
  • Loading branch information
sharlagelfand authored and sckott committed Jul 19, 2019
1 parent 30c5666 commit 6c4fc56
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
16 changes: 8 additions & 8 deletions R/ckan_fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
#' class(x)
#' plot(x)
#'
#' GeoJSON file - requires geojsonio package
#' ckanr_setup("http://open.canada.ca/data/en")
#' res <- resource_show(id = "1502d5ec-0af2-4e2f-8fa7-1e90a43f356a", as = "table")
#' ckan_fetch(res$url)
#' # GeoJSON file - requires sf package
#' ckanr_setup("http://datamx.io")
#' res <- resource_show(id = "b1cd35b7-479e-4fa0-86e9-e897d3c617e6", as = "table")
#' x <- ckan_fetch(res$url)
#' class(x)
#' plot(x[, c("mun_name", "geometry")])
#'
#' }
ckan_fetch <- function(x, store = "session", path = "file", format = NULL, ...) {
Expand Down Expand Up @@ -98,10 +100,8 @@ read_session <- function(fmt, dat, path) {
sf::st_read(path)
},
geojson = {
check4X("geojsonio")
geojsonio::geojson_read(path,
method = "local",
parse = TRUE)
check4X("sf")
sf::st_read(path)
}
)
}
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"version": "3.6.0",
"version": "3.5.2",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 3.6.0 Patched (2019-04-30 r76446)",
"runtimePlatform": "R version 3.5.2 (2018-12-20)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -252,7 +252,7 @@
"contIntegration": "https://travis-ci.org/ropensci/ckanr",
"releaseNotes": "https://github.com/ropensci/ckanr/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/ckanr/blob/master/README.md",
"fileSize": "77.083KB",
"fileSize": "76.198KB",
"copyrightHolder": {},
"funder": {}
}
10 changes: 6 additions & 4 deletions man/ckan_fetch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c4fc56

Please sign in to comment.