Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Habitat Sampler
HabitatSampler
Commits
ccc3e7b9
Commit
ccc3e7b9
authored
Jul 08, 2021
by
Romulo Pereira Goncalves
Browse files
The filter, like in other save functions should be done inside the function.
parent
1c5b3001
Changes
2
Hide whitespace changes
Inline
Side-by-side
R-package/R/save_files.r
View file @
ccc3e7b9
...
...
@@ -66,7 +66,8 @@ save_kml <- function(outPath, step, raster, overwrite) {
#' @param output_format format (character) of output; whether shp (default) or geojson
#' @param ref_samples list of reference sample points
#' @param ref_switch vector with switch values
#' @param dummy_raster raster with classified pixels marked as 1
#' @param threshold threshold
#' @param dummy_raster raster with probabilities for each pixel
#'
#' @return ESRI shapefiles/GeoJSON with name: SamplePoints_step_classname.shp/SamplePoints_step_classname.geojson
#' 1) Point Shape/GeoJSON represents pixel that belong to selected habitat type and can be used as reference for further model building.
...
...
@@ -81,9 +82,12 @@ saveSamplePoints <-
output_format
=
c
(
"shp"
,
"geojson"
),
ref_samples
,
ref_switch
,
threshold
,
dummy_raster
)
{
collect
<-
list
()
j
<-
0
dummy_raster
[
dummy_raster
<
threshold
]
<-
NA
dummy_raster
[
dummy_raster
>=
threshold
]
<-
1
###extract only class samples
for
(
i
in
1
:
length
(
ref_samples
))
{
...
...
R-package/man/saveSamplePoints.Rd
View file @
ccc3e7b9
...
...
@@ -11,6 +11,7 @@ saveSamplePoints(
output_format = c("shp", "geojson"),
ref_samples,
ref_switch,
threshold,
dummy_raster
)
}
...
...
@@ -27,7 +28,9 @@ saveSamplePoints(
\item{ref_switch}{vector with switch values}
\item{dummy_raster}{raster with classified pixels marked as 1}
\item{threshold}{threshold}
\item{dummy_raster}{raster with probabilities for each pixel}
}
\value{
ESRI shapefiles/GeoJSON with name: SamplePoints_step_classname.shp/SamplePoints_step_classname.geojson
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment