Description Usage Arguments Value Note See Also Examples
Extract KML coordinates (longitude, latitude or altitude).
1 | kml_coords(x, coord, verbose = TRUE)
|
x |
A character vector of KML coordinates, of the form
|
coord |
Which coordinate to extract: either |
verbose |
Whether to report invalid coordinates and/or negative
altitudes (below sea level); defaults to |
A numeric vector.
If coord
has been set to return altitude and there are no altitude
values in the KML coordinates, the function returns a numeric vector of
NA
values of the same length as x
.
KML coordinates are lon,lat[,alt]
tuples.
Invalid coordinates are longitudes outside of [-180, 180] (angular distance in degrees, relative to the Prime Meridian) and latitudes outside of [-90, 90] (angular distance in degrees, relative to the Equator).
Altitude is the distance from the earth's surface, in meters. Depending on the altitude mode used in the KML source, altitude might be computed in absolute terms (relative to sea level), or from the actual ground elevation of a particular location.
Google Developers. KML Reference: <Camera> Element. https://developers.google.com/kml/documentation/kmlreference#camera
1 2 3 4 5 6 7 | # longitude
kml_coords("11.0,22.0,-99.0", 1)
# latitude
kml_coords("11.0,22.0,-99.0", 2)
# altitude
kml_coords("11.0,22.0,-99.0", "alt")
kml_coords("11.0,22.0,-99.0", "alt", verbose = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.