Giter Club home page Giter Club logo

r-geospatial-urban's Introduction

Geospatial Data Carpentry for Urbanism

Lesson Description

This lesson is an introduction to working with raster and vector data in R for researchers in urbanism or related fields. After a brief introduction to R, it focuses on vector and raster data and their use in practical GIS operations on urban datasets.

Rendered Version of This Lesson

Version 1.0

Contact Information

Rbanism Community

Contributing Information

Please see the CONTRIBUTING page for guidance on how to contribute to this lesson.

Credits / Acknowledgements

This lesson was developed by:

Large parts of the lesson were adapted from:

  • Jemma Stachelek, Serah Njambi, Mike Mahoney, sheila, Andrea T. Thomaz, Annajiat Alim Rasel, David Pérez-Suárez, Erika Koontz, Joe Molloy, Jon Jablonski, Juan Fung, Katrin Leinweber, Matthew Sisk, Richard Detomasi, Sarah LR Stevens, Shamar Stewart, Susan Chen, & Wartini Ng. (2023). datacarpentry/r-intro-geospatial: Introduction to R for Geospatial Data 2023-05 (2023.05). Zenodo. https://doi.org/10.5281/zenodo.7897052

  • Jemma Stachelek, & Kunal Marwaha. (2023). datacarpentry/organization-geospatial: Data Carpentry: Introduction to Geospatial Concepts 2023-05 (2023.05). Zenodo. https://doi.org/10.5281/zenodo.7897047

  • Jemma Stachelek, Erin Alison Becker, Drake Asberry, Matt Strimas-Mackey, Annajiat Alim Rasel, Angela Li, Ryan Avery, kcarini, Kunal Marwaha, mneilson-usgs, Adam H. Sparks, bart1, Christian Boldsen Knudsen, Daniel Kerchner, Darya P Vanichkina, Pérez-Suárez, Jon Jablonski, Michael Liou, Natalia Morandeira, & Rob Williams. (2023). datacarpentry/r-raster-vector-geospatial: Data Carpentry: Introduction to Geospatial Raster and Vector Data with R, February 2023 (v2023.02.06). Zenodo. https://doi.org/10.5281/zenodo.7612769

Citation

Please see the CITATION page for guidance on how to cite this lesson.

License

The Geospatial Data Carpentry for Urbanism lesson, like most other software provided by The Carpentries, are made available under the OSI-approved MIT license. Please see the LICENSE page for further information.

Rendered Version of This Lesson

https://carpentries-incubator.github.io/r-geospatial-urban/

r-geospatial-urban's People

Contributors

cforgaci avatar manugil avatar tobyhodges avatar alwil avatar zbraiterman avatar selkubi avatar

Stargazers

 avatar  avatar

Watchers

Ana Petrović avatar  avatar Clementine Cottineau-Mugadza avatar  avatar  avatar

r-geospatial-urban's Issues

Remove data from workshop repository

We should consider to store the data files outside the repo if they are not necessary for rendering the workshop documentation. Data files might, with the time, make the size of the repo very big and cloning it will be come slow.

Originally posted by @manuGil in #1 (comment)

Thanks @manuGil for pointing this out. I opened an issue for this.

Update lessons

  • Instructors update the four lessons in PRs according to the feedback before the end of March mid-May
    • Part 1 - intro to R
    • Part 2 - vector data
    • Part 3 - raster data
    • Part 4 - OSM & GIS
  • The team reviews the updates (reviewers assigned in the PRs) before mid-April end of May

Create a workshop cheatsheet

The cheatsheet will be a handout with all functions, terms, and guidelines that participants can refer back to during the workshop. It should be concise, comprehensive and clear. We can use visuals as in package cheatsheets (see sf cheatsheet for instance).

Let's keep this issue open to collect ideas while working on the cheatsheet.

Intro episodes not compiling on macOS

I am documenting here an issue I came across while trying to build the intro lesson. The build process would throw an error when trying to install the required Matrix package. The error is in the log shown in the Build panel. While searching for a solution, I learned that this is an issue on macOS with Apple M1 processors, so people working on Windows or Intel-based macs might not experience it.

The solution, as described here:

  1. Create a file ~/.R/Makevars (if it does not exist yet)

  2. Add the following to ~/.R/Makevars

FC      = usr/local/opt/gcc/bin/gfortran
F77     = /usr/local/opt/gcc/bin/gfortran
FLIBS   = -L/usr/local/opt/gcc/lib
  1. Restart R

  2. The installation of the package should not be an issue during the build process anymore. You can also try to install the failing package (in my case Matrix) manually from source by calling install.packages("Matrix", type = "source")

Check code style and consistency

  • all code used in the lesson should follow the tidyverse style guide
  • we should agree on a pipe operator (native or magrittr) and use it consistently throughout the lesson

Checks to be made across lessons

I started collecting feedback from lesson-level PRs that apply across lessons in the form of a checklist:

  • #9

    • Lesson 1
    • Lesson 2
    • Lesson 3
    • Lesson 4
  • questions are written in first person

  • the same phrasing is used for objectives

  • #10

  • harmonise naming of exercises/challenges and precede all challange callout headings with Challenge:

    • Lesson 1
    • Lesson 2
    • Lesson 3
    • Lesson 4

