Skip to content

Commit 79f1096

Browse files
author
Rachael Ellen
committed
Merge branch 'main' into v.next
2 parents 201accb + fb5bbf3 commit 79f1096

File tree

18 files changed

+339
-207
lines changed

18 files changed

+339
-207
lines changed
Binary file not shown.
Binary file not shown.

feature_layers/feature-layer-definition-expression/README.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

feature_layers/feature-layer-definition-expression/README.metadata.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

feature_layers/feature-layer-definition-expression/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

feature_layers/feature-layer-definition-expression/src/main/java/com/esri/samples/feature_layer_definition_expression/FeatureLayerDefinitionExpressionLauncher.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

feature_layers/feature-layer-definition-expression/src/main/java/com/esri/samples/feature_layer_definition_expression/FeatureLayerDefinitionExpressionSample.java

Lines changed: 0 additions & 132 deletions
This file was deleted.
347 KB
Loading
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Filter by definition expression or display filter
2+
3+
Display features on a map using a definition expression or a display filter.
4+
5+
![Image of filter by definition expression or display filter](FilterByDefinitionExpressionOrDisplayFilter.png)
6+
7+
## Use case
8+
9+
Definition queries allow you to define a subset of features to work with in a layer by filtering which features are retrieved from the dataset by the layer. This means that a definition query affects not only drawing, but also which features appear in the layer's attribute table and therefore which features can be selected, labeled, identified, and processed by geoprocessing tools.
10+
11+
Alternatively, display filters limit which features are drawn, but retain all features in queries and when processing. Definition queries and display filters can be used together on a layer, but definition queries limit the features available in the layer, while display filters only limit which features are displayed.
12+
13+
## How to use the sample
14+
15+
In this sample you can filter a dataset of tree quality selecting for only those trees which require maintenance or are damaged.
16+
17+
Click the 'Apply definition expression' button to limit the features requested from the feature layer to those specified by the SQL query definition expression. This option not only narrows down the results that are drawn, but also removes those features from the layer's attribute table.
18+
19+
To filter the results being drawn without modifying the attribute table, click the 'Apply display filter' button.
20+
21+
Click the 'Reset' button to remove the definition expression or display filter on the feature layer, and return all records.
22+
23+
The feature count value shows the current number of features in the current map view extent. When a definition expression is applied to narrow down the list of features being drawn, the count is updated to reflect this change. However if a display filter is applied, the features which are not visible on the map will still be included in the total feature count.
24+
25+
## How it works
26+
27+
1. Create a feature layer from a service feature table (from a URL).
28+
2. Filter features on your feature layer using a `DefinitionExpression` to view a subset of features and modify the attribute table.
29+
3. Filter features on your feature layer using a `DisplayFilter` to view a subset of features without modifying the attribute table.
30+
31+
## Relevant API
32+
33+
* DefinitionExpression
34+
* DisplayFilter
35+
* FeatureLayer
36+
* ServiceFeatureTable
37+
38+
## About the data
39+
40+
The [San Francisco 311 incidents layer](https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/arcgis/rest/services/SF_311_Incidents/FeatureServer/0) in this sample displays point features related to crime incidents such as graffiti and tree damage that have been reported by city residents.
41+
42+
## Tags
43+
44+
definition expression, display filter, filter, limit data, query, restrict data, SQL, where clause
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"category": "Feature layers",
3+
"description": "Display features on a map using a definition expression or a display filter.",
4+
"ignore": false,
5+
"images": [
6+
"FilterByDefinitionExpressionOrDisplayFilter.png"
7+
],
8+
"keywords": [
9+
"definition expression",
10+
"display filter",
11+
"filter",
12+
"limit data",
13+
"query",
14+
"restrict data",
15+
"SQL",
16+
"where clause",
17+
"DefinitionExpression",
18+
"DisplayFilter",
19+
"FeatureLayer",
20+
"ServiceFeatureTable"
21+
],
22+
"redirect_from": [
23+
"/java/latest/sample-code/feature-layer-definition-expression.htm",
24+
"/java/sample-code/feature-layer-definition-expression/"
25+
],
26+
"relevant_apis": [
27+
"DefinitionExpression",
28+
"DisplayFilter",
29+
"FeatureLayer",
30+
"ServiceFeatureTable"
31+
],
32+
"snippets": [
33+
"src/main/java/com/esri/samples/filter_by_definition_expression_or_display_filter/FilterByDefinitionExpressionOrDisplayFilterSample.java"
34+
],
35+
"title": "Filter by definition expression or display filter"
36+
}

0 commit comments

Comments
 (0)