View source: R/shp_to_geojson.R
shp_to_geojson | R Documentation |
Create GeoJSON file needed for interactive map in Shiny app
shp_to_geojson(
shp,
js,
geojson = sprintf("%s.geojson", tools::file_path_sans_ext(js))
)
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. |
Uses rgdal to write GeoJSON.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.