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

geojson classes

The following geojson classes are suppported:

class name - (geojson package class name)

You can create these classes with functions in geojson, e.g., create a point class like

x <- "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-99.74,32.45]},\"properties\":{}}]}"
gj_point(x)
x <- '{ "type": "GeometryCollection",
    "geometries": [
      { "type": "Point",
        "coordinates": [100.0, 0.0]
        },
      { "type": "LineString",
        "coordinates": [ [101.0, 0.0], [102.0, 1.0] ]
      }
  ]
}'
as.geojson(x)


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