Select to view content in your preferred language

Clustering fails using FeatureLayer/OnDemand with 1,000+ features

1372
6
10-04-2010 01:11 PM
StephenDavis
Emerging Contributor
Here is how to duplicate this issue:  Create a WPF or silverlight app and put a map in it with a feature layer that points to a service where you have set the maximum number of records higher than 1,000.  I set mine to 2,000.  You'll actually need more than 1,000 records in the layer you are pointing to in order to duplicate this, and it's much easier to see if you put a clusterer on it.  Set the mode to OnDemand and then start the application.  So, the xaml would look like this:


        <ESRI:Map>
            <ESRI:Map.Layers>
                <ESRI:ArcGISTiledMapServiceLayer
                    ID="BaseMap"
                    Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"
                    />
                <ESRI:FeatureLayer x:Name="FLayer"
                                   Where=""
                                   Url="http://localhost/ArcGIS/rest/services/Untitled/MapServer/0" Mode="OnDemand">
                    <ESRI:FeatureLayer.Clusterer>
                        <ESRI:FlareClusterer Radius="8" FlareBackground="Red" FlareForeground="White"></ESRI:FlareClusterer>
                    </ESRI:FeatureLayer.Clusterer>
                </ESRI:FeatureLayer>
            </ESRI:Map.Layers>
        </ESRI:Map>

When the map loads you see all of the clusters.  If you pan the map a little in different directions; each time the number on the cluster increases by the same amount it started with.  You can keep panning back and forth and increase the numbers infinitely.

After doing some investigation, I have found that when the feature layer queries the service it appends a "NOT IN" clause to the end of the where clause so that it doesn't pull down features it has already retrieved.  However, it will never list more than 1,000 IDs in the NOT IN clause and therefore repeatedly duplicates features and their counts on the cluster.  I have checked that there isn't a limitation in the POST event preventing more from being passed.

Can anyone else duplicate this issue?  For us, this basically renders the featurelayer+clustering useless, and it is 90% of what we are trying to do.  Is this a known issue?  And if so, is there a fix in the works?  We want to create a WPF application that basically deals with 10,000 features at a time and I noticed it mentioned in a previous post that testing was done with 25,000+ in the feature layer.  Maybe that wasn't in OnDemand mode though.  I also tried disabling the client cache and that did not help the situation.

Any help would be greatly appreciated. 

Thanks!
Stephen
0 Kudos
6 Replies
AnandUpadhya
Emerging Contributor
Try setting the number of results returned by the map service in service properties. It is set to 1000 by default. I had like 12000 features to cluster and it would only bring out 1000 so i changed it and it worked fine.

But i am not sure how much resources this will use.

Anand
0 Kudos
StephenDavis
Emerging Contributor
The first sentence in my description refers to me already setting the service definition number of records to higher than 1,000.  In fact that is the only way you can reproduce this issue.  the issue is that ESRI's feature layer repeats points everytime you pan infinitely until Internet Explorer runs out of RAM.  Everytime you pan the map and keep the clusters in the map's extent, they increase by the number of records at that spot.
0 Kudos
SteeveCouture
Emerging Contributor
Hi Stephen,

Did you find an answer to your problem (FeatureLayer - onDemand)?

Thanks,
Steeve
0 Kudos
dotMorten_esri
Esri Notable Contributor
This is a limitation on the server where there's a limit to the number of NOT INs you can can have (well technically a limitation in the geodatabase), and therefore the client will limit the amount of object ids to send.
We do not recommend using OnDemand mode and Clustering together. They are there to solve the same problem in two different ways. Clustering should only be used with SnapShot mode where you would get a predictable behavior.
0 Kudos
JasonThiel
Emerging Contributor
Ok, how does "onDemand" solve the problem in a different way?
0 Kudos
DanielWalton
Frequent Contributor
I'm no expert on the topic, but I believe Morten is referring to the "problem" of having too many graphic objects in your visual tree and the UX and performance suffering as a consequence. Clustering reduces the number of symbols directly in the client, whereas the FeatureService OnDemand mode only downloads the graphics from the server that are defined for your current view. The latter would obviously work best for services that have layers limited by map zoom level, so you don't get all the features at once.
0 Kudos