SlideShare a Scribd company logo
1 of 13
DAVV
School of Data Science and Forecasting
M.sc. (Data Science and Analytics) 2nd Sem
Name - Tanay Deshmukh
Roll Number - DS5B-2034
Subject - Statistical Programming in R
Subject Code - DS5B-508
Assignment Topic - OpenStreetMap(OSM)
Date - 30-06-2021
Submitted to – Mr. Vandit Hedau
Result
Libraries used –
Functions used –
• available_tags()
• getbb()
• add_osm_feature()
• osmdata_sf()
• geom_sf()
• coord_sf()
• etc
Procedure
available_tags("highway")
getbb("atlanta georgia")
big_streets <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "highway", value = c("motorway", "primary", "motorway_link", "primary_link"))%>%
osmdata_sf()
big_streets
med_streets <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "highway", value = c("Secondary", "tertiary", "secondary_link", "tertiary_link"))%>%
osmdata_sf()
small_streets <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "highway", value = c("residential", "living_street", "unclassified", "service", "footway"))%>%
osmdata_sf()
river <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "waterway", value = "river")%>%
osmdata_sf()
railway <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "railway", value = "rail")%>%
osmdata_sf()
available_tags("railway")
Importing Data
Console Code
ggplot() +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen")
ggplot() +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue")
ggplot() +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen") +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue")
Plotting Separate maps
ggplot() +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen") +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue") +
coord_sf(xlim = c(-82.60, -82.51),
ylim = c(35.54, 35.63),
expand = TRUE)
Selected Area from Plot
ggplot() +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue",
size = .8,
alpha = .3) +
geom_sf(data = railway$osm_lines,
inherit.aes = FALSE,
color = "white",
size = .2,
alpha = .5) +
geom_sf(data = med_streets$osm_lines,
inherit.aes = FALSE,
color = "yellow3",
size = .3,
alpha = .5) +
geom_sf(data = small_streets$osm_lines,
inherit.aes = FALSE,
color = "black",
size = .2,
alpha = .5) +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen",
size = .5,
alpha = .6) +
coord_sf(xlim = c(-82.60, -82.51),
ylim = c(35.54, 35.63),
expand = TRUE) +
theme_void() +
theme(plot.title = element_text(size = 20, family = "lato", face = "bold", hjust = .5),
plot.subtitle = element_text(family = "lato", size = 8, hjust = .5, margin = margin(2, 0, 5, 0))) +
labs(title = "Raccoon City", subtitle = "35.54°N/82.60°W")
Quick image of OSM
library(osmdata)
library(ggmap)
library(tidyverse)
library(remotes)
library(showtext)
library(rvest)
available_tags("highway")
getbb("atlanta georgia")
big_streets <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "highway", value = c("motorway", "primary", "motorway_link", "primary_link"))%>%
osmdata_sf()
big_streets
med_streets <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "highway", value = c("Secondary", "tertiary", "secondary_link", "tertiary_link"))%>%
osmdata_sf()
small_streets <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "highway", value = c("residential", "living_street", "unclassified", "service", "footway"))%>%
osmdata_sf()
river <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "waterway", value = "river")%>%
osmdata_sf()
railway <- getbb("Asheville United States")%>%
opq()%>%
add_osm_feature(key = "railway", value = "rail")%>%
osmdata_sf()
available_tags("railway")
Code(1)
ggplot() +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen")
ggplot() +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue")
ggplot() +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen") +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue")
ggplot() +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen") +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue") +
coord_sf(xlim = c(-82.60, -82.51),
ylim = c(35.54, 35.63),
expand = TRUE)
font_add_google(name = "Lato", family = "lato")
showtext_auto()
ggplot() +
geom_sf(data = river$osm_lines,
inherit.aes = FALSE,
colour = "blue",
size = .8,
alpha = .3) +
geom_sf(data = railway$osm_lines,
inherit.aes = FALSE,
color = "white",
size = .2,
alpha = .5) +
geom_sf(data = med_streets$osm_lines,
inherit.aes = FALSE,
color = "yellow3",
size = .3,
alpha = .5) +
geom_sf(data = small_streets$osm_lines,
inherit.aes = FALSE,
color = "black",
size = .2,
alpha = .5) +
geom_sf(data = big_streets$osm_lines,
inherit.aes = FALSE,
colour = "yellowgreen",
size = .5,
alpha = .6) +
coord_sf(xlim = c(-82.60, -82.51),
ylim = c(35.54, 35.63),
expand = TRUE) +
theme_void() +
theme(plot.title = element_text(size = 20, family = "lato", face = "bold", hjust = .5),
plot.subtitle = element_text(family = "lato", size = 8, hjust = .5, margin =
margin(2, 0, 5, 0))) +
labs(title = "Raccoon City", subtitle = "35.54°N/82.60°W")
Code(2)
Code(3)
Final OpenStreetMap
Thank You

