View source: R/util-kml_to_csv.r
kml_to_csv | R Documentation |
Function for extracting features (points, lines, polygons) from kml files and writing them to csv files.
kml_to_csv(filePath, type = c("points", "lines", "polygons"))
filePath |
The pathname for the kml file you wish to convert. |
type |
Optional character string indicating the type(s) of feature(s)
to read from the kml file. Valid values are |
kmz files are not supported. Make sure exports from Google earth are saved as kml. Or extract (unzip) kml from kmz.
A csv file (same name as input filePath
but with csv
extension) is written to directory containing input filePath
with five columns
Feature name
Feature type
Sequential position in feature
Longitude
Latitude
Altitude
# Get example kml with two polygons
kml_file <- system.file("extdata", "example_polygons.kml",
package = "glatos"
)
kml_to_csv(kml_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.