10.2.7 ServiceFeatureTable Unable to load data

476
4
Jump to solution
09-18-2020 09:51 AM
CharlesNg
New Contributor

I was trying to load data from this feature service  "https://services.arcgis.com/BLN4oKB0N1YSgvY8/ArcGIS/rest/services/CalOES_California_Webcams/FeatureServer/1" into a ServiceFeatureTable object, the 10.2.7 .Net runtime threw the following exception:

Microsoft C++ exception: Esri_runtimecore::Geodatabase::Field_not_found_exception at memory location 0x000000922D63D030.


The object was unable to get any data from the service.   I'm on VS Community 2017 v15.9.26 and .Net 4.6.2.
The other services from the same server are working fine.  Is it possible solving it without upgrading to 100.1 or above?

Thank you for your help.

0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor

Hi,

Unfortunately I too found that when using 10.2.7 with that service the ServiceFeatureTable fails to initialize (with the exception you observed). I was unable to identify what is specific to your service that is causing the issue (I compared your service with a variety of similar hosted feature services, including services based on views, and they all initialized and displayed).

100.x does successfully load and display this service. 

Here's a potential workaround you could use:

Map map = new Map
{
    SpatialReference = SpatialReferences.WebMercator,
};

MyMapView.Map = map;
MyMapView.Map.Layers.Add(new ArcGISTiledMapServiceLayer(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer")));

var queryTask = new QueryTask(new Uri("https://services.arcgis.com/BLN4oKB0N1YSgvY8/ArcGIS/rest/services/CalOES_California_Webcams/FeatureServer/1"));
var queryResult = await queryTask.ExecuteAsync(new Query("1=1"));
var features = queryResult.FeatureSet.Features;
var graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.Graphics.AddRange(queryResult.FeatureSet.Features.OfType<Graphic>());

SimpleRenderer simpleRenderer = new SimpleRenderer() 
{
    Symbol = new SimpleFillSymbol() 
    {
        Color = Color.FromArgb(0, 92, 230, 49),
        Outline = new SimpleLineSymbol() 
        {
            Color = Color.FromArgb(110, 110, 110, 0),
            Style = SimpleLineStyle.Solid,
            Width=0.7
        }

    }
};
graphicsOverlay.Renderer = simpleRenderer;
MyMapView.GraphicsOverlays.Add(graphicsOverlay);

View solution in original post

4 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

That error could indicate that a field used for the renderer or label definition is not part of the layer's schema, although the service info (below) shows that it's just a simple renderer with no labels.

`{"renderer":{"type":"simple","symbol":{"type":"esriSFS","style":"esriSFSSolid","color":[0,92,230,49],"outline":{"type":"esriSLS","style":"esriSLSSolid","color":[110,110,110,0],"width":0.7}}},"scaleSymbols":true,"transparency":0,"labelingInfo":null}‍`


In your code are you applying a renderer or label definition?

You could also try request all fields e.g.

`myServiceFeatureTable.OutFields = Esri.ArcGISRuntime.Tasks.Query.OutFields.All;` 

Thanks

Mike

0 Kudos
CharlesNg
New Contributor

Thank you, Mike. I followed the suggestion to set the table object's property to equest all fields but still, the problem occurred, and the table was not populated.   I didn't apply a renderer or label definition to the layer object in my code.  Were you able to replicate it in 10.2.7?

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Unfortunately I too found that when using 10.2.7 with that service the ServiceFeatureTable fails to initialize (with the exception you observed). I was unable to identify what is specific to your service that is causing the issue (I compared your service with a variety of similar hosted feature services, including services based on views, and they all initialized and displayed).

100.x does successfully load and display this service. 

Here's a potential workaround you could use:

Map map = new Map
{
    SpatialReference = SpatialReferences.WebMercator,
};

MyMapView.Map = map;
MyMapView.Map.Layers.Add(new ArcGISTiledMapServiceLayer(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer")));

var queryTask = new QueryTask(new Uri("https://services.arcgis.com/BLN4oKB0N1YSgvY8/ArcGIS/rest/services/CalOES_California_Webcams/FeatureServer/1"));
var queryResult = await queryTask.ExecuteAsync(new Query("1=1"));
var features = queryResult.FeatureSet.Features;
var graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.Graphics.AddRange(queryResult.FeatureSet.Features.OfType<Graphic>());

SimpleRenderer simpleRenderer = new SimpleRenderer() 
{
    Symbol = new SimpleFillSymbol() 
    {
        Color = Color.FromArgb(0, 92, 230, 49),
        Outline = new SimpleLineSymbol() 
        {
            Color = Color.FromArgb(110, 110, 110, 0),
            Style = SimpleLineStyle.Solid,
            Width=0.7
        }

    }
};
graphicsOverlay.Renderer = simpleRenderer;
MyMapView.GraphicsOverlays.Add(graphicsOverlay);
CharlesNg
New Contributor

Awesome, this is exactly what I needed.  Thank you so much for your help!  

0 Kudos