Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/dev-sf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:

steps:
- name: Checkout Project
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Build book
run: |
Rscript -e 'install.packages("geocompkg", repos = c("https://geocompr.r-universe.dev", "https://cloud.r-project.org"), dependencies = TRUE, force = TRUE)'
Rscript -e 'remotes::install_github("r-spatial/sf")'
Rscript -e 'remotes::install_github("r-spatial/stars")'
Rscript -e 'remotes::install_github("rspatial/terra")'
Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) install.packages("pak", repos = "https://cloud.r-project.org"); pak::pak("r-spatial/sf")'
Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) install.packages("pak", repos = "https://cloud.r-project.org"); pak::pak("r-spatial/stars")'
Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) install.packages("pak", repos = "https://cloud.r-project.org"); pak::pak("rspatial/terra")'
#Rscript -e 'remotes::install_github("geocompx/geocompkg", dependencies = TRUE, force = TRUE)'
Rscript -e 'bookdown::render_book("index.Rmd")'
18 changes: 18 additions & 0 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Scheduled
on:
schedule:
- cron: '0 6 * * 1' # every Monday at 06:00 UTC
workflow_dispatch:
jobs:
bookdown:
name: Render-Book
runs-on: ubuntu-latest
permissions:
contents: read
container: ghcr.io/geocompx/suggests:latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Render Book
run: Rscript -e 'bookdown::render_book("index.Rmd")'
7 changes: 3 additions & 4 deletions 08-read-write-plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,12 @@ multilayer_rast = rast(multilayer_filepath)
All of the previous examples read spatial information from files stored on your hard drive.
However, GDAL also allows reading data directly from online resources, such as HTTP/HTTPS/FTP web resources.
The only thing we need to do is to add a `/vsicurl/` prefix before the path to the file.
Let's try it by connecting to the global monthly snow probability at 500-m resolution for the period 2000-2012.
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).
Let's try it by connecting to a remote GeoTIFF hosted by [OSGeo](https://download.osgeo.org/geotiff/samples/usgs/o41078a5.tif).
This sample file is available online as a GeoTIFF (see Section \@ref(file-formats)).
Comment thread
Robinlovelace marked this conversation as resolved.
Outdated
To read an online file, we just need to provide its URL together with the `/vsicurl/` prefix.

```{r, linewidth=80}
myurl = paste0("/vsicurl/https://zenodo.org/record/5774954/files/",
"clm_snow.prob_esacci.dec_p.90_500m_s0..0cm_2000..2012_v2.0.tif")
myurl = "/vsicurl/https://download.osgeo.org/geotiff/samples/usgs/o41078a5.tif"
Comment thread
Robinlovelace marked this conversation as resolved.
Outdated
snow = rast(myurl)
snow
```
Expand Down
Loading