hypertidy / dsn

Data Source Name Helpers for Use With GDAL
https://hypertidy.github.io/dsn/
Other
6 stars 0 forks source link

vrtcon examples #5

Open mdsumner opened 1 year ago

mdsumner commented 1 year ago

this is how we can get terra and stars to work with tile servers, without the warper

px <- dev.size("px")
writeLines(dsn::wms_virtualearth(), dsn <- tempfile(fileext = ".xml"))
terra::plotRGB(terra::rast(dsn::vrtcon(dsn, outsize =px, ovr = 18)))

with the warper

terra::plotRGB(terra::project(terra::rast(dsn::vrtcon(dsn, ovr = 18)), terra::rast())

terra::plotRGB(terra::project(terra::rast(dsn::vrtcon(dsn, ovr = 16)), terra::rast(terra::ext(120, 150, -50, -20), res = .1)))

I'm using a file not the dsn text because I can't get the in-mem xml to work with "vrt://"

I'm including outsize for fun, it's ovr that does most of the work.

mdsumner commented 1 year ago

this doesn't work sadly

vrtcon(sprintf("\"%s\"", dsn::wms_virtualearth()))