Thinning

Roads and highways in Singapore. Zoom in and out to view how features are thinned based on highway classification. Only larger, more traveled highways display at small scales. This reduces the initial download size and declutters the visualization.

What is thinning?

Thinning is a method of decluttering the view by removing features that overlap one another. This is helpful when many features overlap and you want to display uncluttered data, but don't necessarily need to communicate its density.

How thinning works

There are a couple of approaches to thinning:

  1. Feature reduction by selection only applies to point layers in 3D scenes and is configured on the featureReduction property of the layer. When set, overlapping features are randomly removed from the view and displayed at scales and camera angles where they no longer overlap nearby features.
  2. Display filters control which features are displayed in the view based on the view scale. This is useful for reducing the download size of large layers and improving the visualization, particularly for mobile devices.

Examples

Feature reduction by selection (3D)

The following example demonstrates how to declutter the view by randomly removing overlapping features. This is controlled using the FeatureReductionSelection option on point layers in 3D scenes. Simply set the featureReduction type on the layer to selection and features will be thinned automatically.

Points of interest in Lyon, France. Thinning helps declutter the view to make it easier for users to navigate a scene. Uncheck the box in the top right corner to compare the cluttered view with the decluttered view. Zoom in and out to see how feature reduction selection affects the visualization.
ArcGIS JS API
Expand
Use dark colors for code blocksCopy
174 175 176
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
        pointsLayer.featureReduction = {
          type: "selection"
        };
Expand

Display filter

This example demonstrates how to set a display filter on a layer to control which features are visible based on the view scale. This is useful for reducing the download size of large layers, particularly for mobile devices.

Roads and highways in Singapore. Zoom in and out to view how features are thinned based on highway classification. Only larger, more traveled highways display at small scales. This reduces the initial download size and declutters the visualization.

For example, the OpenStreetMap Asia highways layer contains more than 46 million high resolution line features with more than 20 attributes. Since this layer requires several gigabytes of memory to draw all features, it isn't feasible to load the entire dataset to a browser.

Thinning this data with a display filter can significantly improve the initial download size and the visualization.

ThinningNo thinning
Initial download size141kB (27.8kB compressed)12.2MB (2.1MB compressed)
Preview thinned not thinned

First, you should set scale visibility constraints to restrict the entire layer visibility at scales best suited given the density of the data. This is controlled by the minScale and maxScale properties of the layer.

ArcGIS JS API
Expand
Use dark colors for code blocksCopy
30 31 32 33 34 35 36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
      const highwaysLayer = new FeatureLayer({
        portalItem: {
          id: "a9f8d83a69fc4f2c92e5f83f87df6aaf"
        },
        minScale: 1000000,
        maxScale: 0,
      });
Expand

While this will prevent users from loading unreasonable amounts of data to the browser, it still may not be aggressive enough, especially for mobile devices. You can further reduce download size by filtering features dynamically via the displayFilterInfo property of the layer. Simply set the mode of the display filter to scale, then provide an array of scale ranges and SQL where clauses to filter features based on the given scale range.

Notice how each filter is more inclusive of road types as the scale ranges represent larger scales. This means as the user zooms in, they will see more detailed road types. And as they zoom out, the detail will be filtered out.

ArcGIS JS API
Expand
Use dark colors for code blocksCopy
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
      highwaysLayer.displayFilterInfo = {
        mode: "scale",
        filters: [
          {
            title: "Large highways",
            minScale: Infinity,
            maxScale: 150000,
            where: "highway IN ('motorway')"
          },
          {
            title: "Small highways",
            minScale: 150000,
            maxScale: 60000,
            where: "highway IN ('motorway', 'trunk', 'trunk_link')"
          },
          {
            title: "Major roads",
            minScale: 60000,
            maxScale: 45000,
            where: "highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link')"
          },
          {
            title: "Roads",
            minScale: 45000,
            maxScale: 30000,
            where: "highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link')"
          },
          {
            title: "Smallest roads",
            minScale: 30000,
            maxScale: 10000,
            where: "highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link')"
          },
          {
            title: "all",
            minScale: 10000,
            maxScale: 0
          }
        ]
      };
Expand

API support

The following table describes the geometry and view types that are suited well for each visualization technique.

2D3DPointsLinesPolygonsMeshClient-sideServer-side
Clustering
Binning
Heatmap
Opacity
Bloom
Aggregation
Thinning11123
Visible scale range
Full supportPartial supportNo support
  • 1. Feature reduction selection not supported
  • 2. Only by feature reduction selection
  • 3. Only by scale-driven filter

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.