Commit e0cdec2a authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Only transform if there are points to be saved.

parent ccc3e7b9
......@@ -115,7 +115,10 @@ saveSamplePoints <-
raster::crs(res) <- raster::crs(dummy_raster)
output_format <- match.arg(output_format)
if (output_format == "geojson") {
res <- sp::spTransform(res, sp::CRS("+init=epsg:4326"))
# Only transform is there points to be saved.
if (nrow(res) > 0) {
res <- sp::spTransform(res, sp::CRS("+init=epsg:4326"))
}
rgdal::writeOGR(
obj = res,
layer = paste("SamplePoints_step_", step, "_", class_name, sep = ""),
......
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