crash in ExecuteIntersectionQuery in mapBox1_MouseUp

Topics: WinForms Controls
Oct 15, 2012 at 8:02 AM

Hello I am a newbie with sharpmap, it is really an amazing project.

I want to get info at a point in s57 map, the i use is a NOOA map from NY "US5NY1DM.000".

In the map i trap MouseUp event with the code below:

it crashes at   layer.DataSource.ExecuteIntersectionQuery(punkt, ds);

with the error Input string was not in a correct format.Couldn't store <Quality of data defined at a larger scale> in CATZOC Column.  Expected type is Int32.

  private void mapBox1_MouseUp(Point worldPos, MouseEventArgs imagePos)
  //            DoTrueIntersectionQuery
           foreach (SharpMap.Layers.VectorLayer layer in map.Layers)
               SharpMap.Data.FeatureDataSet ds = new SharpMap.Data.FeatureDataSet();
                if (!layer.DataSource.IsOpen)
                var p = mapBox1.Map.ImageToWorld(imagePos.Location);
                SharpMap.Geometries.Point punkt = mapBox1.Map.ImageToWorld(imagePos.Location);
             //  SharpMap.Geometries.Point punkt2 = new SharpMap.Geometries.Point(worldPos.GetBoundingBox);
             //   if (layer.LayerName == "LNDARE" || prov.LayerName == "LNDARE")
//        if (layer.LayerName=="Layer_LNDARE")
//        {
        layer.DataSource.ExecuteIntersectionQuery(punkt, ds);
            foreach (SharpMap.Data.FeatureDataRow feat in ds.Tables[0])
                foreach (Object ob in feat.ItemArray)

//          }



Regards Peder