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
e0cdec2a
Commit
e0cdec2a
authored
Jul 08, 2021
by
Romulo Pereira Goncalves
Browse files
Only transform if there are points to be saved.
parent
ccc3e7b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
R-package/R/save_files.r
View file @
e0cdec2a
...
...
@@ -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
=
""
),
...
...
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