if (FALSE) {
query <- opq ("hampi india") |>
add_osm_feature (key = "historic", value = "ruins")
# Then extract data from 'Overpass' API
hampi_sf <- osmdata_sf (query)
# Remove rownames from all geometry metrices:
hampi_clean <- unname_osmdata_sf (hampi_sf)
# All coordinate matrices include rownames with OSM ID values:
head (as.matrix (hampi_sf$osm_lines$geometry [[1]]))
# But 'unname_osmdata_sf' removes both row and column names:
head (as.matrix (hampi_clean$osm_lines$geometry [[1]]))
}
Run the code above in your browser using DataLab