Writing code using C# and the DotSpatial library, with the following code:

FeatureSet fs = new FeatureSet(FeatureType.Polygon);
        fs = FeatureSet.Open(Application.StartupPath + "\\MapFile\\Land.shp");

I get this error message:

Cannot implicitly convert type 'DotSpatial.Data.IFeatureSet' to 'DotSpatial.Data.FeatureSet'. An explicit conversion exists (are you missing a cast?)
  • i dont know whether i am missing a cast.. – ZAJ Nov 10 '15 at 10:27

Have you tried:

var featureSet = FeatureSet.Open(Application.StartupPath + "\\MapFile\\Land.shp")

DotSpatial loads shape files by default.

fs = (FeatureSet)FeatureSet.Open(Application.StartupPath + "\\MapFile\\Land.shp");
  • Please include a bit more info about where and how to use, and perhaps even explanation about why this would work. – Midavalo Jun 18 '16 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.