Skip to content

Commit

Permalink
terrainr 0.3.0
Browse files Browse the repository at this point in the history
The Big Merge
  • Loading branch information
mikemahoney218 authored Feb 17, 2021
2 parents 91a73a4 + 5ccb24b commit 753a265
Show file tree
Hide file tree
Showing 95 changed files with 2,163 additions and 1,644 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/run-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
branches:
- '*'
- '!gh-pages'

name: run-examples

jobs:
run-examples:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_cran("devtools")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: devtools::run_examples(run_dontrun = TRUE, run_donttest = TRUE)
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
1 change: 1 addition & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclusions: list("R/geom_spatial_rgb.R")
24 changes: 12 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Package: terrainr
Type: Package
Title: Retrieve Data from the 'USGS' National Map and Transform it for '3D' Landscape Visualizations
Version: 0.2.1
Title: Landscape Visualizations in R and Unity
Version: 0.3.0
Authors@R:
person(given = "Michael",
family = "Mahoney",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-2402-304X"))
Description: Functions for the retrieval and manipulation of 'USGS' National Map
data ('<https://viewer.nationalmap.gov/services/>'), enabling users to
download elevation and image data for areas of interest. Functions are also
provided to transform these data sources into formats that can be used to
create 3D elevation models in the Unity rendering engine.
Description: Functions for the retrieval, manipulation, and visualization of
geospatial data, with an aim towards producing '3D' landscape visualizations
in the Unity '3D' rendering engine. Functions are also provided for
retrieving elevation data and base map tiles from the 'USGS' National Map
('<https://viewer.nationalmap.gov/services/>').
URL: https://mikemahoney218.github.io/terrainr/, https://github.com/mikemahoney218/terrainr
BugReports: https://github.com/mikemahoney218/terrainr/issues
License: MIT + file LICENSE
Expand All @@ -26,10 +26,10 @@ Imports:
gdalUtils,
methods,
png,
utils,
gdalUtilities,
sf,
rlang
units,
grDevices,
ggplot2
RoxygenNote: 7.1.1
Suggests:
testthat,
Expand All @@ -38,9 +38,9 @@ Suggests:
knitr,
rmarkdown,
progress,
ggplot2,
jpeg,
tiff
tiff,
brio
Config/testthat/parallel: true
Config/testthat/edition: 3
VignetteBuilder: knitr
28 changes: 11 additions & 17 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
# Generated by roxygen2: do not edit by hand

S3method(get_bbox,RasterLayer)
S3method(get_bbox,default)
S3method(get_bbox,sf)
S3method(add_bbox_buffer,Raster)
S3method(add_bbox_buffer,sf)
S3method(get_tiles,Raster)
S3method(get_tiles,list)
S3method(get_tiles,sf)
S3method(get_tiles,sfc)
S3method(set_bbox_side_length,Raster)
S3method(set_bbox_side_length,sf)
export(StatSpatialRGB)
export(add_bbox_buffer)
export(calc_haversine_distance)
export(combine_overlays)
export(convert_distance)
export(deg_to_rad)
export(export_bounding_box)
export(export_coord_pair)
export(geom_spatial_rgb)
export(georeference_overlay)
export(get_bbox)
export(get_bbox_centroid)
export(get_coord_bbox)
export(get_tiles)
export(hit_national_map_api)
export(merge_rasters)
export(point_from_distance)
export(rad_to_deg)
export(raster_to_raw_tiles)
export(set_bbox_side_length)
export(terrainr_bounding_box)
export(terrainr_coordinate_pair)
export(stat_spatial_rgb)
export(vector_to_overlay)
exportClasses(terrainr_bounding_box)
exportClasses(terrainr_coordinate_pair)
58 changes: 58 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# terrainr 0.3.0
* Breaking changes:
* `terrainr_*` classes have been effectively removed and are no longer
exported. Functions which previously expected these objects now generally
accept `sf` and `Raster` class objects instead. Functions which previously
returned these objects now generally return `sf` objects instead (#24).
* The list returned by `get_tiles` now uses the service names provided by
the user, not the endpoint names. This means that
`get_tiles(..., services = "elevation")` will now use the name `elevation`
instead of `3DEPElevation`, and remain standard across versions (#12).
* `get_bbox` and `get_coordinate_bbox` have been removed. Functions that
used to expect `terrainr_bounding_box` objects now accept objects of class
`sf` or `raster` (#24).
* `add_bbox_buffer` loses the `divisible` argument. For precise control over
side length, use `set_bbox_side_length` (which should be more accurate, if
slightly more conservative, than the `divisible` system ever was) (#17).
* `convert_distance` has been removed (internally replaced by the
`units` package) (#7).
* `merge_rasters` loses the `input_images` and `output_image` function, as
most downloaded files are now already georeferenced. To recreate this
functionality, georeference image tiles directly via
`output <- georeference_overlay(img_tiles, ref_tiles, tempfile(fileext = ".tif"))`
and then provide `output` to `merge_rasters`.
* A handful of utility functions are no longer exported:
* `calc_haversine_distance`
* `point_from_distance`
* `rad_to_deg`
* `deg_to_rad`
* New features:
* Two new functions, `geom_spatial_rgb` and `stat_spatial_rgb`, allow you to
use RGB map tiles as backgrounds for further plotting.
* `calc_haversine_distance` gains an argument `coord_units` allowing it to
handle coordinates in radians as well as degrees.
* Improvements and bug fixes:
* `georeference_overlay` provides `tempfile(fileext = ".tif")` as a default
output location if no `output_file` is provided.
* `get_tiles` now tells you what tiles it's retrieving, not retriving.
* Internal changes:
* `calc_haversine_distance` has been internally simplified somewhat to
reduce code duplication.
* All `services` arguments to `hit_national_map_api` and `get_tiles` can
now handle both base64 and binary returns, removing the need to manually
categorize endpoints (54ad9fb).
* `hit_national_map_api` auto-detects whether API endpoints are
returning base64 or binary and handles them appropriately
* `get_tiles` now auto-detects whether `hit_national_map_api` is
returning base64 or binary and writes to file appropriately.
* `hit_national_map_api` is now more likely to fail with a human-friendly
error message if API endpoints return a non-200 status (54ad9fb).
* `hit_national_map_api` (and by extension `get_tiles`) now register a user
agent.
* Changes in dependencies:
* `gdalUtilities` has been removed, with functionality replaced by `sf`.
* `rlang` has been removed, with functionality removed.
* `units` has been added.
* `ggplot2` has been moved to Imports (was previously in Suggests) due to
the new `geom_spatial_rgb` and `stat_spatial_rgb` functions.

# terrainr 0.2.1
* Improvements and bug fixes:
* The `transportation` endpoint has moved servers, and is now handled by the
Expand Down
Loading

0 comments on commit 753a265

Please sign in to comment.