More Related Content

Similar to OpenStreetMap R

Web accessibility
Web accessibilityWeb accessibility
Web accessibility
Eb Styles
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
CoLab Athens
 

Similar to OpenStreetMap R (20)

Automatic Spatio-temporal Indexing to Integrate and Analyze the Data of an Or...
Automatic Spatio-temporal Indexing to Integrate and Analyze the Data of an Or...Automatic Spatio-temporal Indexing to Integrate and Analyze the Data of an Or...
Automatic Spatio-temporal Indexing to Integrate and Analyze the Data of an Or...
 
JQuery Flot
JQuery FlotJQuery Flot
JQuery Flot
 
Java 8 DOs and DON'Ts - javaBin Oslo May 2015
Java 8 DOs and DON'Ts - javaBin Oslo May 2015Java 8 DOs and DON'Ts - javaBin Oslo May 2015
Java 8 DOs and DON'Ts - javaBin Oslo May 2015
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
 
Machine Learning with Microsoft Azure
Machine Learning with Microsoft AzureMachine Learning with Microsoft Azure
Machine Learning with Microsoft Azure
 
Data Science Academy Student Demo day--Peggy sobolewski,analyzing transporati...
Data Science Academy Student Demo day--Peggy sobolewski,analyzing transporati...Data Science Academy Student Demo day--Peggy sobolewski,analyzing transporati...
Data Science Academy Student Demo day--Peggy sobolewski,analyzing transporati...
 
Interactive Questions and Answers - London Information Retrieval Meetup
Interactive Questions and Answers - London Information Retrieval MeetupInteractive Questions and Answers - London Information Retrieval Meetup
Interactive Questions and Answers - London Information Retrieval Meetup
 
Cetis12 sna
Cetis12 snaCetis12 sna
Cetis12 sna
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
huhu
huhuhuhu
huhu
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
 
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
 
GeoTuple a Framework for Web Based Geo-Analytics with R and PostGIS
GeoTuple a Framework for Web Based Geo-Analytics with R and PostGISGeoTuple a Framework for Web Based Geo-Analytics with R and PostGIS
GeoTuple a Framework for Web Based Geo-Analytics with R and PostGIS
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Django
 
Pycon2011
Pycon2011Pycon2011
Pycon2011
 

Recently uploaded

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 

