{"id":16276275,"url":"https://github.com/robinlovelace/opengeohub2023","last_synced_at":"2025-03-20T01:32:00.208Z","repository":{"id":166277957,"uuid":"641678567","full_name":"Robinlovelace/opengeohub2023","owner":"Robinlovelace","description":"Content for lecture at OpenGeoHub 2023 on spatial data and the tidyverse","archived":false,"fork":false,"pushed_at":"2023-09-03T16:57:04.000Z","size":33357,"stargazers_count":18,"open_issues_count":6,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-06-11T16:09:53.662Z","etag":null,"topics":["course","data-science","opengeohub","osgeo","practical","r","reproducible","summer-school","tidy-data"],"latest_commit_sha":null,"homepage":"https://ogh23.robinlovelace.net/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robinlovelace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-17T00:15:01.000Z","updated_at":"2024-02-26T12:56:00.000Z","dependencies_parsed_at":"2023-12-01T07:43:47.761Z","dependency_job_id":null,"html_url":"https://github.com/Robinlovelace/opengeohub2023","commit_stats":{"total_commits":155,"total_committers":6,"mean_commits":"25.833333333333332","dds":0.04516129032258065,"last_synced_commit":"838b77110701696e1959da3850d58fe3327a74e1"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2Fopengeohub2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2Fopengeohub2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2Fopengeohub2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinlovelace%2Fopengeohub2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robinlovelace","download_url":"https://codeload.github.com/Robinlovelace/opengeohub2023/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219865984,"owners_count":16555922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["course","data-science","opengeohub","osgeo","practical","r","reproducible","summer-school","tidy-data"],"created_at":"2024-10-10T18:47:38.647Z","updated_at":"2024-10-10T18:47:39.298Z","avatar_url":"https://github.com/Robinlovelace.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenGeoHub Summer School 2023\n\n\u003cdiv\u003e\n\n[![](https://github.com/Robinlovelace/opengeohub2023/actions/workflows/publish.yml/badge.svg)](https://github.com/Robinlovelace/opengeohub2023/actions/workflows/publish.yml)\n\nQuarto Publish\n\n\u003c/div\u003e\n\nThis repo contains code to support sessions that I will deliver for the\nOpenGeoHub Summer School 2023.\n\nAs shown in the course\n[schedule](https://pretalx.earthmonitor.org/opengeohub-summer-school-2023/schedule/)\nI will deliver the following sessions:\n\n- [Tidy geographic data with sf, dplyr, ggplot2, geos and\n  friends](https://pretalx.earthmonitor.org/opengeohub-summer-school-2023/talk/7JN3FV/)\n  - 2023-08-28, 11:00–12:30, Room 21 (Sala 21)  \n- [Processing large OpenStreetMap datasets for\n  geocomputation](https://pretalx.earthmonitor.org/opengeohub-summer-school-2023/talk/SRMZVJ)\n  - 2023-09-01, 09:00–10:30, Room 18 (Sala 18)\n\nAbstracts for these sessions are provided below.\n\n## Reproducibility\n\nYou can reproduce all of the results and run all the code in this repo.\nThe quickest way to get started if you don’t already have the\ndependencies is with codespaces.\n\n\u003ca href='https://codespaces.new/Robinlovelace/opengeohub2023'\u003e\u003cimg src='https://github.com/codespaces/badge.svg' alt='Open in GitHub Codespaces' style='max-width: 100%;'\u003e\u003c/a\u003e\n\nIf it works you should see something like this:\n\n![](images/paste-11.png)\n\nTo run the code locally download the code, e.g. with the following\ncommand after installing GitHub’s CLI tool:\n\n``` bash\ngh repo clone Robinlovelace/opengeohub2023\n```\n\nThen open the project in RStudio, VS Code, and start looking at and\nrunning the code. You should be able to reproduce the rendered website\ninteractively with the following command:\n\n``` bash\nquarto preview\n```\n\nYou can also run the code in this repo in the Docker image hosted at\nhttps://github.com/Robinlovelace/opengeohub2023/pkgs/container/opengeohub2023\nas follows, with the -v flag to mount the current directory in the\ncontainer:\n\n``` bash\ndocker run -it -v $(pwd):/workspace opengeohub2023:latest\n```\n\nIf you have VS Code installed you should be able to ‘Reopen in\nContainer’ (not fully tested locally).\n\n## Tidy geographic data with sf, dplyr, ggplot2, geos and friends\n\n\u003c!-- ### Abstract --\u003e\n\nThis lecture will provide an introduction to working with geographic\ndata using R in a ‘tidy’ way. It will focus on using the `sf` package to\nread, write, manipulate, and plot geographic data in combination with\nthe `tidyverse` metapackage. Why use the `sf` package with the\n`tidyverse`? The lecture will outline some of the ideas underlying the\n`tidyverse` and how they can speed-up data analysis pipelines, while\nmaking data analysis code easier to read and write. We will see how the\nfollowing lines\n\n``` r\nlibrary(sf)\nlibrary(tidyverse)\n```\n\ncan provide a foundation on which the many geographic data analysis\nproblems can be solved. The lecture will also cover on more recently\ndeveloped packages that integrate with the `tidyverse` to a greater and\nlesser extent. We will look at how the `geos` package, which provides a\nsimple and high-performance interface to the GEOS library for performing\ngeometric operations on geographic data, integrates with the\n`tidyverse`. The `tidyverse` is not the right tool for every data\nanalysis task and we touch on alternatives for working with raster data,\nwith reference to the `terra` package, and alternative frameworks such\nas `data.table`. Finally, we will also look at how the ‘tidy’ philosophy\ncould be implemented in other programming languages, such as Python.\n\nThe focus throughout will be on practical skills and using packages\neffectively within the wider context of project management tools,\nintegrated development environments (we recommend VS Code with\nappropriate extensions or RStudio), and version control systems.\n\n## Processing large OpenStreetMap datasets for geocomputation\n\nOpenStreetMap (OSM) is a free and openly editable map of the world. Like\nWikipedia and unlike government or corperation maintained datasets, OSM\nis created and maintained by a community of volunteers, making it the\npremier decentralized and fastest evolving source of geographic vector\ndata focussed on features relevant to human activity (e.g. roads,\nbuildings, cafes) on planet Earth. Unlike Wikipedia, every data point in\nOSM has a geographic location and attributes must be structured as\nkey-value pairs. OSM is a rich source of data for geocomputation, but\nthe decentralized nature of the project and the sheer volume of data.\n‘Planet.osm’ now has more nodes than there are people on Earth, with\nmore than 8 billion [nodes](https://wiki.openstreetmap.org/wiki/Node),\nand the rate of data creation is increasing as the community grows, to\n[10 million users](https://wiki.openstreetmap.org/wiki/Stats) in early\n2023. The size and rapid evolution of OSM are great strengths,\ndemocratising geographic knowledge and ensuring resilience. However,\nthese features can make it difficult to work with OSM data.\n\nThis lecture will provide an introduction to working with OSM and will\ncover the following:\n\n- How and where to download OSM data\n- How to process small amounts of OSM data using the `osmdata` R package\n- How to process large OSM ‘extracts’ data with the `osmextract` R\n  package\n- Other command line tools for working with OSM data, including the\n  mature and widely used `osmium` tool, the `pyrosm` Python package and\n  the [`osm2streets`](https://github.com/a-b-street/osm2streets) web\n  application and Rust codebase\n\nFinally, the lecture will outline ideas for using OSM data. It will\nconclude with a call to action, inspiring the use of this rich resource\nto support policy objectives such as the fast and fair decarbonisation\nof the global economy as societies transition away from inefficient,\npolluting and costly fossil fuels.\n\n\u003c!-- ## Using geocomputation in government\n\u0026#10;TBC --\u003e\n\n## Reproducibility\n\nTo install the dependencies for this repo, run the following command:\n\n``` r\nremotes::install_github(\"robinlovelace/opengeohub2023\")\n```\n\nThis repo also uses the `renv` package to manage dependencies. We saved\nthe dependencies with the following command:\n\n``` r\nrenv::snapshot()\n```\n\nCode was generated from the `.qmd` files using the following commands:\n\n``` r\nf = c(\"tidy.qmd\", \"osm.qmd\")\nf_r = gsub(\".qmd\", \".R\", f)\nfor(i in seq_along(f)) {\n  knitr::purl(f[i], f_r[i])\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinlovelace%2Fopengeohub2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinlovelace%2Fopengeohub2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinlovelace%2Fopengeohub2023/lists"}