geojson-package {geojson}R Documentation

geojson

Description

Classes for GeoJSON to make working with GeoJSON easier

Package API

GeoJSON objects:

The above are assigned two classes. All of them are class geojson, but also have a class name that is geo plus the name of the geometry, e.g., geopolygon for polygon.

GeoJSON properties:

GeoJSON operations:

GeoJSON/Geobuf serialization:

Coordinate Reference System

According to RFC 7946 (https://datatracker.ietf.org/doc/html/rfc7946#page-12) the CRS for all GeoJSON objects must be WGS-84, equivalent to urn:ogc:def:crs:OGC::CRS84. And lat/long must be in decimal degrees.

Given the above, but considering that GeoJSON blobs exist that have CRS attributes in them, we provide CRS helpers in this package. But moving forward these are not likely to be used much.

Coordinate precision

According to RFC 7946 (https://datatracker.ietf.org/doc/html/rfc7946#section-11.2) consider that 6 decimal places amoutns to ~10 centimeters, a precision well within that of current GPS sytems. Further, A GeoJSON text containing many detailed Polygons can be inflated almost by a factor of two by increasing coordinate precision from 6 to 15 decimal places - so consider whether it is worth it to have more decimal places.

Author(s)

Scott Chamberlain, Jeroen Ooms


[Package geojson version 0.3.5 Index]