- 3 Minutes Wednesdays
- Posts
- 3MW (Getting started with maps)
3MW (Getting started with maps)
Guten Tag!
Many greetings from Ulm, Germany. It's already November which means that the 30 day map challenge has started. Here's this year's line up of prompts.
I probably won't find the time to participate. Also, I am a map newbie. Still, I have created a few basic maps once or twice. So, let me share resources that helped me get started with maps.
Connecting to OpenStreepMap
OpenStreepMap is a great source for getting map data. Its API let's you extract all kinds of information (like locations of supermarkets or gas stations) using your favorite programming language. If you're using R, then there is the {osmdata} package to help you with that.
And you don't have to look far, to find a good tutorial on how to use this package. Here's an easy tutorial from Dr. Dominic Royé. I use it every time I try to do something with OSM.
For instance, this tutorial has helped me to build a point-and-click Shiny game to learn street names in the city I'm living in. I've even put together a video to document how I extracted the map data I needed.
A map without extracting coordinates
You don't necessarily need to extract real coordinates from OSM to create a map. Some packages already contain all the information you need. For example, the {geofacet} package already contains the us_state_grid1 data set. This is the data set that Abdoul Madjid used to create the following map of the US.
The code of this map does not involve complicated sf objects (like with OSM data) and only uses rectangles. Hence, something like this can be pulled off even without much map making experience.
Recommended Resources
The {tigris} package is another package that contains map data. It's designed to help with analyzing US census data. And the best part? There is an accompanying book to the package.
Abdoul Madjid created another great map for the TidyTuesday challenge a while back. You can use the code to learn a thing or two about map making.
That's a wrap! As always, I'm happy to hear your feedback about this week's issue. Feel free to write me on Twitter or reply to this mail.
Enjoy the rest of your day!Albert
Did you like this post and want to support more content like this? Whenever you feel like it, you can support me with a coffee or a membership.
Reply