2

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?)
1
  • i dont know whether i am missing a cast..
    – ZAJ
    Commented Nov 10, 2015 at 10:27

2 Answers 2

1

Have you tried:

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

DotSpatial loads shape files by default.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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