Type: | Package |
Title: | Preserving Attribute Values: Converting KML to Shapefile |
Version: | 0.1.0 |
Depends: | R(≥ 2.10) |
Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0) |
Description: | The developed function is designed to facilitate the seamless conversion of KML (Keyhole Markup Language) files to Shapefiles while preserving attribute values. It provides a straightforward interface for users to effortlessly import KML data, extract relevant attributes, and export them into the widely compatible Shapefile format. The package ensures accurate representation of spatial data while maintaining the integrity of associated attribute information. For details see, Flores, G. (2021). <doi:10.1007/978-3-030-63665-4_15>. Whether for spatial analysis, visualization, or data interoperability, it simplifies the conversion process and empowers users to seamlessly work with geospatial datasets. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2.0)] |
Encoding: | UTF-8 |
Imports: | raster,stringr,sf |
RoxygenNote: | 7.2.3 |
NeedsCompilation: | no |
Packaged: | 2024-04-29 07:24:40 UTC; Asus |
Author: | Nirmal Kumar [aut, cph], Nobin Chandra Paul [aut, cre] |
Maintainer: | Nobin Chandra Paul <nobin.paul@icar.gov.in> |
Repository: | CRAN |
Date/Publication: | 2024-04-30 11:20:05 UTC |
Conversion from KML to Shapefile While Preserving Attribute Values
Description
Conversion from KML to Shapefile While Preserving Attribute Values
Usage
kml_to_shape(data_kml, outputShape)
Arguments
data_kml |
Path to the KML file |
outputShape |
Path to save the output shapefile |
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)
# convert kml to shapefile
test_data<-kml_to_shape(data_kml, outputShape)
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)