FeatureLayer -- Can I get all features programmatically

3381
4
01-03-2013 08:28 AM
Labels (1)
MarkParr
New Contributor
I am working on embedding a Runtime Map into a WPF application that I am working on.  This is my first WPF Runtime attempt so I am learning as I go.  Currently, my mapping data source is a SQL Server based ArcGIS Server from which I am using REST services to retrieve various layers.  I am aware of the ArcGIS Service "Maximum Number of Records Returned by Server" Parameter I have played with that and got the desired result of retrieving all of my centerline features.  Initially the default 1000 was the setting and the layer in question has 3300+ features.  I bumped the parameter to 4000 and all was well.

However, what I want to know is if there is a way to get all of the features programmatically?

When using Visual Studios to define a FeatureLayer via the property editor, the URL dialog shows all of the features even when the Service Parameter was set to 1000.  I have attached a picture showing this.  Since Visual Studios is showing all of the features, can I?

Thanks
Mark


[ATTACH=CONFIG]20408[/ATTACH]
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
If you only need to display the features you can use an ArcGISDynamicMapServiceLayer that is not impacted by the max records setting since it's just returning an image.

With a feature layer, one option is to use the 'OnDemand' mode so the features will be loaded using the current map extent as filter. However if you zoom out, you can't be sure that all features are loaded.

To get all features programmatically, you can't overcome the max records parameter. So you wont be able to get all features with one request only.
The workaround may be to execute multiple queries with different where clauses allowing to get all features at the end.
For example using a query by state (or another app field) if you know that the number of features by state is not greater than the max or ,more generic, using the objectID (sorting by object ID and each query having a where clause to return objectID > objectid of last graphic returned).
0 Kudos
MarkParr
New Contributor
Does anyone know how the Visual Studios Designer Interface is handling the layer display as shown in the attached picture?  Are they using the ArcGISDynamicMapServiceLayer to access the layer image even though the selected layer type is FeatureLayer?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Does anyone know how the Visual Studios Designer Interface is handling the layer display as shown in the attached picture?  Are they using the ArcGISDynamicMapServiceLayer to access the layer image even though the selected layer type is FeatureLayer?

Yes the service explorer used at design time displays the feature layers using an ArcGISDynamicMapServiceLayer  since we don't need to access individual features.
0 Kudos
MarkParr
New Contributor
Yes the service explorer used at design time displays the feature layers using an ArcGISDynamicMapServiceLayer  since we don't need to access individual features.


Thanks for the info.  That explains what I thought might be happening.  I will explore your various suggestions as feature information/details will be needed -- so just an image display will not be sufficient.

Mark
0 Kudos