ClipPolygonWithPolygon

Sep 24, 2012 at 12:41 PM

Hi,

 

I've a problem with this function. See below my source code :

 

Dim fs1 As DotSpatial.Data.FeatureSet
            fs1 = New DotSpatial.Data.FeatureSet
            fs1 = FeatureSet.Open("C:\TEST\PolyAll.shp")

            Dim fs2 As DotSpatial.Data.FeatureSet
            fs2 = New DotSpatial.Data.FeatureSet
            fs2 = FeatureSet.Open("C:\TEST\PolyBorder.shp")

            Dim fs3 As DotSpatial.Data.FeatureSet
            fs3 = New DotSpatial.Data.FeatureSet(Topology.FeatureType.Polygon)

            Dim ClipTool = New DotSpatial.Tools.ClipPolygonWithPolygon
            Dim Status As Boolean = ClipTool.Execute(fs1, fs2, fs3, Nothing)

            fs3.SaveAs("C:\TEST\ClipPoly.shp", True)

 

I have the following error :

System.IO.IOException: The specified file type is not supported.
   à DotSpatial.Data.DataManager.CreateVector(String fileName, FeatureType featureType, IProgressHandler progHandler) dans c:\dev\DotSpatial\DotSpatial.Data\DataManager.cs:ligne 168
   à DotSpatial.Data.FeatureSet.SaveAs(String fileName, Boolean overwrite) dans c:\dev\DotSpatial\DotSpatial.Data\FeatureSet.cs:ligne 911
   à DotSpatial.Tools.ClipPolygonWithPolygon.Execute(IFeatureSet input, IFeatureSet input2, IFeatureSet output, ICancelProgressHandler cancelProgressHandler) dans c:\dev\DotSpatial\DotSpatial.Tools\ClipPolygonWithPolygon.cs:ligne 150
   à GISProject.Form1.test() dans C:\Documents and Settings\user\Mes documents\Visual Studio 2010\Projects\GISProject\GISProject\Form1.vb:ligne 103

 

Could you give me an example to use this function?

 

LS