geoops-package: geoops

Description Author(s) Examples

Description

Tools for doing calculations and manipulations on GeoJSON, a 'geospatial' data interchange format (https://tools.ietf.org/html/rfc7946). GeoJSON is also valid JSON.

Author(s)

Scott Chamberlain

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library("geoops")

# Calculate distance between two GeoJSON points
pt1 <- '{
  "type": "Feature",
  "properties": {
    "marker-color": "#f00"
   },
   "geometry": {
      "type": "Point",
      "coordinates": [-75.343, 39.984]
   }
}'

pt2 <- '{
  "type": "Feature",
  "properties": {
     "marker-color": "#0f0"
   },
   "geometry": {
      "type": "Point",
      "coordinates": [-75.534, 39.123]
    }
}'
geo_distance(pt1, pt2)

ropenscilabs/geoops documentation built on Jan. 1, 2021, 4:03 p.m.