Skip to content

GSoC 2018 Geovisualization Module by Stefanie Lumnitz

Stefanie Lumnitz edited this page May 8, 2018 · 4 revisions

Sub-org name

Sub-organization: PySAL

Student info

University info

  • University Name: University of British Columbia (Canada)
  • Research interests: data science, remote sensing, environmental policy
  • Research project: Deep learning, google street view imagery and remote sensing for improved bio-surveillance in urban areas.
  • Degree: MSc. by Research

Code sample:

I have contributed to PySal viz module in the following pull requests:

Pull request #1022 showcases my Matplotlib experience.

Project info

Proposal Title: "PySAL - Geovisualization Package"

Proposal Abstract:

The goal of this project is to design and implement a visualization package in PySAL, the splot package. This will meet the growing demand for a simple to use, lightweight interface that connects PySAL to different popular visualization toolkits. The splot package will ultimately provide the users with both static plots ready for publication and interactive visualizations that allow for quick iteration and data exploration. In the first phase of this project, we will create different visualizations in both a static version with Matplotlib and an interactive version with Bokeh. Seconldy, we will create a common API for easy access to both versions. After adding documentation we will be able to provide a complete and user friendly package. Finally, we will explore how alternative visualization packages, like Vega, could be integrated into the splot package in future.

Proposal Description:

The goal of the splot package is to meet the growing demand for a simple to use, lightweight interface that connects PySAL to different popular visualization toolkits. The splot package will ultimately provide the users with both, static plots ready for publication and simple visualizations that allow for quick iteration over ideas to interactively explore data. For more detailed information about the possible design of sucha package, please visit the viz module website as an example: https://github.com/pysal/pysal/wiki/PySAL-Visualization-Project.

The splot package is structured into three levels with a high-level providing visualization functions for end users. Two lower layers which have been created already, are setting the basis for this project to design and implement new high-level functionality. So far the existing Moran plot (https://github.com/pysal/pysal/blob/master/pysal/contrib/viz/plot.py) provides a great example of how such functionality could look like. Initial work on LISA and choropleth maps has been started in the project but many functions remain to be coded. Besides refining existing plots, common views indicate that the Matplotlib interface needs to be extended by new maps (Join Count BW, regression maps), scatter plots (pairwise regression plots, ...) and many more visualizations.

Next to functional static plots the project will leverage more recent visualization technologies of the constantly evolving visualization space. This geovisualization project provides the scope to incorporate interactive visualizations developed within the splot package. It allows for exploration of potential new interfaces for alternative packages like Bokeh (plots with interactivity such as tooltips and zooming) and Folium (for plotting on top of web-sourced base layers, e.g. OpenStreetMap).

Additionally, we will refactor the package to ensure all functionality and documentation can be accessed in the splot namespace and work towards its inclusion into the PySAL user guide.

Schedule and Deliverables:

Project milestones are described next.

Prepare for the project and interact with mentors - Community bonding period

I will familiarize myself with the PySAL code base and overall structure to easily integrate work on the splot component in PySAL (e.g. developer guidelines: https://github.com/pysal/pysal/wiki). I will read relevant scientific literature about visualizations to be implemented during this GSoC (e.g. LISA plots, ...). Additionally, my main concern during the bonding period is to interact with my mentors and figure out small details about the features I intend to implement.

Phase I: Development of API for static and interactive functionality - 6 weeks

MILESTONE by end of week 6: Prototype examples of select scatterplots using Matplotlib for a static and Bokeh for an interactive visualization. Demonstrate functionality in Jupyter notebooks. Create common API for static and interactive plotting. Include examples in splot documentation.

  • week 1 & 2 - blueprint scatterplots: Improve existing static LISA map and Moran's I plot code in Matplotlib. Prototype interactive LISA map and Moran's I plot visualization in Bokeh. Create functionality that showcases LISA maps and Moran's I plots in one functionality which allows for taking PySAL's spatial analysis output as input.

  • week 3 - prototype common API: Start design of common API for both static and interactive visualizations, which will provide a blueprint for all other visualizations created at a later point in time. Therefore engage in discussions and consensus building with the whole development team. This will continue over the next weeks and will be finalized by the end of phase I. Prototype common API for both static and interactive visualization, e.g. a pattern to select geopandas columns and a plotting backend:

gdf = geopandas.read_file(filename)
mplot(gdf, values='vals', weights='w', 
      title='Interactive Moran's I plot',
      method='interactive')
  • week 4 & 5 - prototype scatterplots: Prototype different additional static and interactive scatterplots (e.g. Pairwise regression plots, observed vs. simulated envelopes ....) in Matplotlib and Bokeh that have already been identified as needed by the PySAL community.

  • week 6 - finalize API and documentation: Finalize common API blueprint and create API for all existing static and interactive plot pairs. Build the documentation for the splot package and a gallery of plots (using sphinx-gallery) in the html documentation.

Improve existing maps like choropleth visualizations. Prototype needed map visualizations in Matplotlib (e.g. LISA, Join Count (BW), Regression maps).

Phase II: Development of static and interactive map and other custom functionality - 4 weeks

MILESTONE by end of week 10: Prototype examples of select maps and other custom visualizations using Matplotlib for a static and Bokeh for an interactive visualization built in Jupyter. Include examples in PySAL documentation.

  • week 7 & 8 - maps: Improve existing static maps like choropleth visualizations. Prototype needed static map visualizations in Matplotlib (e.g. LISA, Join Count (BW), Regression maps) and interactive maps in Bokeh.

  • week 9 - custom visualizations: Prototype needed static and interactive custom visualizations (e.g. Rose diagram plotting the output of pysal.spatial_dynamics.directional.rose, Lorenz curve) in Matplotlib and Bokeh.

  • week 10 - integrate in splot package: Create API for new static and interactive visualization prototypes in splot package and update documentation.

Phase III: Exploration of potential interfaces for alternative packages - 2 weeks

Phase I and II have produced a complete and user friendly visualization package. In the last two weeks we explore how a Vega backend could be integrated into the splot package in the future. We do this using a single well understood map (choropleth).

MILESTONE by end of week 12: Vega implementation of chorophleth map and example in Jupyter of potential future API to call Vega implementation.

  • week 11 - create Vega choropleth example: Create a Vega implementation of the choropleth map.

  • week 12 - develop PySAL to Vega bridge: Develop a PySAL to Vega bridge in order to pass PySAL data to Vega for visualization. Finalize common API design for Vega implementation.

Other commitments

I plan to attend the SciPy conference from 11 to 15 of July.

Clone this wiki locally