0

How can I read the geometry type of shapefiles with ArcObjects and Vbnet?

I want to check whether it is a point, polygon, or a line.

1

include ESRI.ArcGIS.DatabaseSourcesFile in your project here is a C# code showes you how to open a shape file,you can convert it to VB.Net simply

IWorkspaceFactory ipShapeWF = new ShapefileWorkspaceFactoryClass();
`//strfilepath the path to shape file,include only folder not shape file itself'
IWorkspace ipShapeWS = ipShapeWF.OpenFromFile(strfilepath, 0);

IFeatureWorkspace ipFW = (IFeatureWorkspace)ipShapeWS;

IFeatureClass ipFC = ipFW.OpenFeatureClass("shapefilename");

MessageBox.Show(ipFC.ShapeType.ToString());

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.