Introduction
We will use the R package sf
(“simple features”) to understand how simple geometric shapes are encoded into data, that can be plotted as maps.
We will then plot maps using mapping packages like ggplot
and tmap
to create static and interactive maps. We will initially use data that we can download from Natural Earth and Open Street Map (OSM).
Later we will construct our own maps using data that we gather from the street using the Vespucci app.
First; let us watch a short, noisy video on maps:
Maps That Will Change The Way You See The World:(https://www.youtube.com/watch?v=YH2sAbXv7p4)
r blogdown::shortcode("youtube", "YH2sAbXv7p4")
References
Start HereOur Coding Club Tutorial
Nikita Voevodin, R, Not the Best Practices
Nico Hahn, Making Maps with R
Emine Fidan, Interactive Maps in R
Lovelace et al, Geocomputation in R
Mapping Projects
1. Animal and Bird Migration
- Head off to movebank.org
- Look at a few species of interest and choose one.
- Download the data ( ESRI Shapefile)
- Import that into R using
sf_read()
- See how you can plot locations, tracks and colour by species….based on the data you download.
For tutorial info: https://movebankworkshopraleighnc.netlify.app/
2. Food at Home
- Draw a map of your home-town with your favourite restaurants shown. Pop-ups for each restaurant will win bonus points.
Take a look at: Burkhart, Christian. “Streetmaps.” StreetMaps
3. Mapping India: Places of Worship
Do some searching and make a list of Places of Worship in India that are known to you.
Head off to the India Place Finder website (india.info-proto.com/index.php/). Using the search facility there, download a CSV file that contains names of the places and their lon-lat coordinates.
Read this CSV into R. Use the
sfheaders
package to convert this data into ansf
spatial data frame.Use the
ggplot
or thetmap
+plotly
packages to plot these on an India map. Use thernaturalearth
package to get hold of an India map that is relevant to your area of interest.Extra:
- Use font-awesome icons to signify your Places of Worship.
- Use popups in
tmap/plotly
to pop-up a picture or video about the place
4. Mapping Places Yelahanka on Open Street Map
- Download the Vespucci app on your phone:
- Android app on Play Store
- iPhone is sadly not available. So partner with an Android phone user please!
- You will need to create an account on Open Street Map and login to the app on your phone. This will allow you to contribute changes and data to the map and your data will be available to any netizen for download.
- Read this Vespucci Tutorial
- Choose specific categories of Places of interest:
- Restaurants
- Street Food locations
- Medicines
- Dustbins/garbage
- Flowering Trees
- Park Benches
- Street Lighting
- Wherever possible, record metadata:
- Menu / Cuisine
- Timings
- Indoor or outdoor seating
- Parking available
- Download in R and plot using
ggplot
or usingtmap
.