shamiv / dmi2022

Notes and code from Digital Methods Initiative Summer school 2022

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Digital Methods Initiative Summer School 2022

Intro

  • This project was part of the DMI that took place in the summer of 2022 in Amsterdam (link).
  • Our sub-group focused on the way Sea level rise is represented on Instagram.
  • This was the raw data we worked with.
  • My contribution consisted of geoparsing the data with Mordecai and creating interactive maps with the Python API of Kepler.gl.
  • I was also involved in some cross-platform analysis (with the groups studying Twitter and TikTok).

Results

  • Map1: Showing the locations mentioned in Instagram posts that mention (words very similar to) “sealevelrise” for the years 2012-2022. (Open the legend by clicking the legend-button on the right, third from the top).
  • Map2: Comparing the locations mentioned in posts/tweets that mention (words very similar to) “sealevelrise” on TikTok (2022, until week 27), Instagram (2022, until week 27), Twitter (2021). (Open the legend by clicking the legend-button on the right, third from the top)

Some hard-earned lessons

Mordecai

  • You have to have run Python 3.7. (I had to run a virtual environment).
  • You have to run the docker run command (see Mordecai) from the right directory.
  • Because the loading of the geoparser from Mordecai, and the set-up of the Geoparser() take quite some time, it might be useful to debug in ipython (or something like that), in which you can load those elements, and tinker with the code separately.

Kepler.gl Python API

  • Although it’s not that hard to create a Kepler map, it has been quite a challenge to find a way to adjust what the map displays by default (the config).
  • The documentation of the config settings in Python are (as far as I know) very (frustratingly) limited.
  • Instead, what I did, was run the Python API in a Jupyter notebook (Jupyter Lab) (see here). That way you can build the map, customize it manually and then export it as html (or print the config, which you can use to export that map (including customization) outside the Jupyter notebook).

Host the Kepler map on Github

  • Hosting the map on Gitlab turned out to be quite difficult. Which is why I ended up using Gitlab pages (settings -> Pages).
  • N.b. it takes a while before a map is online.

N.B.

  • The scripts in the folder “scripts” are not cleaned up nor meant to be used directly by anyone. They are the dirty remnants of the stuff that worked, but could be written much more efficiently/elegantly).

About

Notes and code from Digital Methods Initiative Summer school 2022


Languages

Language:HTML 99.9%Language:Python 0.1%