sample_points
Created: 2014-03-19 16:53:52
Last updated: 2015-05-11 22:15:23
Randomly samples a specified number of absence and/or presence points in a given environment (set of layers + mask).
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Alan R Williams & Renato De Giovanni |
Titles (1)
Descriptions (1)
Randomly sample a specified number of absence and/or presence points in a given environment. |
Dependencies (0)
Inputs (8)
Name |
Description |
environmentally_unique |
Filter environmentally unique points, i.e. discard coordinates with the same environmental conditions ("yes" or "no").
|
spatially_unique |
Filter spatially unique points, i.e. discard duplicate coordinates ("yes" or "no").
|
layers_ids |
Newline separated list of layers defining the environment for point sampling.
|
mask_id |
Mask id used for sampling points.
|
num_points |
Number of points to be sampled.
|
species_label |
Species name to be returned for all points.
|
proportion_of_absences |
Proportion of absence points to be sampled (value between 0 and 1).
|
return_environmental_data |
Indicate if the returned points should include environmental data ("yes" or "no"). Important: if the same points are going to be used in subsequent operations with a different environmental scenario, DO NOT include environmental data here.
|
Processors (3)
Name |
Type |
Description |
make_xml |
beanshell |
Scriptif ((num_points == void) || (num_points == null)) {
throw new RuntimeException("The num_points parameter must be specified for sampling points");
}
if ((layers == void) || (layers == null)) {
throw new RuntimeException("The layers parameter must be specified for sampling points");
}
if ((species_label == void) || (species_label == null)) {
species_label = "undefined";
}
if ((srs == void) || (srs == null)) {
srs = "GEOGCS[\"WGS84\", DATUM[\"WGS84\", SPHEROID[\"WGS84\", 6378137.0, 298.257223563]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"degree\", 0.017453292519943295], AXIS[\"Longitude\",EAST], AXIS[\"Latitude\",NORTH]]";
}
if ((proportion_of_absences == void) || (proportion_of_absences == null)) {
proportion_of_absences = "1";
}
if ((spatially_unique == void) || (spatially_unique == null)) {
spatially_unique = "no";
}
if ((environmentally_unique == void) || (environmentally_unique == null)) {
environmentally_unique = "no";
}
xml = "\n"
+"\n"
+"\n"
+"\n";
int i = 0;
String[] s_layers = layers.split("\n");
String first_layer = "";
for ( i = 0; i < s_layers.length; ++i ) {
if ( s_layers[i].length() > 0 ) {
if (first_layer.length() == 0) {
first_layer = s_layers[i];
}
xml += "\n"
+"\n";
if (spatially_unique.equals("yes") || environmentally_unique.equals("yes")) {
xml += "\n";
if (environmentally_unique.equals("yes")) {
xml += "\n";
}
if (spatially_unique.equals("yes")) {
xml += "\n";
}
xml += "\n";
}
xml += "\n"
+"\n"
+"\n"; |
call_service |
workflow |
This part is responsible for calling the service and fetching results. |
clean_xml |
beanshell |
Scriptif ((return_environmental_data == void) || (return_environmental_data == null)) {
return_environmental_data = "no";
}
String cleaned_presence_points_xml = presence_points_xml;
String cleaned_absence_points_xml = absence_points_xml;
if (return_environmental_data.equals("no")) {
if (presence_points_xml.length() > 0) {
cleaned_presence_points_xml = presence_points_xml.replaceAll("\\sSample=\"[^\"]*\"", "");
}
if (absence_points_xml.length() > 0) {
cleaned_absence_points_xml = absence_points_xml.replaceAll("\\sSample=\"[^\"]*\"", "");
}
} |
Beanshells (3)
Name |
Description |
Inputs |
Outputs |
make_xml |
|
environmentally_unique
mask_id
layers
spatially_unique
proportion_of_absences
num_points
species_label
|
xml
|
clean_xml |
|
return_environmental_data
presence_points_xml
absence_points_xml
|
cleaned_presence_points_xml
cleaned_absence_points_xml
|
checkProgress |
|
input_progress
|
output_progress
|
Outputs (5)
Name |
Description |
log |
Sample points log.
|
progress |
Sample points progress. Possible values are: 100 (finished), -2 (aborted) or -3 (cancelled).
|
presence_points_xml |
XML with sampled presence points.
|
absence_points_xml |
XML with sampled absence points.
|
ticket |
Ticket returned by the service. This will only be useful if you need to contact the service administrator to report an issue about this operation.
|
Datalinks (16)
Source |
Sink |
mask_id |
make_xml:mask_id |
layers_ids |
make_xml:layers |
species_label |
make_xml:species_label |
num_points |
make_xml:num_points |
spatially_unique |
make_xml:spatially_unique |
environmentally_unique |
make_xml:environmentally_unique |
proportion_of_absences |
make_xml:proportion_of_absences |
make_xml:xml |
call_service:samplePoints_configuration |
return_environmental_data |
clean_xml:return_environmental_data |
call_service:presence_points_xml |
clean_xml:presence_points_xml |
call_service:absence_points_xml |
clean_xml:absence_points_xml |
call_service:output_log |
log |
call_service:output_progress |
progress |
clean_xml:cleaned_presence_points_xml |
presence_points_xml |
clean_xml:cleaned_absence_points_xml |
absence_points_xml |
call_service:ticket |
ticket |
Uploader
Component Validity
Loading
License
All versions of this Workflow are
licensed under:
Version 11 (latest)
(of 11)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (0)
None
Featured In Packs (1)
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(7)
Only the first 2 workflows that use similar services are shown. View all workflows that use these services.
Uploader
Project
get_available_algorithms
(3)
Retrieves all available algorithms from the openModeller web service, returning an XML.
Created: 2013-12-06
| Last updated: 2014-11-04
Uploader
Project
evaluate_model
(9)
Evaluates a model, returning model values for a given set of points and layers.
Created: 2013-12-10
| Last updated: 2014-12-04
Comments (0)
No comments yet
Log in to make a comment