tile_coords | R Documentation |
Convert (column, row)
numbers to (x, y)
coordinates for a given tile set.
tile_coords(data, id)
data |
a data frame containing columns named |
id |
character, name of map tile set ID. See stTiles. |
This function converts column and row indices for an available map tile set matrix to coordinates that can be used in a Leaflet map. See stTiles for available tile sets.
data
cannot contain columns named x
or y
, which are reserved for the
column-appended output data frame.
Each tile set has a simple/non-geographical coordinate reference system
(CRS). Respective coordinates are based on the dimensions of the source image
used to generate each tile set. The same column and row pair will yield
different map coordinates for different tile sets. Typical for matrices,
columns are numbered increasing from left to right and rows increasing from
top to bottom. The output of tile_coords()
is a typical Cartesian coordinate
system, increasing from left to right and bottom to top.
a data frame.
d <- data.frame(row = c(0, 3222, 6445), col = c(0, 4000, 8000))
tile_coords(d, "galaxy1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.