Skip to content

Commit

Permalink
3.11.0-1093
Browse files Browse the repository at this point in the history
  • Loading branch information
nplatonov committed May 5, 2024
1 parent 31d398e commit 2381e8b
Show file tree
Hide file tree
Showing 97 changed files with 2,405 additions and 845 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^\.github$
^\.git$
^src/ursa.dll$
^src/ursa.o$
^.git.*$
1 change: 1 addition & 0 deletions .counter
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1094
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ursa
Type: Package
Title: Non-Interactive Spatial Tools for Raster Processing and Visualization
Version: 3.10.5
Version: 3.11.0-1093
Authors@R: person(given="Nikita",family="Platonov",role=c("aut","cre"),email="[email protected]",comment=c(ORCID="0000-0001-7196-7882"))
Author: Nikita Platonov [aut, cre] (<https://orcid.org/0000-0001-7196-7882>)
Maintainer: Nikita Platonov <[email protected]>
Expand All @@ -10,8 +10,8 @@ License: GPL (>= 2)
URL: https://github.com/nplatonov/ursa
BugReports: https://github.com/nplatonov/ursa/issues
Depends: R (>= 4.1.0)
Imports: utils, graphics, grDevices, stats, sf (>= 0.6-1), png
Suggests: jsonlite, raster, ncdf4, locfit, knitr, rmarkdown, tcltk, sp, methods, fasterize, IRdisplay, caTools, shiny, tools, jpeg, webp, htmlwidgets, htmltools, leaflet, leafem, leafpop, RColorBrewer, ragg, widgetframe, geojsonsf (>= 2.0.0), leaflet.providers, magick, terra, stars, vapour, gdalraster, sys, RSQLite, whitebox
Imports: utils, graphics, grDevices, stats, sf (>= 0.6-1)
Suggests: jsonlite, proj4, raster, ncdf4, locfit, knitr, rmarkdown, tcltk, sp, methods, fasterize, IRdisplay, caTools, shiny, tools, png, jpeg, webp, htmlwidgets, htmltools, leaflet, leafem, leafpop, RColorBrewer, ragg, widgetframe, geojsonsf (>= 2.0.0), leaflet.providers, magick, terra, stars, vapour, gdalraster, sys, RSQLite, whitebox
NeedsCompilation: yes
ByteCompile: no

5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export("read_envi")
export("read_gdal")
export("reclass")
export("regrid")
export("segmentize")
export("series")
export("session_bbox")
export("session_cellsize")
Expand All @@ -156,6 +155,7 @@ export("spatial_colnames")
export("spatial_colnames<-")
export("spatial_coordinates")
export("spatial_count")
export("spatial_crop")
export("spatial_crs")
export("spatial_crs<-")
export("spatial_data")
Expand Down Expand Up @@ -191,6 +191,7 @@ export("spatial_valid")
export("spatial_write")
export("temporal_interpolate")
export("temporal_mean")
export("trackline")
export("update_coastline")
export("ursa")
export("ursa_apply")
Expand Down Expand Up @@ -293,6 +294,7 @@ S3method("plot",ursaRaster)
S3method("print",ursaCategory)
S3method("print",ursaColorTable)
S3method("print",ursaConnection)
S3method("print",ursaCRS)
S3method("print",ursaGrid)
S3method("print",ursaNumeric)
S3method("print",ursaRaster)
Expand All @@ -302,6 +304,7 @@ S3method("seek",ursaConnection)
S3method("seq",ursaGrid)
S3method("seq",ursaRaster)
S3method("sort",ursaRaster)
S3method("str",ursaCRS)
S3method("str",ursaGrid)
S3method("str",ursaRaster)
S3method("summary",ursaCategory)
Expand Down
40 changes: 30 additions & 10 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
2024-01-12
2024-02-13

<!--
+ Depends on R (>= 4.1.0) instead of R (>= 3.0.0) due to using native pipes `|>` in code
+ Depends on R (>= 4.1.0) instead of R (>= 3.0.0) due to changed behaviour in `*apply()` functions with argument `simplify`
+ Ongoing...
-->

### Version 3.10.5
### Version 3.11.1

- ongoing…

- Package **`proj4`** is removed from ‘Suggests’.
- In function `colorize()` default value of argument `lazyload` is
changed from `FALSE` to `TRUE` to speed-up rendering large rasters.

- Plotting doesn’t affect sessional grid.

- Layout matrix can be specified directly (argument `layout` in
`compose_design()` and superior functions).

- Package start-up initializes `options(ursaProj4Legacy=TRUE)` to keep
using PROJ4, primarely, for printing. This initialization is skipped
if `ursaProj4Legacy` option was assigned before package loading.

- Package **`png`** is added to ‘Suggests’ (from ‘Imports’).

<!--
+ Package **`proj4`** is removed from 'Suggests'.
-->

### Version 3.11 (interim)

- MAJOR: WKT as well as PROJ4 is used for coordinate reference
systems.

### Version 3.10.4

Expand Down Expand Up @@ -65,7 +85,7 @@
- Package **`RSQLite`** is added as suggested for using map tiles from
specified directory of SAS Planet cache

- In `segmentize()` 1) improved response of `by` argument, 2) order of
- In `trackline()` 1) improved response of `by` argument, 2) order of
`type` argument is reversed to `c("united","conseqwent")`

- Coastline is updated to version 2023-08-24T03:31.
Expand Down Expand Up @@ -110,7 +130,7 @@
- New argunent `expand` in function `ursa_crop()` for spatial
expansion using relative value.

- New argument `by` in function `segmentize()` to split segments by
- New argument `by` in function `trackline()` to split segments by
specified field name.

- New function `spatial_levelsplit()` trasforms nested polygons (e.g.,
Expand Down Expand Up @@ -158,13 +178,13 @@

### Version 3.9.4

- Fixed example of `segmentize()` for non-Windows systems.
- Fixed example of `trackline()` for non-Windows systems.

### Version 3.9.3

- Test building for R 4.1.0.

- New function `segmentize()` to connect sequence of spatial points to
- New function `trackline()` to connect sequence of spatial points to
line segments.

- New return value `ursaLegend` in function `panel_plot()` for spatial
Expand All @@ -174,8 +194,8 @@
- New arguments `...` in function `session_grid()` for preliminary
passing to `regrid()`.

- New argument `connect` in function `segmentize()` for creating
either solid multi-segment or multiple consequent segments.
- New argument `connect` in function `trackline()` for creating either
solid multi-segment or multiple consequent segments.

- Patterned argument `vertical` in function `panel_annnotation()` can
be numeric (degrees on label inclination).
Expand Down
6 changes: 3 additions & 3 deletions R/Ops.local_group.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@
,x=as.numeric(x$value),bg=as.numeric(nodata)
,dim=as.integer(dimx),cover=as.numeric(cover)
,weight=weight,sum=as.integer(sum)
,res=numeric(dimx[1]*1L),NAOK=FALSE)
,res=numeric(dimx[1]*1L),NAOK=FALSE)$res
if (verbose)
.elapsedTime(paste(fun,"stop",sep=":"))
if (is.na(x$con$posR[1])) {
obj$value[] <- a$res
obj$value[] <- a
class(obj$value) <- "ursaNumeric"
}
else
{
obj$con$posR <- x$con$posR
obj$value <- a$res
obj$value <- a
dim(obj$value) <- c(dimx[1],1)
}
if (abs(nodata)<1)
Expand Down
16 changes: 1 addition & 15 deletions R/_RogerBivand.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
g1$crs <- attr(a,"projection")
if (is.na(g1$crs))
g1$crs <- ""
g1$crs <- .ursaCRS(g1$crs)
b1 <- .grep("band",attr(a,"mdata"),value=TRUE)
patt <- "^Band_(\\d+)=\\t*(.+)$"
bname <- .gsub(patt,"\\2",b1)
Expand Down Expand Up @@ -555,18 +556,3 @@
.DeadEnd()
rgeos::gIsValid(...)
}
'.proj4_requireNamespace' <- function(...) {
if (isTRUE(getOption("ursaPackageInUse")))
.Retired()
requireNamespace("proj4",quietly=.isPackageInUse())
}
'.proj4_project' <- function(...) {
if (isTRUE(getOption("ursaPackageInUse")))
.Retired()
proj4::project(...)
}
'.proj4_ptransform' <- function(...) {
if (isTRUE(getOption("ursaPackageInUse")))
.Retired()
proj4::ptransform(...)
}
25 changes: 16 additions & 9 deletions R/_rename20a660d5.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
src <- "\\$proj(4)*"
dst <- "$crs"
}
else if (stage2 <- F) {
src <- "crsstring"
dst <- "proj4string"
else if (stage2 <- T) {
src <- "sleeping\\("
dst <- "verbosing\\("
}
else if (stage3 <- F) {
src <- "proj4="
Expand All @@ -33,15 +33,21 @@
src <- "crs=="
dst <- "ZZZ=="
}
else if (stage6 <- T) {
src <- ".DeadRoad"
dst <- ".DeadEnd"
else if (stage6 <- F) {
if (step1 <- T) {
src <- "segmentize"
dst <- "trackline"
}
else {
src <- "st_trackline"
dst <- "st_segmentize"
}
}
else {
stop("please select stage")
}
toWrite <- FALSE
ind <- "1" # as.character(c(1,2,3,4,5,6,7,8,9,10,11,12))
ind <- 11 # as.character(c(1,2,3,4,5,6,7,8,9,10,11,12))
dpath1 <- c('1'="C:/platt/R/ursa-package/ursa/R"
,'2'="C:/platt/R/ursa-package/ursa/man"
,'3'="C:/platt/R/ursa-package/example"
Expand All @@ -53,8 +59,8 @@
,'8'="D:/DATA"
,'9'="D:/NRT"
,'10'="D:/update"
,'11'="D:/RAS/2020"
,'12'="D:/RAS/2019"
,'11'="D:/RAS/2024"
,'12'="D:/RAS/2023"
)
ind1 <- which(names(dpath1) %in% ind)
ind2 <- which(names(dpath2) %in% ind)
Expand Down Expand Up @@ -101,3 +107,4 @@ invisible({
rm(.a)
NULL
})
warnings()
35 changes: 32 additions & 3 deletions R/_ursa_install.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
list2 <- ls(envir=ns)
unloadNamespace(ns)
list2 <- grep("^[A-Za-z]",list2,value=TRUE)
list2 <- grep("\\.(ursa(Raster|Grid|ColorTable|Connection|Numeric|Category|Stack|ProgressBar))"
list2 <- grep("\\.(ursa(Raster|Grid|CRS|ColorTable|Connection|Numeric|Category|Stack|ProgressBar))"
,list2,value=TRUE,invert=TRUE)
list2 <- grep("^(as\\.Raster|djqwotrhfndh)\\.",list2,value=TRUE,invert=TRUE)
if (length(list3 <- grep("^C_.+",list2,value=TRUE,invert=FALSE))) {
Expand Down Expand Up @@ -115,6 +115,12 @@
}
'.buildAndInstall' <- function() {
wd <- setwd("C:/platt/R/ursa-package");on.exit(setwd(wd))
src <- "ursa/DESCRIPTION"
dst <- tempfile()
file.copy(src,dst)
wd2 <- setwd("news")
source("versionConsistence.R")
setwd(wd2)
if (requireNamespace("tools")) {
toWrite <- TRUE
md5fname <- "ursa/R/_md5"
Expand All @@ -132,17 +138,37 @@
if (toWrite)
write.table(new,md5fname,quote=FALSE
,col.names=FALSE,row.names=FALSE)
else
else {
cat("`ursa` is up-to-date\n")
file.rename(dst,src)
return(NULL)
}
}
if (requireNamespace("ursa"))
stopifnot(!.generate_namespace(verbose=FALSE))
patt <- "^ursa_.*(\\.tar\\.gz|\\.zip)$"
nul <- file.remove(dir(pattern=patt))
desc <- readLines(src)
pattV <- "^(Version:\\s*)(\\S+)\\s*$"
if (subVersion <- length(indC <- grep(pattV,desc))>0) {
cfile <- "ursa/.counter"
ver <- unlist(package_version(gsub(pattV,"\\2",desc[indC])))
if (length(ver)==3)
ver[3] <- ver[3]-1
ver <- paste(ver[1:3],collapse=".")
counter <- as.integer(readLines(cfile))
desc[indC] <- gsub(pattV,sprintf("\\1%s-%04d",ver,counter),desc[indC])
print(desc[indC],quote=FALSE)
writeLines(desc,src)
}
system("R --vanilla CMD build ursa")
# if (file.exists(dst))
# file.rename(dst,src)
pkg <- tail(dir(pattern=patt))
if (length(pkg)!=1)
return(NULL)
# if (length(indC))
# writeLines(sprintf("%04d",counter+1L),cfile)
opt1 <- "--fake" ## --no-multiarch
opt2 <- "--no-html"
opt3 <- "--no-html --build"
Expand All @@ -169,8 +195,11 @@
else {
Sys.setenv(R_LIBS_USER=.libPaths()[1])
# Sys.setenv(BINPREF=Sys.getenv("R_BINPREF"))
system2("R",c("--vanilla","CMD","INSTALL",opt3,pkg)[-1])
ret <- system2("R",c("--vanilla","CMD","INSTALL",opt3,pkg)[-1])
# system(paste("R","--vanilla","CMD","INSTALL",opt2,pkg))
if ((!ret)&&(subVersion)) {
writeLines(sprintf("%04d",counter+1L),cfile)
}
}
# file.remove(pkg)
NULL
Expand Down
8 changes: 4 additions & 4 deletions R/allocate.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
colnames(vec) <- c("x","y")
ind <- .grep("^(lon|lat)",mname)
if ((length(ind)==2)&&(is.null(proj4)))
proj4 <- paste("+proj=longlat +datum=WGS84 +no_defs")
proj4 <- paste(.crsWGS84())
}
if (is.null(proj4))
proj4 <- ""
Expand All @@ -121,8 +121,6 @@
z[,i] <- as.numeric(val)-1
}
}
if (is.na(nodata))
nodata <- .optimal.nodata(z)
if (!.is.grid((getOption("ursaSessionGrid")))) {
x <- sort(unique(vec$x))
y <- sort(unique(vec$y))
Expand Down Expand Up @@ -203,7 +201,7 @@
}
if (onlyGrid)
return(session_grid())
res <- ursa_new(bandname=lname,ignorevalue=nodata)
res <- ursa_new(bandname=lname) ## --20240217, skip ignorevalue<-
z <- as.matrix(z)
z[is.na(z)] <- nodata
g1 <- res$grid
Expand All @@ -212,6 +210,8 @@
dimy <- with(res$grid,c(columns,rows,nb))
if (verbose)
.elapsedTime(paste0(fun,":start"))
if (is.na(nodata))
nodata <- .optimal.nodata(z)
res$value <- .Cursa(C_rasterize,dat=numeric(prod(dimy)),dim=as.integer(dimy)
,bbox=as.numeric(with(g1,c(minx,miny,maxx,maxy)))
,x=as.numeric(vec$x),y=as.numeric(vec$y),value=as.numeric(z)
Expand Down
Loading

0 comments on commit 2381e8b

Please sign in to comment.