lnglat_to_xy | R Documentation |
Converts between geographic WGS84 (EPSG:4326) coordinates in decimal degrees and projected Web Mercator (EPSG:3857) coordinates in meters.
lnglat_to_xy(lnglat)
xy_to_lnglat(xy)
lnglat |
Rows of coordinates in decimal degrees (longitude, latitude), with longitude: [-180, 180) and latitude: [-85.05112, 85.05112]. |
xy |
Rows of Web Mercator coordinates in meters (x, y). |
lng <- c(-45, -45, 45, 45)
lat <- c(-45, 45, 45, -45)
lnglat <- cbind(lng, lat)
xy_to_lnglat(lnglat_to_xy(lnglat)) - lnglat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.