Hello,
We have recently upgraded our library from MapSuite 7 to MapSuite 9. We have faced a couple of issues which we are following them in different topics.
I use below snippet to load a ShapeFile and read feature’s column value:
var shapeFile = @“Med2_Soton.shp”;var featureLayer =newShapeFileFeatureSource(shapeFile);featureLayer.Open();var allFeatures = featureLayer.GetAllFeatures(ReturningColumnsType.AllColumns);var columns = featureLayer.GetColumns();var columnName = columns[0].ColumnName;
foreach(var valueinallFeatures.Select(feature => feature.ColumnValues[columnName])){Console.WriteLine(value);}
This code works fine with MapSuite 7 but not works with MapSuite 9 and throws the below exception:
Well, it says:
The given key was not present in the dictionary
I am sure the feature got the selected column, on the flip side, this code works perfectly with the MapSuite 7.
I’ve created a light sample to show the error, also, Haven’t deleted the binary files from bin folder in case you are wondering which version of MapSuite I am using.
Regards,
Shahin
Thinkgeo9ShapeFileReader.zip (1.95 MB)