This article introduces the concept of spatial data visualization pipeline in R or Python. I have written various posts covering spatial data visualization for supply chain analysis and management, in both R and Python. Relevant libraries comprise e.g. Leaflet in Python, Leaflet in R, deckgl in R and ggmap in R. I have also demonstrated how one can create spatial data animations in R, using a framework build around ggmap and gganimate.
In this post I want to introduce some exemplary module-stacks, or pipelines, for implementing spatial data visualization in R or Python. As I have conducted most of my spatial data visualization using R I will put my focus on some of these packages. But Python offers just as many possibilities.
The core steps in any spatial data visualization and analysis project are to.
- read in the data
- clean, manipulate and arrange the data
- geocode the data to obtain latitude and longitude coordinates
- plot / visualize the data on a map
Below pipelines are just some examples for how one could implement above workflow.
Spatial data visualization pipeline in R: Geocode with tidygeocoder, visualize with folium
Another pipeline in R: Geocode with tidygeocoder, visualize with ggmap
Example in R: Geocode with osmdata, get a map from mapbox and plot with deckgl
Spatial data visualization pipeline example in Python: Geocoding with Geopy, plotting with Leaflet
Spatial data visualization pipeline for map-based GUIs, with shiny app development
As I have also introduced a coding example in R implementing the shiny package for spatial data visualization I want to conclude this post by suggesting a pipeline that embeds its visualization in shiny. Deckgl is a great package, but you could e.g. also use Leaflet – i.e. develop a leaflet shiny app.
I have written another post with an overview of specifically spatial data visualization packages in R. It can be found here.
Data scientist focusing on simulation, optimization and modeling in R, SQL, VBA and Python