featureReduction not working

309
3
07-26-2021 08:43 AM
MichaelK1
New Contributor

I'm trying to add feature reduction / clustering for my feature layer but it's not working

My featureLayer looks like this:

new FeatureLayer({
objectIdField: 'OBJECTID',
geometryType: 'point',
source: [],
fields: [
{
name: 'OBJECTID',
type: 'oid',
},
{
name: 'ASSID',
type: 'string',
},
{
name: 'cluster_count',
type: 'integer',
},
],
featureReduction: {
type: 'cluster',
clusterRadius: '0.2', // using other values like 10 or 10px doesn't change the outcome
popupTemplate: {
title: 'Cluster summary',
content: 'This cluster represents {cluster_count} earthquakes.',
fieldInfos: [
{
fieldName: 'cluster_count',
format: {
places: 0,
digitSeparator: true,
},
},
],
},
},
renderer: {
id: 'simple',
type: 'simple',
symbol: {
type: 'point-3d', // autocasts as new PointSymbol3D()
symbolLayers: [
{
type: 'icon',
size: 10,
resource: { primitive: 'circle' },
material: { color: '#1B243D' },
},
],
},
}});

 I'm using applyEdits to dynamic add or update features based on web socket data..

cluster.png

all dynamic added features have unique OBJECTID's so I have no idea why it's not clustering,


Should I recalculate the entire cluster after applyEdits?

Thanks

0 Kudos
3 Replies
ReneRubalcava
Frequent Contributor

I see in your snippet you're trying to use PointSymbol3D. Are you using SceneView? Clustering is not currently supported in 3D. 3D supports "selection", which will remove overlapping features so it's less cluttered, but not clustering of features.

It's in the FeatureReduction doc.

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureReductionCl...

ReneRubalcava_0-1627318188089.png

 

 

MichaelK1
New Contributor

Oh okay! Are they working on it ? 

Is there any way to add cluster/selection size (text label) in sceneview ?


0 Kudos
RalucaNicola1
Esri Contributor

As Rene mentioned, clustering is not supported in a sceneview and it's on our feature list, but it's not planned for this year.