sift_client: Sift geojson - low level client

View source: R/sift_client.R

sift_clientR Documentation

Sift geojson - low level client

Description

Sift geojson - low level client

Usage

sift_client(x, query)

## S3 method for class 'character'
sift_client(x, query)

## S3 method for class 'json'
sift_client(x, query)

## S3 method for class 'list'
sift_client(x, query)

Arguments

x

input, one of character string, json, list, or ...

query

query

Value

an object of class character

Examples

library("leaflet")

# get sample data
file <- system.file("examples", "zillow_or.geojson", package = "siftgeojson")

# plot as is
dat <- jsonlite::fromJSON(file, FALSE)
leaflet() %>% addTiles() %>% addGeoJSON(dat) %>% setView(-122.8, 44.8, zoom = 8)

# filter to features in Multnomah County only
json <- paste0(readLines(file), collapse = "")
json2 <- sift_client(json, '.features[] | select(.properties.COUNTY == "Multnomah")')
dat <- jsonlite::fromJSON(json2, FALSE)
leaflet() %>% addTiles() %>% addGeoJSON(dat) %>% setView(-122.6, 45.5, zoom = 10)

ropenscilabs/siftgeojson documentation built on May 18, 2022, 8:32 p.m.