From ad382cf98a5548bb9e078358d1a762c2342396cc Mon Sep 17 00:00:00 2001 From: rhijmans Date: Sun, 8 Jan 2023 13:20:07 -0800 Subject: [PATCH] p --- NAMESPACE | 2 +- R/plot.R | 25 +++++++++++++++++++++++++ inst/colors/legends.rds | Bin 0 -> 7627 bytes inst/colors/palettes.rds | Bin 0 -> 5149 bytes man/mappal.Rd | 38 ++++++++++++++++++++++++++++++++++++++ src/write.cpp | 7 +++++-- 6 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 inst/colors/legends.rds create mode 100644 inst/colors/palettes.rds create mode 100644 man/mappal.Rd diff --git a/NAMESPACE b/NAMESPACE index 1df61a5f7..45d17578b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -18,5 +18,5 @@ S3method(str, SpatRaster) S3method(str, SpatExtent) S3method(str, SpatGraticule) -export(focalMat, gdal, getGDALconfig, graticule, setGDALconfig, north, sbar, terraOptions, tmpFiles, makeVRT, mem_info, free_RAM, shade, gdalCache, fileBlocksize, vector_layers) +export(focalMat, gdal, getGDALconfig, graticule, setGDALconfig, map.pal, north, sbar, terraOptions, tmpFiles, makeVRT, mem_info, free_RAM, shade, gdalCache, fileBlocksize, vector_layers) diff --git a/R/plot.R b/R/plot.R index f40fc6752..84a29cccc 100644 --- a/R/plot.R +++ b/R/plot.R @@ -307,3 +307,28 @@ shade <- function(slope, aspect, angle=45, direction=0, normalize=FALSE, filenam messages(slope, "shade") } + +map.pal <- function(name, n=50, ...) { + f <- system.file("colors/palettes.rds", package="terra") + v <- readRDS(f) + if (missing(name)) { + return(names(v)) + } + if (name %in% names(v)) { + r <- colorRampPalette(v[[name]], ...) + r(n) + } else { + error("map.pal", paste(name, "is not a known palette")) + } +} + +map.leg <- function(name) { + f <- system.file("colors/legends.rds", package="terra") + v <- readRDS(f) + if (name %in% names(v)) { + v[[name]] + } else { + error("map.leg", paste(name, "is not a known legend")) + } +} + diff --git a/inst/colors/legends.rds b/inst/colors/legends.rds new file mode 100644 index 0000000000000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a4D9(F|QVT8vZ*j(EqPa zfPZq>i|VOo&K+us4IdK6SHPJYHY7aC6d7+4VCC?*nAjMzcq)b`M4EF(gbwAxqlbn^ z#tCm~M#OO8rnrGaViLm5rBxmt9+eOoEg+ldu#frqzY{-}6&n*99~BxG8DmcQh2_n_ zu<&SeYih-E;X@*0Bjd=l^+YcRhJ{8(jS`~l#8D$+qT_~sjI3meiitJLxTYy4GHOIj tq$w_*GrzMjad9JrzpEAhJuo)vqhPAUg>zge&l)e>{{g{WR9E3w007y6FjN2l literal 0 HcmV?d00001 diff --git a/inst/colors/palettes.rds b/inst/colors/palettes.rds new file mode 100644 index 0000000000000000000000000000000000000000..49e829d82631d8f08380796df66e9f1caa6c6bce GIT binary patch literal 5149 zcmV+&6yob2iwFP!000002F2Y;k0m#92k;uLkOde9e4dlf2DmRruAjgLe65yh+6_o8 zp<9dfXH(gzm5e?Ich9r!{xhA-evb=E)sy+mXs z+WWmNUH^Xggr|Fx&T2eM&RV3mUg?{`Mr5=ZnQTR7+mXdiWo}ldk-7%Cxes>?@Z8j1f;P(XR9> z6MRR+f()@CeH=)a@Uqu7;gzFx!h1xGv|Kqg6&3K+raEqFXgH#jrp`Be*82Wqqq8;l zmW|Ke_?tOLbHCU0oX!1St8=yYd#%gex|=Bvn{HP6^6Sk}j2$m@rZ{(>Sh`YzyLZE- zlH9#1S4(mCrra#e-FK=trTcqR-k0g`P5D%{zc=M;wf^3eAJzMNQ$g1l?o9<(bGSDZ zVy)rcR4BEFdsCs;8SVp&s_A%dD%xh_y{QU~XCx_#@tshX#0P>T2I+I=rHHDil6 z?aZy*470ZT@@{#Kt{?ueqJ}#66ZrMVVv)U8`_qxa*Km*83}?%vI49g#rViM>P(}r& zGFrL6|JEmdX_L-$%<%cO`v@%BIefLib%#gzm%p#);eL~%+ERIe8q2khFdb=#MW9hl zye4rkIX9Qd1O)1m?JCE9obYe;YccrpgQ3k zDw}#DT`5@iaMG7;)scp1j&!O*y~XK?@yI~TM<&&5J2Df;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ASOvD$jTbm1b|umXq!u7dsN3m9MuDX#kwsvpZ&c!Pau`#e5{DKThY{%n zh7s@!-IxUWkwsR#%oyG10__+QrxIwU5vZrbo!p2kymMZ&v7Eqco>#>F;{NqVpF)A$ zA8c{IcjHGN+d`Jmj~D#rJ)r@G|-@PUSaEx=%JZO*GPmmDKSCw zmWVB7A`TsPQQ=C1!~xCuYqlix3=pxCfoP#e!cn^l7Y$At$2bxrF8rG`_P`JeuDF|Y zg`OXGEjl`o9r~1rI7yYhN1O?8eXY=(!?EOj{*JP7VD>IUA^_3N}Cv-oyl^yB*SUHhb!Ld*yZ7?e> z(gX)79->EHCBeeD5|>7?D&&;~2X0*h&S8-AX)s zDi^}axDpTlDpOXLmCNC$*j6rwALCfL9DYp8;fJJG8i799m2Ty7_%4N&%i&Xjv@);6 z0ltRrv6XElUhRgCXXRX&)k+Pwl~LJY8Ld`VoQ7&m#hInnRZJ{e zUvciJrJEZ945~pelW0rD)S;~vbA`57Ob*&fgsNO!Jq0&S9T+3Ix>bzRt*YY!ywwnK z3`rl*DN0qwFgVhKh?B1SgkF@Umd>kYh%lzY4+YIcs(cl!t97kO2@5>7KJbBjT@fK+ zZH9q0X1gas(m4?^={zj56LC`R!eIukU^)E2$4gODbzvE}=-732!(NR^#O&C>r%g>q zjYa76zWU!VO+&;vek0-vmYwJy_NS}OwFAhSQa=3Em-m~e_mI&n^bfT3DXhf@11fdB z4zFIX!+WpS`Ia9(`{dzjpa1^r&)+_N|MdRDUi|gLFTZ$v|Krm)KYh?=ufF;1-OJCf zUw;1l)ptMBTYtx=uYP-d|M>hTUw!lQyI&rE`uW|{hhKdC?VG>-?djdq+izap`PI{R zPxLo$et7%5-Pi9P-#@?l#p`!ZPj8>~8R@s@kAXe;@5ldn_5AxU-@K(yc>BZiYu`V< z{{Hd#wIAL+zJ2}j(O>-d-Q)ZF#dnWy-oE &vals, size_t startrow, size_t size_t nv = nrows * ncol() * nlyr(); if (vals.size() != nv) { - setError("incorrect number of values for writing"); + if (nv > vals.size()) { + setError("incorrect number of values (too many) for writing"); + } else { + setError("incorrect number of values (too few) for writing"); + } return false; } if (source[0].driver == "gdal") { #ifdef useGDAL - success = writeValuesGDAL(vals, startrow, nrows, 0, ncol()); #else setError("GDAL is not available");