Created
October 11, 2022 22:33
-
-
Save ozjimbob/473a862914e4a11a5919ca786bca7cad to your computer and use it in GitHub Desktop.
blah.r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(plumber) | |
library(sf) | |
library(geojson) | |
register_serializer("geojson", serializer_geojson, verbose = TRUE) | |
#* @serializer geojson | |
#* @get /points | |
points <- function() { | |
data <- read_csv("https://gist.githubusercontent.com/kochis/535208c97d99651e052487618bde7730/raw/35d43acbe8f9188691fde4238f838ad0572ea871/locations.csv") | |
data <- st_as_sf(data,coords=c("longitude","latitude"),crs=4326) | |
return(data) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment