-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
152 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
Package: spex | ||
Type: Package | ||
Title: Spatial Extent Tools | ||
Version: 0.6.0.9004 | ||
Authors@R: person("Michael D.","Sumner", role = c("aut", "cre"), email = | ||
"[email protected]") | ||
Description: Functions to produce a fully fledged 'geo-spatial' object extent as a | ||
'SpatialPolygonsDataFrame'. Also included are functions to generate polygons | ||
from raster data using 'quadmesh' techniques, a round number buffered extent, and | ||
general spatial-extent and 'raster-like' extent helpers missing from the originating | ||
packages. Some latitude-based tools for polar maps are included. | ||
License: GPL-3 | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Depends: R (>= 3.2.5) | ||
Imports: | ||
methods, | ||
quadmesh, | ||
raster, | ||
reproj, | ||
sp, | ||
stats, | ||
crsmeta | ||
RoxygenNote: 7.1.0 | ||
URL: https://mdsumner.github.io/spex/ | ||
BugReports: https://github.com/mdsumner/spex/issues | ||
Suggests: | ||
covr, | ||
testthat (>= 2.1.0) | ||
ByteCompile: TRUE | ||
Roxygen: list(markdown = TRUE) | ||
Remotes: hypertidy/reproj | ||
Package: spex | ||
Type: Package | ||
Title: Spatial Extent Tools | ||
Version: 0.6.0.9005 | ||
Authors@R: person("Michael D.","Sumner", role = c("aut", "cre"), email = | ||
"[email protected]") | ||
Description: Functions to produce a fully fledged 'geo-spatial' object extent as a | ||
'SpatialPolygonsDataFrame'. Also included are functions to generate polygons | ||
from raster data using 'quadmesh' techniques, a round number buffered extent, and | ||
general spatial-extent and 'raster-like' extent helpers missing from the originating | ||
packages. Some latitude-based tools for polar maps are included. | ||
License: GPL-3 | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Depends: R (>= 3.2.5) | ||
Imports: | ||
methods, | ||
quadmesh, | ||
raster, | ||
reproj, | ||
sp, | ||
stats, | ||
crsmeta | ||
RoxygenNote: 7.1.0 | ||
URL: https://mdsumner.github.io/spex/ | ||
BugReports: https://github.com/mdsumner/spex/issues | ||
Suggests: | ||
covr, | ||
testthat (>= 2.1.0) | ||
ByteCompile: TRUE | ||
Roxygen: list(markdown = TRUE) | ||
Remotes: hypertidy/reproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
S3method(as_double,Extent) | ||
S3method(polygonize,RasterBrick) | ||
S3method(polygonize,RasterLayer) | ||
S3method(polygonize,RasterStack) | ||
S3method(spex,default) | ||
S3method(spex,sf) | ||
S3method(spex,sfc) | ||
S3method(xlim,default) | ||
S3method(ylim,default) | ||
export(buffer_extent) | ||
export(latitudecircle) | ||
export(latmask) | ||
export(polygonize) | ||
export(qm_rasterToPolygons) | ||
export(qm_rasterToPolygons_sp) | ||
export(spex) | ||
export(xlim) | ||
export(ylim) | ||
importFrom(methods,as) | ||
importFrom(quadmesh,quadmesh) | ||
importFrom(raster,"projection<-") | ||
importFrom(raster,as.data.frame) | ||
importFrom(raster,extent) | ||
importFrom(raster,getValues) | ||
importFrom(raster,projection) | ||
importFrom(raster,xmax) | ||
importFrom(raster,xmin) | ||
importFrom(raster,ymax) | ||
importFrom(raster,ymin) | ||
importFrom(reproj,reproj) | ||
importFrom(sp,SpatialPolygonsDataFrame) | ||
importFrom(stats,setNames) | ||
# Generated by roxygen2: do not edit by hand | ||
S3method(as_double,Extent) | ||
S3method(polygonize,RasterBrick) | ||
S3method(polygonize,RasterLayer) | ||
S3method(polygonize,RasterStack) | ||
S3method(spex,default) | ||
S3method(spex,sf) | ||
S3method(spex,sfc) | ||
S3method(xlim,default) | ||
S3method(ylim,default) | ||
export(buffer_extent) | ||
export(latitudecircle) | ||
export(latmask) | ||
export(polygonize) | ||
export(qm_rasterToPolygons) | ||
export(qm_rasterToPolygons_sp) | ||
export(spex) | ||
export(xlim) | ||
export(ylim) | ||
importFrom(methods,as) | ||
importFrom(quadmesh,quadmesh) | ||
importFrom(raster,"projection<-") | ||
importFrom(raster,as.data.frame) | ||
importFrom(raster,extent) | ||
importFrom(raster,getValues) | ||
importFrom(raster,projection) | ||
importFrom(raster,xmax) | ||
importFrom(raster,xmin) | ||
importFrom(raster,ymax) | ||
importFrom(raster,ymin) | ||
importFrom(reproj,reproj) | ||
importFrom(sp,SpatialPolygonsDataFrame) | ||
importFrom(stats,setNames) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,54 @@ | ||
# spex dev | ||
|
||
* Added sfc method, and now using crsmeta. | ||
|
||
* Ensure projargs is character, not logical. | ||
|
||
# spex 0.6.0 | ||
|
||
* Wrap previous proj4 code with reproj, proj4 is no longer imported by spex. | ||
|
||
* Add new features for basic list, data frame or matrix input. | ||
|
||
* New `spex(clipboard = TRUE/FALSE)` argument to take advantage of leafem copy extent (WIP). | ||
|
||
|
||
# spex 0.5.0 | ||
|
||
* New latitude functions `latitudecircle` to build a polar circle. | ||
|
||
* Now return all cells as polygons if raster has no values. | ||
|
||
* Improved handling of `na.rm`, also now TRUE by default. #13 Thanks to Adriano Fantini. | ||
|
||
* A modest speed-up (up to 2X) for `polygonize` by more careful use of R. | ||
|
||
* better column name for resulting Spatial data frame | ||
|
||
# spex 0.4.0 | ||
|
||
* new functions `xlim` and `ylim`, supporting anything understandable by `spex` | ||
|
||
* new `extent` method for sf objects, otherwise missing in the core packages | ||
|
||
* new `spex` support for sf objects | ||
|
||
* `spex()` with no input argument will return the extents of the current par 'usr' setting (if only graphics devices had metadata registration for the space in use ...) | ||
|
||
* `polygonize`, `qm_rasterToPolygons`, and `qm_rasterToPolygons_sp` gain `na.rm` | ||
argument to optionally remove any cells that are `NA` (in the first layer) | ||
|
||
# spex 0.3.0 | ||
|
||
* new function `buffer_extent` for whole-grain expansion | ||
|
||
* added S3 generic `polygonize`, alias of `qm_rasterToPolygons` | ||
|
||
# spex 0.2.0 | ||
|
||
* Added function `qm_rasterToPolygons`. | ||
|
||
|
||
|
||
# spex dev | ||
|
||
* Fixed tests. | ||
|
||
* Added sfc method, and now using crsmeta. | ||
|
||
* Ensure projargs is character, not logical. | ||
|
||
# spex 0.6.0 | ||
|
||
* Wrap previous proj4 code with reproj, proj4 is no longer imported by spex. | ||
|
||
* Add new features for basic list, data frame or matrix input. | ||
|
||
* New `spex(clipboard = TRUE/FALSE)` argument to take advantage of leafem copy extent (WIP). | ||
|
||
|
||
# spex 0.5.0 | ||
|
||
* New latitude functions `latitudecircle` to build a polar circle. | ||
|
||
* Now return all cells as polygons if raster has no values. | ||
|
||
* Improved handling of `na.rm`, also now TRUE by default. #13 Thanks to Adriano Fantini. | ||
|
||
* A modest speed-up (up to 2X) for `polygonize` by more careful use of R. | ||
|
||
* better column name for resulting Spatial data frame | ||
|
||
# spex 0.4.0 | ||
|
||
* new functions `xlim` and `ylim`, supporting anything understandable by `spex` | ||
|
||
* new `extent` method for sf objects, otherwise missing in the core packages | ||
|
||
* new `spex` support for sf objects | ||
|
||
* `spex()` with no input argument will return the extents of the current par 'usr' setting (if only graphics devices had metadata registration for the space in use ...) | ||
|
||
* `polygonize`, `qm_rasterToPolygons`, and `qm_rasterToPolygons_sp` gain `na.rm` | ||
argument to optionally remove any cells that are `NA` (in the first layer) | ||
|
||
# spex 0.3.0 | ||
|
||
* new function `buffer_extent` for whole-grain expansion | ||
|
||
* added S3 generic `polygonize`, alias of `qm_rasterToPolygons` | ||
|
||
# spex 0.2.0 | ||
|
||
* Added function `qm_rasterToPolygons`. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
context("spex-extent") | ||
|
||
test_that("extent and crs works", { | ||
expect_that(spex(raster::extent(lux), raster::projection(lux)), is_a("SpatialPolygonsDataFrame")) | ||
expect_true(raster::projection(spex(raster::extent(lux), raster::projection(lux))) == raster::projection(lux)) | ||
}) | ||
|
||
|
||
test_that("by id is not implemented", { | ||
expect_that(spex(lux, byid = TRUE), throws_error("implemented")) | ||
}) | ||
|
||
|
||
|
||
test_that("extent of anything", { | ||
library(raster) | ||
expect_equal(raster::xmin(spex(psf, "+")), 0) | ||
expect_equal(raster::xmax(spex(psf, "+")), 1.23) | ||
expect_equal(raster::extent(spex()) , raster::extent(0, 1, 0, 1)) | ||
expect_equal(xlim(ice), c(-3950000, 3950000)) | ||
expect_equal(ylim(ice), c(-3950000, 4350000)) | ||
}) | ||
|
||
library(raster) | ||
r <- setExtent(raster(volcano), c(101, 102, -80, -30)) | ||
|
||
test_that("axis extents", { | ||
expect_equal(xlim(r), c(101, 102)) | ||
expect_equal(ylim(r), c(-80, -30)) | ||
}) | ||
context("spex-extent") | ||
|
||
test_that("extent and crs works", { | ||
expect_that(spex(raster::extent(lux), raster::projection(lux)), is_a("SpatialPolygonsDataFrame")) | ||
|
||
}) | ||
|
||
|
||
test_that("by id is not implemented", { | ||
expect_that(spex(lux, byid = TRUE), throws_error("implemented")) | ||
}) | ||
|
||
|
||
|
||
test_that("extent of anything", { | ||
library(raster) | ||
expect_equal(raster::xmin(spex(psf)), 0) | ||
expect_equal(raster::xmax(spex(psf)), 1.23) | ||
|
||
expect_equal(raster::extent(spex()) , raster::extent(0, 1, 0, 1)) | ||
|
||
expect_equal(xlim(ice), c(-3950000, 3950000)) | ||
expect_equal(ylim(ice), c(-3950000, 4350000)) | ||
}) | ||
|
||
library(raster) | ||
r <- setExtent(raster(volcano), c(101, 102, -80, -30)) | ||
|
||
test_that("axis extents", { | ||
expect_equal(xlim(r), c(101, 102)) | ||
expect_equal(ylim(r), c(-80, -30)) | ||
}) |