Commit a3033f8b authored by Johannes Knoch's avatar Johannes Knoch
Browse files

adjustments for saving sample points as geojson

parent 7b41a8b5
#' Sample Collection for Habitat Types #' Sample Collection for Habitat Types
#' #'
#'Writes out a set of samples (SpatialPointsDataFrame) into an ESRI shapefile for a selected habitat type. Each point represents a valid sample location that identifies the selected habitat type. #'Writes out a set of samples (SpatialPointsDataFrame) into an GeoJSON file for a selected habitat type. Each point represents a valid sample location that identifies the selected habitat type.
#' #'
#' @param inPath file path (character) for results of habitat type sampling and probability mapping (same as outPath from function multi_Class_Sampling) #' @param inPath file path (character) for results of habitat type sampling and probability mapping (same as outPath from function multi_Class_Sampling)
#' @param step step number (numeric) #' @param step step number (numeric)
#' @param className name (character) of habitat type for which samples should be selected #' @param className name (character) of habitat type for which samples should be selected
#' #'
#' @return ESRI shapefile with name: RefHaSa_className_step.shp #' @return GeoJSON file with name: RefHaSa_step_classname.geojson
#' 1) Point Shape represents pixel that belong to selected habitat type and can be used as reference for further model building #' 1) Point Shape represents pixel that belong to selected habitat type and can be used as reference for further model building
#' #'
#' #'
...@@ -104,7 +104,7 @@ write_Out_Samples <- function (inPath, step, className) { ...@@ -104,7 +104,7 @@ write_Out_Samples <- function (inPath, step, className) {
rgdal::writeOGR( rgdal::writeOGR(
res, res,
layer = "result", layer = paste("RefHaSa_step_", step, "_", className, sep = ""),
dsn = paste(inPath, "RefHaSa_step_", step, "_", className, ".geojson", sep = ""), dsn = paste(inPath, "RefHaSa_step_", step, "_", className, ".geojson", sep = ""),
driver = "GeoJSON", driver = "GeoJSON",
check_exists = TRUE, check_exists = TRUE,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment