Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 ArcGis10 and c#. Tks

share|improve this question
2  
How do you want to handle islands (interior rings)? –  Kirk Kuykendall Apr 17 '12 at 20:23
    
Curious if there a non-GP way to do this in ArcObjects? –  blah238 Apr 19 '12 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. –  Rich Wawrzonek Apr 20 '12 at 20:46

2 Answers 2

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.

share|improve this answer

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

Here's a Getting started article about using Geoprocessor.

share|improve this answer
    
I just solved my problem using the following code. It works exactly the way a need. gis.stackexchange.com/questions/1610/… –  Carol Apr 18 '12 at 12:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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