Geometry type does not match the geometry field.

2906
3
05-31-2016 04:48 PM
SaurabhGupta1
New Contributor

I have created .geodatbase using the ArcGIS Runtime content ( Ver 10.2.1) but when I am trying to add this for offline method this is giving me "Geometry type does not match the geometry field." error.

var gdb3 = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(@".geodatabase");

                foreach (var table in gdb3.FeatureTables.ToList())

                {

                    // create a new feature layer to display each table

                    var lyr = new FeatureLayer

                    {

                        ID = table.Name + "Offline3",

                        DisplayName = table.Name,

                        FeatureTable = table

                    };

                    // add each layer to the map

                    MyMapView.Map.Layers.Add(lyr);

                }

Tags (1)
0 Kudos
3 Replies
YuanLiu
Occasional Contributor

Hi, did you miss any code when pasting it here? Seems like the lyr object is still a new feature layer, and nothing has been assigned to it before added to the map.

0 Kudos
SaurabhGupta1
New Contributor

Hi Yuan,

nothing is missing in code. This is giving error when open the geodatabase at very first line

"var gdb3 = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(@".geodatabase");"

and assigned the below properties when create the FeatureLayer.

var lyr = new FeatureLayer

                    {

                        ID = table.Name + "Offline3",

                        DisplayName = table.Name,

                        FeatureTable = table

                    };

0 Kudos
YuanLiu
Occasional Contributor

Oops, my bad. I see it now

0 Kudos