merc: Mercator extent

Description Usage Arguments Value Examples

View source: R/merc.R

Description

Create an extent in Mercator projection from a longitude, latitude, and a width,height.

Usage

1
merc(x = 146.7, y = -42, wh = 256000)

Arguments

x

longitude

y

latitude

wh

width and height, in metres - if only one vaue provided it is also used for height

Value

four values, xmin, xmax, ymin, ymax in global Mercator

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
merc()  ## a parochial default
library(lazyraster)
vearth <- '<GDAL_WMS> <Service name="VirtualEarth">
<ServerUrl>http://a${server_num}.ortho.tiles.virtualearth.net/tiles/a${quadkey}.jpeg?g=90</ServerUrl></Service>
<MaxConnections>4</MaxConnections>    <Cache/>    </GDAL_WMS>'
lr <- lazyraster(vearth)
## Not run: \donttest{
raster::plotRGB(as_raster(crop(lr, merc(-90, 52, 256e4)), band = 1:3))
}
## End(Not run)

mdsumner/lazyraster documentation built on Sept. 8, 2021, 9:36 p.m.