4

The ArcMap Properties dialog does not indicate if a shapefile contains multipart or singlepart polygons. Is there some other way to identify if a polygonal shapefile (or any feature class, for that matter) contains singlepart or multipart?

  • 1
    All polyline and polygon (and mulipoint) shapefiles can be multipart. You need to scan the file and detect ring count (and ring direction, since a polygon with "holes" (interior rings) is not multipart). – Vince Aug 28 '16 at 12:39
5

For ArcGIS v. 10.1 and older I'd create new field of integer type and populate it using:

 !Shape!.partCount

Note parser is set to Python.

It is much faster with Add Geometry Attributes tool available in newer versions of ArcGIS. Tool creates required field for you. This is how attributes on offer look like for multipart point input: enter image description here

I found this tool very useful in general, e.g. see option selected below in the list available for polygon input:

enter image description here

  • I use this method too. – Fezter Aug 28 '16 at 23:45
  • @Fezter it is good isn't it! Near impossible to replicate in python, though I remember using label placement or similar before – FelixIP Aug 29 '16 at 1:46
0

With a Data Reviewer license you can use the Multipart Polygon Check:

The Multipart Polygon check finds multipart polygon features and writes them to the Reviewer table as records. The check can be run on an entire feature class, a subtype, or a set of features selected using a SQL query.

Without that license the way I would do it is to:

  1. Use Get Count to count how many polygons are in a shapefile
  2. Run Multipart to Singlepart on the shapefile
  3. Use Get Count to count how many polygons are in the output from Multipart to Singlepart

If the two counts are the same then your shapefile had no multipart polygons. If there are more in the output from Multipart to Singlepart then your shapefile had some multiparts

  • Add geometry attributes tool has option part count – FelixIP Aug 28 '16 at 6:14
  • In older than 10.2 one can use !Shape!.partCount to populate new field – FelixIP Aug 28 '16 at 6:20
  • @FelixIP By all means post an answer, I wanted to just show my first thoughts in this one. – PolyGeo Aug 28 '16 at 7:09
0

Here's a little python script you can just run in ArcMap, just put in the name of the layer at the top of the script and run. Will tell you what features are multi-part.

fc_name = r"NAME"
multiparts = []
nonetype = []
row_count = 0

for row in arcpy.da.SearchCursor(fc_name, ["OID@", "SHAPE@"]):
    row_count += 1
    if row[1] is None:
        print "{0} has issue with NoneType".format(row[0])
        nonetype.append(row[0])
    elif row[1].isMultipart is True:
        multiparts.append(row[0])

print "Nonetypes (Zero length typically):"
print nonetype
print "Multi-part:"
print multiparts
print "There are {0} multi-part feature(s) in {1} with {2} features".format(len(multiparts), fc_name, row_count)

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.