2

I have a multipart feature and I need to convert it to a singlepart feature.

Couldn't find any code sample.

I wonder if i could get some help from you?

I'm working with ArcGIS 10 and c#.

3
  • 2
    How do you want to handle islands (interior rings)? Commented Apr 17, 2012 at 20:23
  • Curious if there a non-GP way to do this in ArcObjects?
    – blah238
    Commented Apr 19, 2012 at 6:41
  • 2
    You can do this w/o the GP. Cast the feature's shape to IGeometryCollection and then check the GeometryCount property to see if it is a multipart feature. Then you will need to create a new feature class to write each part to. Loop the feauture's individual parts using IEnumGeometry and IGeometryBag. Commented Apr 20, 2012 at 20:46

2 Answers 2

1

ArcGIS has a tool: "Multipart to SinglePart".


This can be called with Python or JScript:

import arcgisscripting //not needed for JScript

gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")

gp.MultipartToSinglepart_management("", Output_Feature_Class)


Alternately VBScript:

gp.AddToolbox "C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx"

gp.MultipartToSinglepart_management "", Output_Feature_Class

Not sure how to do it with C#, but I guess you could call one of those languages with it.

0
1

You can use Geoprocessor object to access geoprocessing tools (in this case MultipartToSinglepart).

Here's a Getting started article about using Geoprocessor.

1

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