Skip to content

Commit

Permalink
add 401 to zero block codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Feb 9, 2024
1 parent 052b5f3 commit a5b2b10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ceramic
Title: Download Online Imagery Tiles
Version: 0.9.0
Version: 0.9.0.9001
Authors@R: c(
person("Michael", "Sumner", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-2471-7511")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# dev

* Add zero block code for 401 error (think that means we have no valid key, but manifests as cache problem).

# 0.9.0

* Added a suite of Tasmap sources for 'cc_location()'.
Expand Down
3 changes: 2 additions & 1 deletion R/gdal.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ gdal_mapbox <- function (extent = c(-180, 180, -90, 90), ..., dimension = NULL,
xraster <- extent
x <- format_out(list(extent = extent, dimension = dimension,
projection = projection))
src1 <- "<GDAL_WMS><Service name=\"TMS\"><ServerUrl>https://api.mapbox.com/v4/mapbox.satellite/${z}/${x}/${y}.jpg?access_token=%s</ServerUrl></Service><DataWindow><UpperLeftX>-20037508.34</UpperLeftX><UpperLeftY>20037508.34</UpperLeftY><LowerRightX>20037508.34</LowerRightX><LowerRightY>-20037508.34</LowerRightY><TileLevel>22</TileLevel><TileCountX>1</TileCountX><TileCountY>1</TileCountY><YOrigin>top</YOrigin></DataWindow><Projection>EPSG:3857</Projection><BlockSizeX>256</BlockSizeX><BlockSizeY>256</BlockSizeY><BandsCount>3</BandsCount>"
src1 <- "<GDAL_WMS><Service name=\"TMS\"><ServerUrl>https://api.mapbox.com/v4/mapbox.satellite/${z}/${x}/${y}.jpg?access_token=%s</ServerUrl></Service><DataWindow><UpperLeftX>-20037508.34</UpperLeftX><UpperLeftY>20037508.34</UpperLeftY><LowerRightX>20037508.34</LowerRightX><LowerRightY>-20037508.34</LowerRightY><TileLevel>22</TileLevel><TileCountX>1</TileCountX><TileCountY>1</TileCountY><YOrigin>top</YOrigin></DataWindow><Projection>EPSG:3857</Projection><BlockSizeX>256</BlockSizeX><BlockSizeY>256</BlockSizeY><BandsCount>3</BandsCount><ZeroBlockHttpCodes>204,404,401</ZeroBlockHttpCodes>"
src2 <- sprintf("<UserAgent>%s</UserAgent><Cache /></GDAL_WMS>",
getOption("HTTPUserAgent"))
src <- paste0(src1, src2)
Expand All @@ -95,6 +95,7 @@ gdal_mapbox <- function (extent = c(-180, 180, -90, 90), ..., dimension = NULL,
if (info$bands < 3) {
bands <- 1L
}
browser()
suppressWarnings(
vals <- vapour::gdal_raster_image(rso, target_ext = x$extent,
target_dim = x$dimension, target_crs = x$projection,
Expand Down

0 comments on commit a5b2b10

Please sign in to comment.