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
7d08de50
Commit
7d08de50
authored
Jul 16, 2021
by
Romulo Pereira Goncalves
Browse files
Remove prints.
parent
ea81cedd
Changes
1
Hide whitespace changes
Inline
Side-by-side
R-package/R/save_files.r
View file @
7d08de50
...
...
@@ -91,19 +91,15 @@ saveSamplePoints <-
dummy_raster
[
dummy_raster
==
num_models
]
<-
NA
dummy_raster
[
dummy_raster
>
num_models
]
<-
1
print
(
"1"
)
###extract only class samples
for
(
i
in
1
:
length
(
ref_samples
))
{
if
(
length
(
dim
(
ref_samples
[[
i
]]))
!=
0
)
{
print
(
"1a"
)
if
(
is.na
(
ref_switch
[
i
])
==
F
)
{
print
(
"1b"
)
j
=
j
+
1
collect
[[
j
]]
<-
ref_samples
[[
i
]][
which
(
ref_samples
[[
i
]]
@
data
==
1
),
]
}
else
{
print
(
"1c"
)
j
=
j
+
1
collect
[[
j
]]
<-
ref_samples
[[
i
]][
which
(
ref_samples
[[
i
]]
@
data
==
2
),
]
...
...
@@ -111,24 +107,18 @@ saveSamplePoints <-
}
}
print
(
"2"
)
result
<-
do.call
(
rbind
,
collect
)
if
(
!
is.null
(
result
))
{
print
(
"3a"
)
res
<-
raster
::
extract
(
dummy_raster
,
result
)
if
(
length
(
which
(
is.na
(
res
)))
>
0
)
{
print
(
"3aa"
)
result
<-
result
[
-
which
(
is.na
(
res
)),
]
}
}
else
{
print
(
"3b"
)
result
<-
sp
::
SpatialPolygonsDataFrame
(
Sr
=
sp
::
SpatialPolygons
(
list
()),
data
=
data.frame
())
}
print
(
"4"
)
raster
::
crs
(
result
)
<-
raster
::
crs
(
dummy_raster
)
print
(
"5"
)
output_format
<-
match.arg
(
output_format
)
if
(
output_format
==
"geojson"
)
{
file_path
<-
paste
(
in_path
,
"SamplePoints_step_"
,
step
,
"_"
,
class_name
,
".geojson"
,
sep
=
""
)
...
...
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