lawn - a new package to do geospatial analysis

lawn is an R wrapper for the Javascript library turf.js for advanced geospatial analysis. In addition, we have a few functions to interface with the geojson-random Javascript library. lawn includes traditional spatial operations, helper functions for creating GeoJSON data, and data classification and statistics tools. There is an additional helper function (see view()) in this package to help visualize data with interactive maps via the leaflet package (https://github.com/rstudio/leaflet). Note that leaflet is not required to install lawn - it’s in Suggests, not Imports or Depends....

May 18, 2015 · 5 min · Scott Chamberlain

geojsonio - a new package to do geojson things

geojsonio converts geographic data to GeoJSON and TopoJSON formats - though the focus is mostly on GeoJSON For those not familiar GeoJSON it is a format for encoding a variety of geographic data structures. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. These geometry types are also found in well known text (WKT), and have equivalents in R’s spatial classes. Read the spec for more detailed information....

April 30, 2015 · 5 min · Scott Chamberlain

R I/O for geojson and topojson

At rOpenSci we’ve been working on an R package (geojsonio) to make converting R data in various formats to geoJSON and topoJSON, and vice versa. 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: geojson_list()/topojson_list() - convert to geojson/topojson as R list format geojson_json()/topojson_json() - convert to geojson/topojson as json geojson_read()``topojson_read() - read a geojson/topojson file from file path or URL geojson_write()/topojson_write() - write a geojson/topojson file locally Each of the above functions have methods for various objects/classes, including numeric, data....

January 6, 2015 · 5 min · Scott Chamberlain

R to GeoJSON

UPDATE As you can see in Patrick’s comment below you can convert to GeoJSON format files with rgdal as an alternative to calling the Ogre web API described below. See here for example code for converting to GeoJSON with rgdal. GitHub recently introduced the ability to render GeoJSON files on their site as maps here, and recently introduced here support for TopoJSON, an extension of GeoJSON can be up to 80% smaller than GeoJSON, support for other file extensions (....

June 30, 2013 · 3 min · Scott Chamberlain