Hi,
I need to do some polygon splitting using your tool and I need some help. I have a couple scenarios:
First Scenario:
I a screen shot below that helps explain what I want to do. What happens is the yellow polygon below is one polygon feature in my InMemory layer. Then a user draws another polygon to tell the application the area of the of the original polygon that they would like to split out. Once this is done I want to still show Part 1, and Part 2 but have them as two separate features in my InMemory layer.
I can get the Part 1 Polygon by itself by using the following lines of code:
varLayer.Open()
varLayer.EditTools.BeginTransaction()
' remove the difference between the two shapes
varLayer.EditTools.GetDifference(MapFeatureID.ToString(), DrawnShape)
varLayer.EditTools.CommitTransaction()
varLayer.Close()
But how do I get Part 2 Polygon and add it to my layer?
Scenario #2:
OK, Scenario #2 is similar but a little more tricky, I have a polygon that is very close to being a square or rectangle shape. However I want to allow the user to draw a circle over this square like polygon and split it into 5 different polygon shapes. The first four shapes being the corners outside of the user drawn circle, and the remaining polygon shape being the portion of the original polygon completely contained within the drawn circle. After I have these shapes I want to add them to my layer and remove/update the original polygon. Can this be done?
Below is a screen shot to help show what I'm trying to do.
Thanks!