I'm trying to merge feature records based on identical parameters in two different fields using Python or SQL.

I have a polygon feature class with ~800 records, that I've intersected with another feature, which has created a number of duplicated geometry fragments.

The intersected feature has a field containing IDs (catch_ID), and a field containing landuse (land_ID). The land_ID field contains a string value that's either Impervious or Pervious. After I intersected, I was left with too many duplicates, I'd need to reduce the duplication to each catch_ID so that I'm left with two, one for impervious land_ID and the other for pervious land_ID.

Right now I'm tackling this manually using Select By Attributes ie. catch_ID = '100' AND land_ID = 'Impervious', and then merging them using the editor. I will have to repeat a process a few more times, so I'd like to figure out how to automate this.

What Python commands would I need to generate a script for this, I'm not really familiar with the functions ArcPy uses the Editor, or can this be done with SQL in the Select By Attribute window?

I have Python 2.7.5 and Arcmap 10.2.1 (extensions 3D Analyst, ArcScan, Spatial Analyst, Geo statistical Analyst).

  • If I understand your question correctly, you want your catchments broken up into pervious/impervious areas, but that attribute is only part of landuse? I'm thinking you just want to run a Dissolve on your intersect result using the catchment ID and landID. That should merge everything with the same catchment ID and perviousness into single shapes. Up to you whether you want them to be multipart or not.
    – Chris W
    Feb 6, 2015 at 21:47
  • Thanks! That's exactly what I wanted to do. I didn't realize you could dissolve with multiple fields, only ever used it for 1. Feb 8, 2015 at 22:23

1 Answer 1


Rather than merge them manually with an attribute selection, you can Dissolve on multiple fields - not just one. So once you've Intersected your catchment and landuse layers, you should have attributes for both in a single shape. By Dissolving on catchment ID and landID (or whatever field has perviousness noted), everything that is impervious within a catchment will be merged to one shape and everything pervious to another. This assumes you leave the 'allow multipart' box checked. If not, each noncontiguous area of im/pervious-ness will be its own shape.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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