hypertidy/ceramic

generalize provider

mdsumner opened this issue · 5 comments

A fair bit of refactoring is required

  • type to include "elevation-tiles-prod", and just let that set dictate the provider
  • provider choice will be configurable, e.g. custom mapbox, format jpg/png (more needed)
  • get_loc() to return file list, not a raster

Each type will dispatch to the right "provider_string()" function, zoom, x, y are templated - and somehow mapbox be able to choose format.

get_loc may become a get_<provider>, and so the loc handling become new functions

@jhollist just FYI, made some progres here in "general" branch currently at ae9972f, would be great if you could explore! Lots still to do but was happy with how I could unpick the mapbox stuff

(I haven't tried any of the tile-list functions in ceramic yet ...)

lake <- elevatr::lake
library(ceramic)  
library(raster)
#> Loading required package: sp
sat <- cc_location(lake, type = "mapbox.satellite")

out <- cc_location(lake, type = "mapbox.outdoors")

ter <- cc_elevation(lake)

aws <- cc_location(lake, type = "elevation-tiles-prod")
op <- par(mfrow = c(2, 2))
plotRGB(sat)
plotRGB(out)
greys <- grey(seq(0.1, 1, length = 56))
plotRGB(sat); plot(ter, col = greys, add = TRUE) ## easy plot position copy
plotRGB(sat); plot(aws, col = greys, add = TRUE)

par(op)

Created on 2019-03-27 by the reprex package (v0.2.1)

Now in master, ignore all branches

there's some extra services here, doesn't seem to cache the tiles natively but not sure

https://github.com/16EAGLE/basemap

won't do, use hypertidy/dsn and other sources for online imagery