kml_to_shape_gen {KMLtoSHAPE} | R Documentation |
Conversion from KML to Shapefile after Extracting Attributes from a Description String based on a List of Attribute Names
Description
Conversion from KML to Shapefile after Extracting Attributes from a Description String based on a List of Attribute Names
Usage
kml_to_shape_gen(data_kml, outputShape, attribute_names)
Arguments
data_kml |
Path to the KML file |
outputShape |
Path to save the output shapefile |
attribute_names |
A character vector of attribute names to extract |
Value
A shapefile with extracted attributes
References
1. Flores, G. & Gallardo, C. (2021). Creating Shapefile Files in ArcMap from KML File Generated in My Maps. In Advances in Emerging Trends and Technologies: Proceedings of ICAETT 2020 (pp. 193-204). Springer International Publishing..<DOI:10.1007/978-3-030-63665-4_15> 2. Kumar et al. (2023). SpatGRID:Spatial Grid Generation from Longitude and Latitude List. R package version 0.1.0.
Examples
library(KMLtoSHAPE)
# Example usage:
data_kml <- system.file("extdata", "testkml.kml", package = "KMLtoSHAPE")
outputShape <- file.path(tempdir(), "shapedata.shp")
# Delete existing shapefile if it exists
if(file.exists(outputShape)) file.remove(outputShape)
# Specify attribute names
attribute_names <- c("pH", "EC", "OC", "N", "P", "K")
# convert kml to shapefile
test_data<-kml_to_shape_gen(data_kml, outputShape,attribute_names)
[Package KMLtoSHAPE version 0.1.0 Index]