How to cut and merge many polygons at once

3861
24
01-24-2020 12:57 PM
by Anonymous User
Not applicable

I was wondering if there was a way to cut polygons using polygons from a different layer as boundaries. And then merging the cut polygons within those boundaries, while preserving attributes of whichever poly had the bigger area.

Basically the goal is to realign the blue and pink layer to the new boundaries(Green Lines)

24 Replies
deleted-user-NvcfpBOWaKwr
Occasional Contributor

Sounds good. When you get a chance can you post the field names for Layer A from the file geodatabase.

0 Kudos
by Anonymous User
Not applicable

Here you go!

Layer A

  • APN
  • LAND_CODE1
  • Reso_nmbr
  • CNTRL_NMBR
  • DATE_ADOPT
  • PROJECT
  • LANDUSE_1
  • LU_DESC
  • created_user
  • created_date
  • last_edited_user
  • last_edited_date
  • Shape.Length
  • Shape.Area

Thanks again for all the help!

0 Kudos
deleted-user-NvcfpBOWaKwr
Occasional Contributor

I have created a simple script and tool. Let me know if this produces the results you are looking for. If not then we will get more complex in the processes.

Below is the source code and I will post a link for you to download the toolbox with the code when I get home tonight. 

import arcpy

########################################################################################################################
# Variables
########################################################################################################################

layerToAppendGeom = arcpy.GetParameterAsText(0)
layerWithNewGeom = arcpy.GetParameterAsText(1)
newGeomDict = {r[0]:[r[1]] for r in arcpy.da.SearchCursor(layerWithNewGeom, ["APN", "SHAPE@"])}

########################################################################################################################

with arcpy.da.UpdateCursor(layerToAppendGeom, ["APN", "SHAPE@"]) as upCursor:
    for updateRow in upCursor:
        value1 = updateRow[0]
        if value1 in newGeomDict:
            updateRow[1] = newGeomDict[value1][0]
            upCursor.updateRow(updateRow)

exit()
Jeremy_Moore
MVP Alum

Here is a direct link to download the toolbox. Make sure to download the Boundary_Realign folder or make a folder that contains the script and tool box. Once the final iteration of code is done we will update the tool box so the code is stored with it.

https://drive.google.com/open?id=11onOCODMlGR3uRtNAfAMb1jzUl8mByDZ

0 Kudos
KatiaMontgomery
New Contributor

"FYI the Merge tool within the "Edit" ribbon in ArcGIS pro is not the same tool that can be found while searching for the merge tool in the Geoprocessing pane. The big difference is that the Merge within the "Edit" pane merges features while the Merge Geoprocessing tool merges datasets. "

@deleted-user-NvcfpBOWaKwr 

This is driving me crazy. Is there any way to use the "edit" ribbon tool in a model or python script?

0 Kudos