Good to have, but not essential:

  • all code chunks should have a unique name (unnamed chunks are auto-named by default)
    • Lesson 1
    • Lesson 2
    • Lesson 3
    • Lesson 4

GIS resources

          > Should we add GIS resources here or in the pre-workshop email?

I suggest we include resources in the lesson websites and maybe collect and share them at the end of the workshop. I open an issue on this.

Originally posted by @cforgaci in #1 (comment)

Update CHM figure

I made a figure illustrating the digital height canopy model. I thinks this illustrates it in a slightly better way. What do you think? How can I improve on it?

chm

Originally posted by @manuGil in #3 (comment)

Update setup instructions

Update setup instructions according to the feedback received and issues observed during the workshop:

  • Installation information is shown both in the table at the top of the setup page and in the callout blocks further down on the page. To avoid confusion, remove the table and make sure installation instructions are easily found in one place.
  • Specify versions of all software to be installed as well as system requirements (e.g., minimum OS versions)
  • Test new setup instructions on macOS, Windows and Linux
  • Consider also #11

Wrong name for installing GDAL on MacOS

While following the instruction to install depentences here:https://carpentries-incubator.github.io/r-geospatial-urban/

The following error occurs int he last installation call using brew: (MacOS Sonoma)

$ brew install gdal2
Warning: Formula gdal2 was renamed to osgeo/osgeo4mac/osgeo-gdal.
Warning: Formula gdal2 was renamed to osgeo/osgeo4mac/osgeo-gdal.
Error: osgeo/osgeo4mac/osgeo-gdal: Invalid bottle tag symbol

The following worked. There is a typo on the name of the formula
$ brew install gdal

Rendering headings that include a code block

I noticed that some headings do not render well when they include a code bloke.
For example, the following Rmarkdown snipped produces a heading without white spaces between sf and adjacent words:

# The `sf` package

`sf` stands for Simple Features which is a standard defined by the Open Geospatial Consortium for storing and 
accessing geospatial vector data. PostGIS uses the same standard; so those of you who used PostGIS, might
find some resemblances with the functions used by the `sf` package. 

Results:
Screenshot 2024-01-08 at 19 18 21

The core of the issue is that the Rmarkdown parser removes any white spaces at the beginning and end of a string surrounded by backticks (`). Explained here

I tried several ways to trick the parser, but they did not work. Notice this only affects the headings and not the paragraph below the heading. This might be because headings and paragraphs have different styles.

I suggest we avoid using code blocks in the headings so that white spaces are rendered properly. For example, using # The 'sf' Package instead. Note that this will rendered the heading using uppercase (that's define by the style template), but it will maintain the white spaces.

Website build fails

@tobyhodges, while populating the repository with our updated lessons, I am experiencing issues with building the workshop website at the Setup Package Cache step.

I am pasting in the last lines of output from that step:

  - Downloading mgcv from CRAN ...                OK [file is up to date]
  - Downloading nlme from CRAN ...                OK [file is up to date]
  - Downloading DBI from CRAN ...                 OK [file is up to date]
  - Downloading MASS from CRAN ...                	ERROR [curl: (22) The requested URL returned error: 404]
  ---
  Standard error:
  → Searching for and installing available dependencies
  → Restoring any dependency versions
  ---
  Backtrace:
  1. base::tryCatch(sandpaper::manage_deps(path = wd, quiet = FALSE), error = functio…
  2. base::tryCatchList(expr, classes, parentenv, handlers)
  3. base::tryCatchOne(expr, names, parentenv, handlers[[1L]])
  4. global value[[3L]](cond)
  5. sandpaper::manage_deps(path = wd, quiet = FALSE)
  6. callr::r(func = callr_manage_deps, args = args, show = !quiet, …
  7. callr:::get_result(output = out, options)
  8. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))
  ---
  Subprocess backtrace:
   1. renv::restore(project = path, library = renv_lib, lockfile = renv_lock, …
   2. renv:::renv_restore_run_actions(project, diff, current, lockfile, rebuild)
   3. renv:::retrieve(packages)
   4. local handler(package, renv_retrieve_impl(package))
   5. renv:::renv_retrieve_impl(package)
   6. renv:::renv_retrieve_repos(record)
   7. (function() { …
   8. base::warning(error)
   9. base::withRestarts({ …
  10. base::withOneRestart(expr, restarts[[1L]])
  11. base::doWithOneRestart(return(expr), restart)
  12. global (function (e) …
  Execution halted
  Error: Process completed with exit code 1.

I did notice a failed check while merging the lesson PR, but I thought I could solve it afterwards. The same failed check is visible in the PR of another lesson.

You should also be able to see the output of the workflow directly: https://github.com/carpentries-incubator/r-geospatial-urban/actions/runs/7695754050

What can I do to make this check pass? Thanks in advance and please let me know if I can provide more info!

Add slides to part 1

@KyriJanssen, @fcjerome, can you add your workshop slides in instructors\4-gis-slides.qmd, please? If you do not have your slides in quarto you can do this by creating a new quarto file, pasting in the content of my slides and then adapting it with your content. Let me know if you need help with this.

Originally posted by @cforgaci in #5 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.