README.md

ne2geojson

[Licence] minimal R version CRAN_Status_Badge packageversion Last-changedate

GeoJSON is an open standard format that is handy for representing geographic data structures in text-based JSON files. The only function (ne2geojson) in this package streamlines the process of downloading a Natural Earth shapefile (http://www.naturalearthdata.com) and converting it to GeoJSON format.

Installation

# install.packages("devtools")
devtools::install_github("kamermanpr/ne2geojson")

Examples

Create 110m scale country-level GeoJSON in current working directory:

ne2geojson(input_filename = 'ne_110m_admin_0_countries')

Create 110m scale country-level GeoJSON in new directory:

ne2geojson(input_filename = 'ne_110m_admin_0_countries',
           output_dir = './country')

Create simplified 110m scale country-level GeoJSON, retaining 50% of the data:

ne2geojson(input_filename = 'ne_110m_admin_0_countries',
           simplify = TRUE,
           retain = 0.5)

Documentation

Documentation can be found at: kamermanpr.github.io/ne2geojson/.



kamermanpr/ne2geojson documentation built on Jan. 12, 2023, 6:50 p.m.