Using editor clip function in arcpy

4337
5
04-22-2015 06:05 AM
StefanKaps1
New Contributor

Hi,

i have got a polygon shape with overlapping features. Using the clip tool of the editor (not "toolbox -> analysis tools -> clip"!) will get me the correct result. Now I want to use editor clip with arcpy, but I can't find it. Does anybody know, if this function exists in arcpy?

"Erase" would be an option, but I don't want to create a new shape file for the output...

Best regards,

Stefan

Tags (3)
0 Kudos
5 Replies
DarrenWiens2
MVP Honored Contributor

Can you explain exactly what the correct result is, and why editor clip or Erase would work? Is it that you want to clip based on certain features, not all?

I suspect you're looking for arcpy cursors and polygon difference  (http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000061000000), but need more info.

0 Kudos
StefanKaps1
New Contributor

Dear Darren,

I've got a polygon shape with 2 polygons. Polygon A is located below polygon B. Now I want the geometry of B within Polygon A. The thing is, that I don't want to create a new shapefile, like toolbox "Union" or toolbox "Erase" are doing it... Everything should be done within the input polygon shape.

The correct tool within arcgis is the clip function of the editor. But in arcpy?

0 Kudos
DarrenWiens2
MVP Honored Contributor

When you say one polygon shape with two polygons, do you mean one multipart polygon, or two overlapping polygons within the same feature class?

It sounds like you're looking for the intersect method within the polygon object(s).

0 Kudos
StefanKaps1
New Contributor

Two overlapping polygons within the same feature class. I will try the above mentioned polygon methods and let you know!

Thank You!

0 Kudos
StefanKaps1
New Contributor

Ok, I think I need a hint, because i am a bit stuck... Here is an illustration of my problem:

polygon.PNG

- One feature class with overlapping polygons

- I want the geometry and the attributes of the red area within the yellow and the blue one - no overlapping anymore

- I don`t want a new output file - everything has to be done within the original shape

I guess the union method of the polygon object could be the solution but I don't know how to call it. Do i need to loop through the geometry objects? Has somebody a code snipplet whith something simelar (e.g. polygon methods)?

0 Kudos