geoops does spatial operations on GeoJSON.

geoops is inspired by the JS library turf. It’s tagline is Advanced geospatial analysis for browsers and node. Turf works only with GeoJSON, as does geoops. I don’t know JS that well, but it’s easy enough to understand the language, so I’ve been porting Turf to C++ wrapped up in R. The C++ so we can have fast performance. We’ve also wrapped the Turf JS library itself in the package lawn, but we should be able to get better performance out of C++.

geoops has a ways to go to include all the methods that Turf has, but we’ll get there eventually.

This package is alpha stage, expect bugs and changes.

All data is expected to be in WGS-84.

We use a library from Niels Lohmann for working with JSON in C++.

See also:

Package API:

#>  - geo_bearing
#>  - geo_midpoint
#>  - geo_bbox_polygon
#>  - geo_pointgrid
#>  - geo_area
#>  - geo_get_coords
#>  - version
#>  - geo_nearest
#>  - geo_along
#>  - geo_distance
#>  - geo_destination
#>  - geo_trianglegrid
#>  - geo_planepoint
#>  - geo_line_distance

Installation

Stable version

Dev version

devtools::install_github("ropensci/geoops")
library("geoops")

bearing

Calculate bearing between two points

Example use case

expand Get some GeoJSON data, a FeatureCollection of Polygons ```r file % addProviderTiles(provider = "OpenStreetMap.Mapnik") %>% addGeoJSON(geojson = x) %>% setView(lng = -123, lat = 45, zoom = 7) ``` ![plot of chunk unnamed-chunk-21](tools/img/unnamed-chunk-21-1.png) Just one of them ```r leaflet() %>% addProviderTiles(provider = "OpenStreetMap.Mapnik") %>% addGeoJSON(geojson = polys[1]) %>% setView(lng = -122.7, lat = 45.48, zoom = 13) ``` ![plot of chunk unnamed-chunk-22](tools/img/unnamed-chunk-22-1.png)

Meta

ropensci_footer