diff --git a/vignettes/data_schema.Rmd b/vignettes/data_schema.Rmd index 18859b4..1aaac01 100644 --- a/vignettes/data_schema.Rmd +++ b/vignettes/data_schema.Rmd @@ -1,5 +1,5 @@ --- -title: "An opinionated way of working with OSM data." +title: "An opinionated way of working with OSM data" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{An opinionated way of working with OSM data.} @@ -15,8 +15,6 @@ knitr::opts_chunk$set(eval = FALSE ``` - - ## Introduction Anyone who has used OpenStreetMap (OSM) data in R or python might agree that the tagging system, while it provides great flexibility and extensive classification options, is sometimes a bit challenging to work with. This vignettes will explain the approach to the tagging system that aims to make it easy to interact with features, their associated tags and their geometries. The main ambition being providing an easy access to large OSM data sets. @@ -86,22 +84,18 @@ Arguably, some tags don't fall into any of these categories, yet you can export By default, only tags with keys $amenity,shop,tourism$ will be extracted. --
- - ```{r} +```{r} - library(cppRnet) - library(sf) +library(cppRnet) +library(sf) - test_file <- system.file(package = 'cppRnet','extdata','map.osm') +test_file <- system.file(package = 'cppRnet','extdata','map.osm') - data <- cppRnet::extract_data(test_file) +data <- cppRnet::extract_data(test_file) - head(data) - - ``` +head(data) -
+``` The geometry is simplified to the centroid, for which the coordinates are provided in the lon,lat columns of the data table. A function allowing to reconstruct the full geometry is provided, but since it is not necessarily always usefull to have it, it is ommited in a first extraction. The nodes that constitute a full geometry, if it is more complex than a point, are added to the attrs column as a `data.frame`. These geometries are always closed, meaining they are polygons. This is meant to save memory especially for large data sets.