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
bfd31676
Commit
bfd31676
authored
Jun 29, 2021
by
Johannes Knoch
Browse files
renamed the function and output names and put in missing packages for functions used
parent
865d2f66
Changes
3
Hide whitespace changes
Inline
Side-by-side
R-package/NAMESPACE
View file @
bfd31676
# Generated by roxygen2: do not edit by hand
export(WriteOutSamples)
export(clip)
export(iplot)
export(load_reference_as_shape)
...
...
@@ -12,5 +13,4 @@ export(sample_nb)
export(save_class_tiff)
export(save_kml)
export(save_run)
export(write_Out_Samples)
exportClasses(Habitat)
R-package/R/WriteOutSamples.r
View file @
bfd31676
...
...
@@ -7,14 +7,14 @@
#' @param className name (character) of habitat type for which samples should be selected
#' @param output_format format (character) of output; whether shp (default) or geojson
#'
#' @return ESRI shapefiles/GeoJSON with name:
RefHaSa
_step_classname.shp/
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
#' @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
#'
#'
#' @export
###write out selected samples
w
rite
_
Out
_
Samples
<-
function
(
inPath
,
step
,
className
,
output_format
=
c
(
"shp"
,
"geojson"
))
{
W
riteOutSamples
<-
function
(
inPath
,
step
,
className
,
output_format
=
c
(
"shp"
,
"geojson"
))
{
paste
(
inPath
,
"step_"
,
step
,
"_"
,
className
,
".tif"
,
sep
=
""
)
run1
<-
get
(
load
(
paste
(
inPath
,
"Run"
,
step
,
sep
=
""
)))
...
...
@@ -59,26 +59,26 @@ write_Out_Samples <- function (inPath, step, className, output_format = c("shp",
if
(
output_format
==
"geojson"
)
{
crs_dummy
<-
sp
::
proj4string
(
dummy_sample
)
crs
(
res
)
<-
crs_dummy
raster
::
crs
(
res
)
<-
crs_dummy
res
<-
sp
::
spTransform
(
res
,
CRS
(
"+proj=longlat +datum=WGS84 +init=epsg:4326"
))
rgdal
::
writeOGR
(
res
,
layer
=
paste
(
"
RefHaSa
_step_"
,
step
,
"_"
,
className
,
sep
=
""
),
dsn
=
paste
(
inPath
,
"
RefHaSa
_step_"
,
step
,
"_"
,
className
,
".geojson"
,
sep
=
""
),
layer
=
paste
(
"
SamplePoints
_step_"
,
step
,
"_"
,
className
,
sep
=
""
),
dsn
=
paste
(
inPath
,
"
SamplePoints
_step_"
,
step
,
"_"
,
className
,
".geojson"
,
sep
=
""
),
driver
=
"GeoJSON"
,
check_exists
=
TRUE
,
overwrite_layer
=
TRUE
)
}
else
{
crs_dummy
<-
sp
::
proj4string
(
dummy_sample
)
crs
(
res
)
<-
crs_dummy
raster
::
crs
(
res
)
<-
crs_dummy
res
<-
sp
::
spTransform
(
res
,
CRS
(
"+proj=longlat +datum=WGS84 +init=epsg:4326"
))
rgdal
::
writeOGR
(
res
,
layer
=
paste
(
"
RefHaSa
_step_"
,
step
,
"_"
,
className
,
sep
=
""
),
dsn
=
paste
(
inPath
,
"
RefHaSa
_"
,
className
,
"_"
,
step
,
".shp"
,
sep
=
""
),
layer
=
paste
(
"
SamplePoints
_step_"
,
step
,
"_"
,
className
,
sep
=
""
),
dsn
=
paste
(
inPath
,
"
SamplePoints_step_"
,
step
,
"
_"
,
className
,
".shp"
,
sep
=
""
),
driver
=
"ESRI Shapefile"
,
check_exists
=
TRUE
,
overwrite_layer
=
TRUE
...
...
R-package/man/
w
rite
_
Out
_
Samples.Rd
→
R-package/man/
W
riteOutSamples.Rd
View file @
bfd31676
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/WriteOutSamples.r
\name{
w
rite
_
Out
_
Samples}
\alias{
w
rite
_
Out
_
Samples}
\name{
W
riteOutSamples}
\alias{
W
riteOutSamples}
\title{Sample Collection for Habitat Types}
\usage{
w
rite
_
Out
_
Samples(inPath, step, className, output_format = c("shp", "geojson"))
W
riteOutSamples(inPath, step, className, output_format = c("shp", "geojson"))
}
\arguments{
\item{inPath}{file path (character) for results of habitat type sampling and probability mapping (same as outPath from function multi_Class_Sampling)}
...
...
@@ -16,9 +16,9 @@ write_Out_Samples(inPath, step, className, output_format = c("shp", "geojson"))
\item{output_format}{format (character) of output; whether shp (default) or geojson}
}
\value{
ESRI shapefiles/GeoJSON with name:
RefHaSa
_step_classname.shp/
RefHaSa
_step_classname.geojson
ESRI shapefiles/GeoJSON with name:
SamplePoints
_step_classname.shp/
SamplePoints
_step_classname.geojson
\enumerate{
\item Point Shape represents pixel that belong to selected habitat type and can be used as reference for further model building
\item Point Shape
/GeoJSON
represents pixel that belong to selected habitat type and can be used as reference for further model building
}
}
\description{
...
...
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