shp_to_geojson: Create GeoJSON from Shapefile

View source: R/shp_to_geojson.R

shp_to_geojsonR Documentation

Create GeoJSON from Shapefile

Description

Create GeoJSON file needed for interactive map in Shiny app

Usage

shp_to_geojson(
  shp,
  js,
  geojson = sprintf("%s.geojson", tools::file_path_sans_ext(js))
)

Arguments

shp

path to shapefile with .shp extension, needs rgn_id and rgn_name fields

js

path to output javascript file with variable 'regions' of geojson content

geojson

path to output GeoJSON file. defaults to *.geojson of *.js file.

Details

Uses rgdal to write GeoJSON.


OHI-Science/ohirepos documentation built on June 1, 2024, 12:21 p.m.