Skip to content

Commit

Permalink
fix: staticmap_getEsrimapBrick() now uses correct bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathancallahan committed Jul 26, 2021
1 parent d783de9 commit 399ef4d
Show file tree
Hide file tree
Showing 186 changed files with 219 additions and 226 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type: Package
Package: PWFSLSmoke
Version: 1.2.114
Version: 1.2.115
Title: Utilities for Working with Air Quality Monitoring Data
Authors@R: c(
person("Jonathan", "Callahan", email="[email protected]", role=c("aut","cre")),
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PWFSLSmoke 1.2.114
# PWFSLSmoke 1.2.115

* Updated AIRSIS EBAM QC RHi threshold from 45% to 50%.
* Fixed a cropping issue in `staticmap_getEsrimapBrick()` which resulted in
image boundaries that didn't exactly match the requested boundaries.

# PWFSLSmoke 1.2.113

Expand Down
22 changes: 7 additions & 15 deletions R/staticmap_getEsrimapBrick.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ staticmap_getEsrimapBrick <- function(
ymax = ymax),
crs = crs)
} else if ( !is.null(bbox) ) {
xmin <- bbox[1]
xmax <- bbox[3]
ymin <- bbox[2]
ymax <- bbox[4]
bbox <-
sf::st_bbox(c(xmin = bbox[1],
xmax = bbox[3],
Expand Down Expand Up @@ -209,23 +213,11 @@ staticmap_getEsrimapBrick <- function(

# ----- Crop image -----------------------------------------------------------

# NOTE: Rows are latitude and columns are longitude
x_count <- nrow(rasterBrick)
if ( x_count > height ) {
x_mid <- floor(x_count/2)
x_lo <- x_mid - floor(height/2)
x_hi <- x_mid + floor(height/2)
}
y_count <- ncol(rasterBrick)
if ( y_count > width ) {
y_mid <- floor(y_count/2)
y_lo <- y_mid - floor(width/2)
y_hi <- y_mid + floor(width/2)
}

extent <- raster::extent(rasterBrick, x_lo, x_hi, y_lo, y_hi)
extent <- raster::extent(xmin, xmax, ymin, ymax)
rasterBrick <- raster::crop(rasterBrick, extent)

raster::crs(rasterBrick) <- sp::CRS("+init=epsg:4326")

# ----- Return ---------------------------------------------------------------

return(rasterBrick)
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Data_Model.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Maps_and_Timeseries_Plots.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/NowCast.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/articles/PWFSLSmoke.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/articles/articles/Example_Denver_Air_Quality_Forecast.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/articles/articles/Example_Save_Data_as_CSV.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/articles/Loading_Monitoring_Data.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ articles:
articles/Example_Denver_Air_Quality_Forecast: Example_Denver_Air_Quality_Forecast.html
articles/Example_Save_Data_as_CSV: Example_Save_Data_as_CSV.html
articles/Loading_Monitoring_Data: Loading_Monitoring_Data.html
last_built: 2021-07-07T18:02Z
last_built: 2021-07-26T20:28Z

2 changes: 1 addition & 1 deletion docs/reference/AIRSIS.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/AQI.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/AQI_en.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/AQI_es.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/CONUS.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/Carmel_Valley.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/Northwest_Megafires.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/PWFSLSmoke-deprecated.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/US_52.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/WRCC.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addAQILegend.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addAQILines.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addAQIStackedBar.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addBullseye.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addClustering.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addEsriAddress.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addGoogleAddress.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addGoogleElevation.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addIcon.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addMarker.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addMazamaMetadata.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addPolygon.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addShadedBackground.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/addShadedNight.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 399ef4d

Please sign in to comment.