Skip to content

The study of skiing where we shred open data like pow. Quantifying alpine ski areas with geospatial metrics derived from OpenStreetMap.

License

Notifications You must be signed in to change notification settings

dhimmel/openskistats

Repository files navigation

OpenSkiStats: Shredding Data Like Powder

GitHub Actions CI Tests Status

Important

This project is currently under heavy development. Methods and results are still preliminary and subject to change.

This project generates statistics on downhill ski slopes and areas from around the globe powered by the underlying OpenSkiMap/OpenStreetMap data. The first application is the creation of roses showing the compass orientations of ski areas.

Development

The analyze workflow performs a complete installation of dependencies on Linux and runs the analysis. It serves as the reference for installing dependencies and executing the analysis, as well as the sole deployment route. For convenience, we provide some local development instructions below.

Installation

Installation and execution requires several system dependencies, whose installation and presence varies by platform. The following commands are one method of installation on macOS:

# install the fallback font if you don't have it
# otherwise openskistats visualize will warn:
# WARNING:matplotlib.font_manager:findfont: Font family 'Noto Sans CJK JP' not found.
brew install --cask font-noto-sans-cjk

For initial Python setup, first install pixi. Then run the following commands:

# install the pixi environment in pixi.lock
pixi install

# install the pre-commit git hooks
pre-commit install

Install the quarto extensions:

# install quarto story extension
(cd website/story && quarto add --no-prompt https://github.com/qmd-lab/closeread/archive/e3645070dd668004056ae508d2d25d05baca5ad1.zip)

Check that R is installed:

# Check that R is installed by running:
R --version

Renovate automates dependency updates and is configured in renovate.json5.

Execution

For commands that require access to the python environment, which includes those beginning with openskistats and quarto, you can activate the pixi environment any of the following ways:

  • configure your IDE to activate the venv automatically, e.g. via "Python: Select Interpreter" in Visual Studio Code.
  • prefix the command with pixi run, e.g. pixi run openskistats --help
  • activate the environment via pixi shell

To execute the Python analysis, run the following commands:

# download latest OpenSkiMap data
# run infrequently as we want to minimize stress on the OpenSkiMap servers
# downloads persist locally
openskistats download

# extract ski area metadata and metrics
openskistats analyze

openskistats visualize

# run python test suite
pytest

# run the full pre-commit suite
pre-commit run --all

To execute the R analysis, run the following command:

cd r
Rscript 01.data.R
Rscript 02.plot.R

To render the website, use either:

# using quarto preview to render and serve
quarto preview website

# render and serve to <http://localhost:8000> manually 
quarto render website
python -m http.server --directory=data/webapp

References

List of related webpages not yet mentioned in the manuscript:

Publicity & Users

Wild Ideas

  • Table of all OpenStreetMap users that have contributed to ski areas, i.e. top skiers
  • Max slope v difficulty by region
  • fix matplotlib super title spacing

Upstream issue tracking

License

The code in this repository is released under a BSD-2-Clause Plus Patent License.

This project is built on data from OpenSkiMap, which is based on OpenStreetMap. OpenStreetMap and OpenSkiMap data are released under the Open Data Commons Open Database License. Learn more at https://www.openstreetmap.org/copyright.