Skip to content

Commit 734d547

Browse files
Merge pull request #1180 from geocompx/copilot/trigger-github-workflow-re-run
Add scheduled workflow to detect upstream failures; set weekly cadence
2 parents 2cb2a1a + c862f69 commit 734d547

3 files changed

Lines changed: 24 additions & 7 deletions

File tree

.github/workflows/dev-sf.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ jobs:
1515

1616
steps:
1717
- name: Checkout Project
18-
uses: actions/checkout@v1
18+
uses: actions/checkout@v4
1919

2020
- name: Build book
2121
run: |
2222
Rscript -e 'install.packages("geocompkg", repos = c("https://geocompr.r-universe.dev", "https://cloud.r-project.org"), dependencies = TRUE, force = TRUE)'
23-
Rscript -e 'remotes::install_github("r-spatial/sf")'
24-
Rscript -e 'remotes::install_github("r-spatial/stars")'
25-
Rscript -e 'remotes::install_github("rspatial/terra")'
26-
#Rscript -e 'remotes::install_github("geocompx/geocompkg", dependencies = TRUE, force = TRUE)'
23+
Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) install.packages("pak", repos = "https://cloud.r-project.org")'
24+
Rscript -e 'pak::pak(c("r-spatial/sf", "r-spatial/stars", "rspatial/terra"))'
2725
Rscript -e 'bookdown::render_book("index.Rmd")'

.github/workflows/scheduled.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Scheduled
2+
on:
3+
schedule:
4+
- cron: '0 6 * * 1' # every Monday at 06:00 UTC
5+
workflow_dispatch:
6+
jobs:
7+
bookdown:
8+
name: Render-Book
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
container: ghcr.io/geocompx/suggests:latest
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Render Book
18+
run: Rscript -e 'bookdown::render_book("index.Rmd")'

08-read-write-plot.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ multilayer_rast = rast(multilayer_filepath)
292292
All of the previous examples read spatial information from files stored on your hard drive.
293293
However, GDAL also allows reading data directly from online resources, such as HTTP/HTTPS/FTP web resources.
294294
The only thing we need to do is to add a `/vsicurl/` prefix before the path to the file.
295+
This tells GDAL to use its virtual file system for network resources, which uses **HTTP Range requests** to fetch only the specific byte ranges needed for an operation rather than downloading the entire file.
295296
Let's try it by connecting to the global monthly snow probability at 500-m resolution for the period 2000-2012.
296297
Snow probability for December is stored as a Cloud Optimized GeoTIFF (COG) file (see Section \@ref(file-formats)) at [zenodo.org](https://zenodo.org/record/5774954/files/clm_snow.prob_esacci.dec_p.90_500m_s0..0cm_2000..2012_v2.0.tif).
297298
To read an online file, we just need to provide its URL together with the `/vsicurl/` prefix.
@@ -304,8 +305,8 @@ snow
304305
```
305306

306307
\index{COG}
307-
Due to the fact that the input data is COG, we are actually not reading this file to our RAM, but rather creating a connection to it without obtaining any values.
308-
Its values will be read if we apply any value-based operation (e.g., `crop()` or `extract()`).
308+
When combined with the `/vsicurl/` prefix, COG files enable highly efficient remote data access.
309+
Instead of reading the whole file into RAM, GDAL creates a connection that **selectively fetches** only the byte ranges needed for subsequent operations (e.g., `crop()` or `extract()`), making it possible to work with multi-gigabyte files over the internet almost as if they were local.
309310
This allows us also to just read a tiny portion of the data without downloading the entire file.
310311
For example, we can get the snow probability for December in Reykjavik (70%) by specifying its coordinates and applying the `extract()` function:
311312

0 commit comments

Comments
 (0)