Docs List
selectByLocation(option)
Select the desired layer features by location. After the process is finished, results are appeared as a new vector layer.
Parameters:
options (FormData)
| Name | Description | 
|---|---|
| 
 input_layer_uuid 
String 
 | 
uuid of the vector layer or vector layer view that you want to select features from | 
| 
 input_layer_is_view 
Bolean 
Deafult: false 
 | 
If uuid is for a vector layer, this parameter should be false and if uuid is for a vector layer view, this parameter should be true. | 
| 
 spatial_predicate 
String 
 | 
Choices are ‘Contains’, ‘Crosses’, ‘Disjoint’, ‘Equals’, ‘Intersects’, ‘Overlaps’, ‘Touches’, ‘Within’. | 
| 
 target_layer_uuid 
String 
 | 
uuid of the vector layer or vector layer view that you want to select features considering spatial relationship. | 
| 
 target_layer_is_view 
Bolean 
Deafult: false 
 | 
If uuid is for a vector layer, this parameter should be false and if uuid is for a vector layer view, this parameter should be true. | 
| 
 out_layer_name 
String 
 | 
Name of new layer for selection results. | 
| 
 run_async 
Boolean 
Default: true 
 | 
If true, the process will be doing as a task, otherwise object will be returned directly. | 
| 
 user_id 
Number? 
 | 
If the admin wants to do selection geoprocessing for a vector layer or vector layer view of a certain user, this parameter determines which user is the target user. | 
Returns:
Object: Returns task id to manage task.
Example:
First, create a FormData. Then add the values.
let formData = new FormData();
formData.append('input_layer_uuid', '4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
formData.append('input_layer_is_view', false);
formData.append('spatial_predicate', 'Intersects');
formData.append('target_layer_uuid', '4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
formData.append('target_layer_is_view', true);
formData.append('out_layer_name', 'select_intersects');
formData.append('user_id', 2);
const newSelectedLayer = await Server.selectByLocation(formData);