knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

geojsonio

R-CMD-check cran checks codecov.io rstudio mirror downloads cran version Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.

library("knitr")
hook_output <- knitr::knit_hooks$get("output")
knitr::knit_hooks$set(output = function(x, options) {
   lines <- options$output.lines
   if (is.null(lines)) {
     return(hook_output(x, options))  # pass to default hook
   }
   x <- unlist(strsplit(x, "\n"))
   more <- "..."
   if (length(lines)==1) {        # first n lines
     if (length(x) > lines) {
       # truncate the output, but add ....
       x <- c(head(x, lines), more)
     }
   } else {
     x <- c(if (abs(lines[1])>1) more else NULL,
            x[lines],
            if (length(x)>lines[abs(length(lines))]) more else NULL
           )
   }
   # paste these lines together
   x <- paste(c(x, ""), collapse = "\n")
   hook_output(x, options)
 })

knitr::opts_chunk$set(
  comment = "#>",
  collapse = TRUE,
  warning = FALSE,
  message = FALSE,
  eval = FALSE
)

Convert various data formats to GeoJSON or TopoJSON

This package is a utility to convert geographic data to GeoJSON and TopoJSON formats. Nothing else. We hope to do this one job very well, and handle all reasonable use cases.

Functions in this package are organized first around what you're working with or want to get, GeoJSON or TopoJSON, then convert to or read from various formats:

Each of the above functions have methods for various objects/classes, including numeric, data.frame, list, SpatialPolygons, SpatialLines, SpatialPoints, etc.

Additional functions:

*json Info

Install

Mac

Install GDAL on the command line first, e.g., using homebrew

brew install gdal

Linux

Get deps first

#| echo: true
#| eval: true
remotes::system_requirements("ubuntu", "20.04", package = "geojsonio")

Install geojsonio

Stable version from CRAN

install.packages("geojsonio")

Or development version from GitHub

install.packages("remotes")
remotes::install_github("ropensci/geojsonio")
library("geojsonio")

What's the future of geojsonio?

geojsonio is stable and we expect it to stay on CRAN. The package is a dependency for a number of other packages and is downloaded tens of thousands of times per month; moving forward the priority with this package is to make sure that those packages and users are able to keep using the package.

That said, we do not anticipate much further development; there will not likely be many major new features added or new interfaces developed. We'll avoid making breaking changes as much as possible.

If you find bugs in geojsonio or want to contribute new features: please feel free to submit PRs! So long as the existing interface stays intact, we'd be more than happy to make the package more useful for you. That said, we don't anticipate being particularly responsive to feature requests (without a matching PR) moving forward.

Meta



ropensci/geojsonio documentation built on Oct. 30, 2023, 2:22 p.m.