Select to view content in your preferred language

Count visible Features of LayerDefinition

574
2
10-13-2011 01:27 AM
UlfGrimhardt
Deactivated User
Hi,

Is there a way to get or create a list of those features that are still visible after using the LayerDefinition?
Or is it at least possible to count the number of visible features?
0 Kudos
2 Replies
SanajyJadhav
Deactivated User
I don't think there would be any straight way to do this.

One way would be:
1. Get all features count by querying the layer
2. Get features count by using your definition expression.
3. Subtract the #2 from #1.

Sanjay.
0 Kudos
MiriEshel
Esri Contributor
Hi,

Is there a way to get the number of visible features using LayerDefinition?

My Code is:
           dynLayer = Map.Layers["SelectedActivities"] as ArcGISDynamicMapServiceLayer;
            dynLayer.LayerDefinitions.Clear();
            LayerDefinition ld = new LayerDefinition();
            ld.LayerID = 0;
            ld.Definition = q;
            dynLayer.LayerDefinitions.Add(ld);
            dynLayer.Refresh();

I want to know how many where selected by the query q.
I don't want to use queryTask because there can be much more than the maxRecordCount (1000).
I can add a query to the Database directly (SQL Server) but I prefer not to.

Is there a way to do it?

Thanks a lot,
Miri

Miri Eshel,
Systematics LTD.
Israel
0 Kudos