Determins whether or not a piece of OSM infrastructure is lit or not.

oi_is_lit(osm_sf, remove=FALSE)

Arguments

osm_sf
  • A sf and data.frame object containing OpenStreetMap infrastructure data.

remove
  • Boolean - If TRUE, features that do not have lighting are removed from the osm_sf before being returned.

Value

an sf object with oi_is_lit column added, indicating if the way is lit or not.

Details

This function adds a new column, openinfra_is_lit containing values "yes" , "no", whether or not the feature is lit. The value "maybe" is assigned when there is a lack of data to distinguish - not implying the presence or lack of lighting, but a lack of data to identify.

Note: the osm_sf must contain the following tags: c("lit", "lit_by_led")

Examples

data = example_data
example_output = oi_is_lit(data)

# Quick Plot
plot(example_output["openinfra_is_lit"], key.pos = 1)


# Advanced plot with tmap - un-comment following four lines to run! 
#tmap::tmap_mode("view")
# tmap::tm_shape(example_output |> dplyr::select(openinfra_is_lit)) +
# tmap::tm_lines(col = "openinfra_is_lit", title.col = "Lighting presence") +
# tmap::tm_layout(legend.bg.color = "white")