usmanj1

Create thiessen Polygon not working!!

Discussion created by usmanj1 on Sep 30, 2010
Hello every one.. i am facing a problem in using CreateThiessenPolygon. i am using the code mentioned hereunder for the same, the code runs and executes without any error, but the problem is that it creates an empty point shape file as an out put.. can any one please help me the issue??

Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            IMap pMap = axMapControl1.Map;
            IFeatureLayer inputfeaturelayer = pMap.get_Layer(this.getLayerID("Points")) as IFeatureLayer;
            //IFeatureLayer cliplayer = pMap.get_Layer(this.getLayerID("Sector")) as IFeatureLayer;
            IFeatureClass inputfeatureclass = inputfeaturelayer.FeatureClass;
            //IFeatureClass clipfeatureclass = cliplayer.FeatureClass;
            IDataset dataset = inputfeatureclass as IDataset;
            IWorkspace workspace = dataset.Workspace;
            IFeatureWorkspace fworkspace = workspace as IFeatureWorkspace;
            IFields outfields = inputfeatureclass.Fields;
            IFeatureClass outfeatureclass = fworkspace.CreateFeatureClass("Thiessen", outfields, null, null, esriFeatureType.esriFTSimple, "Shape", "");

ESRI.ArcGIS.AnalysisTools.CreateThiessenPolygons clipTool = new ESRI.ArcGIS.AnalysisTools.CreateThiessenPolygons(inputfeatureclass, outfeatureclass);

gp.Execute(clipTool, null);

IFeatureLayer outlayer = new FeatureLayerClass();
            outlayer.FeatureClass = outfeatureclass;
            outlayer.Name = outfeatureclass.AliasName;
            pMap.AddLayer((ILayer)outlayer);
            axMapControl1.Refresh();

Attachments

Outcomes