Skip to content

Commit

Permalink
Use new example for FAQs
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Apr 22, 2024
1 parent 233bcef commit ddad548
Show file tree
Hide file tree
Showing 20 changed files with 124 additions and 149 deletions.
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"SystemRequirements": null
},
"keywords": ["r", "terra", "ggplot-extension", "r-spatial", "rspatial", "r-package", "rstats", "rstats-package", "cran", "cran-r"],
"fileSize": "2289.35KB",
"fileSize": "2289.359KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
1 change: 1 addition & 0 deletions data-raw/dems/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NT27SE_50CM_DSM_PHASE5.tif
38 changes: 38 additions & 0 deletions data-raw/holyroodpark.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## code to prepare `holyroodpark` dataset goes here

# Data from https://remotesensingdata.gov.scot/
# Scotland Lidar Phase 5 DSM NT27SE
# License: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/


library(terra)
r <- rast("data-raw/dems/NT27SE_50CM_DSM_PHASE5.tif")

# Cut to fit Holyrood Park
hopark <- rast()

ext(hopark) <- c(-3.178208, -3.142817, 55.939184, 55.95418)

hopark <- project(hopark, terra::crs(r))
res(hopark) <- c(2.5, 2.5)

final_rast <- terra::project(r, hopark)
ncell(final_rast)
names(final_rast) <- "elevation"
plot(final_rast)
# Extra clip
xa <- 1000
xb <- 200
ya <- 300
yb <- 300
f2 <- as.vector(ext(final_rast))
f2_x <- f2 - c(xa, xb, ya, yb)

xtraclip <- crop(final_rast, ext(f2_x))
plot(xtraclip)
ncell(xtraclip)

unlink("data-raw/holyroodpark.tif")
unlink("vignettes/articles/holyroodpark.tif")
writeRaster(final_rast, "data-raw/holyroodpark.tif")
writeRaster(final_rast, "vignettes/articles/holyroodpark.tif")
Binary file added data-raw/holyroodpark.tif
Binary file not shown.
4 changes: 3 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ CodeFactor
Colorimetric
Coords
DOI
DSM
EPSG
Hijmans
Holyrood
Hypsometric
ISSN
JOSS
LiDAR
Licence
Maungawhau
NZGD
ORCID
Expand Down Expand Up @@ -45,7 +48,6 @@ coord
cpt
crs
de
dev
disaggregated
doi
downsampled
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<PAMRasterBand band="1">
<Description>red</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">7</MDI>
<MDI key="STATISTICS_MINIMUM">13</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="2">
<Description>green</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">7</MDI>
<MDI key="STATISTICS_MINIMUM">63</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="3">
<Description>blue</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">6</MDI>
<MDI key="STATISTICS_MINIMUM">22</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<PAMRasterBand band="1">
<Description>red</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">18</MDI>
<MDI key="STATISTICS_MINIMUM">13</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="2">
<Description>green</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">18</MDI>
<MDI key="STATISTICS_MINIMUM">63</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="3">
<Description>blue</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">7</MDI>
<MDI key="STATISTICS_MINIMUM">22</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit ddad548

Please sign in to comment.