OpenStreetMap R

  • 1. DAVV School of Data Science and Forecasting M.sc. (Data Science and Analytics) 2nd Sem Name - Tanay Deshmukh Roll Number - DS5B-2034 Subject - Statistical Programming in R Subject Code - DS5B-508 Assignment Topic - OpenStreetMap(OSM) Date - 30-06-2021 Submitted to – Mr. Vandit Hedau
  • 3. Libraries used – Functions used – • available_tags() • getbb() • add_osm_feature() • osmdata_sf() • geom_sf() • coord_sf() • etc Procedure
  • 4. available_tags("highway") getbb("atlanta georgia") big_streets <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "highway", value = c("motorway", "primary", "motorway_link", "primary_link"))%>% osmdata_sf() big_streets med_streets <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "highway", value = c("Secondary", "tertiary", "secondary_link", "tertiary_link"))%>% osmdata_sf() small_streets <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "highway", value = c("residential", "living_street", "unclassified", "service", "footway"))%>% osmdata_sf() river <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "waterway", value = "river")%>% osmdata_sf() railway <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "railway", value = "rail")%>% osmdata_sf() available_tags("railway") Importing Data
  • 6. ggplot() + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen") ggplot() + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue") ggplot() + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen") + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue") Plotting Separate maps
  • 7. ggplot() + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen") + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue") + coord_sf(xlim = c(-82.60, -82.51), ylim = c(35.54, 35.63), expand = TRUE) Selected Area from Plot
  • 8. ggplot() + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue", size = .8, alpha = .3) + geom_sf(data = railway$osm_lines, inherit.aes = FALSE, color = "white", size = .2, alpha = .5) + geom_sf(data = med_streets$osm_lines, inherit.aes = FALSE, color = "yellow3", size = .3, alpha = .5) + geom_sf(data = small_streets$osm_lines, inherit.aes = FALSE, color = "black", size = .2, alpha = .5) + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen", size = .5, alpha = .6) + coord_sf(xlim = c(-82.60, -82.51), ylim = c(35.54, 35.63), expand = TRUE) + theme_void() + theme(plot.title = element_text(size = 20, family = "lato", face = "bold", hjust = .5), plot.subtitle = element_text(family = "lato", size = 8, hjust = .5, margin = margin(2, 0, 5, 0))) + labs(title = "Raccoon City", subtitle = "35.54°N/82.60°W") Quick image of OSM
  • 9. library(osmdata) library(ggmap) library(tidyverse) library(remotes) library(showtext) library(rvest) available_tags("highway") getbb("atlanta georgia") big_streets <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "highway", value = c("motorway", "primary", "motorway_link", "primary_link"))%>% osmdata_sf() big_streets med_streets <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "highway", value = c("Secondary", "tertiary", "secondary_link", "tertiary_link"))%>% osmdata_sf() small_streets <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "highway", value = c("residential", "living_street", "unclassified", "service", "footway"))%>% osmdata_sf() river <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "waterway", value = "river")%>% osmdata_sf() railway <- getbb("Asheville United States")%>% opq()%>% add_osm_feature(key = "railway", value = "rail")%>% osmdata_sf() available_tags("railway") Code(1)
  • 10. ggplot() + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen") ggplot() + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue") ggplot() + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen") + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue") ggplot() + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen") + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue") + coord_sf(xlim = c(-82.60, -82.51), ylim = c(35.54, 35.63), expand = TRUE) font_add_google(name = "Lato", family = "lato") showtext_auto() ggplot() + geom_sf(data = river$osm_lines, inherit.aes = FALSE, colour = "blue", size = .8, alpha = .3) + geom_sf(data = railway$osm_lines, inherit.aes = FALSE, color = "white", size = .2, alpha = .5) + geom_sf(data = med_streets$osm_lines, inherit.aes = FALSE, color = "yellow3", size = .3, alpha = .5) + geom_sf(data = small_streets$osm_lines, inherit.aes = FALSE, color = "black", size = .2, alpha = .5) + geom_sf(data = big_streets$osm_lines, inherit.aes = FALSE, colour = "yellowgreen", size = .5, alpha = .6) + coord_sf(xlim = c(-82.60, -82.51), ylim = c(35.54, 35.63), expand = TRUE) + theme_void() + theme(plot.title = element_text(size = 20, family = "lato", face = "bold", hjust = .5), plot.subtitle = element_text(family = "lato", size = 8, hjust = .5, margin = margin(2, 0, 5, 0))) + labs(title = "Raccoon City", subtitle = "35.54°N/82.60°W") Code(2) Code(3)
  • 12.