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#.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Carol
  • 21
  • 2
  • 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 06: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 Answers2

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.

GIS-Jonathan
  • 6,775
  • 5
  • 29
  • 58
1

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

Here's a Getting started article about using Geoprocessor.

Marcin
  • 1,821
  • 1
  • 16
  • 27
  • I just solved my problem using the following code. It works exactly the way a need. http://gis.stackexchange.com/questions/1610/issues-with-geoprocessing-with-net – Carol Apr 18 '12 at 12:34