I have two feature classes of ~500,000 polygons each. Other than finding a single record that is linked to several polygons is there a way to tell if my feature class includes multipart geometry?
Solved! Go to Solution.
There are probably other ways, but here's the first thing I could think of:
Save off a copy of the layer and then check the number of records. Then start an Editing session on that saved layer, "Select All" records, turn on the "Advanced Editing toolbar", and hit the "Explode Multipart Features" button. Then check the number of records. If the number has increased, you have multipart features. And if you want to find them, Save the edits, then do a Select by Location with the Identical option versus your original layer, then Switch Selection the records.
Chris Donohue, GISP
Using Python you could check each Polygon Geometry and check to see if it is multipart or not. I don't think in a feature class property or layer property itself there is any way to access whether the feature is multipart or not(Someone correct me if I'm wrong here).
http://pro.arcgis.com/en/pro-app/arcpy/classes/polygon.htm
http://gis.stackexchange.com/questions/43943/how-to-filter-out-multipart-polygons-and-then-buffer
There are probably other ways, but here's the first thing I could think of:
Save off a copy of the layer and then check the number of records. Then start an Editing session on that saved layer, "Select All" records, turn on the "Advanced Editing toolbar", and hit the "Explode Multipart Features" button. Then check the number of records. If the number has increased, you have multipart features. And if you want to find them, Save the edits, then do a Select by Location with the Identical option versus your original layer, then Switch Selection the records.
Chris Donohue, GISP
Hi Bernie - Are you working against an Enterprise Geodatabase? I have ran SQL queries in the past directly against an Oracle Enterprise Geodatabase using ST_Geometry functions (geometry was stored using ST_Geometry).
If you have the Data Reviewer extension there are tools for this type of check.
Finding multipart polygons—Help | ArcGIS Desktop
You could also use a Python Field calculator to calculate Is Multipart or part count based off the shape (would require adding fields...)
Calculate Field—Help | ArcGIS for Desktop
-Adam Z
Adam - I am using a file geodatabase and I don't have the Data Reviewer extension but thanks for the suggestions.
Bernie.
Another idea (as the caffeine finally kicks in )
An slightly easier option than using Explode in the workflow I posted above is to substitute in the Multipart to Singlepart (Data Management) geoprocesssing tool instead of going into an Editing session and using Explode. Same workflow otherwise.
Multipart To Singlepart—Help | ArcGIS for Desktop
Chris Donohue, GISP
In QGIS, we can use the expression "num_geometries($geometry)" in the Field Calculator to return a count of geometry parts.
Isn't there an expression which could be used in the Field Calculator to either detect or count multipart geometry?
Thanks for any help.
You can use the Number of Parts property in Calculate Geometry:
Bud,
I should have mentioned that we are not using Pro. Although your answer will be helpful to others.