We are currently using DesktopEdition 6.0.0.368.
I am trying to use the Buffer method on a PolygonShape to create a buffer outside or inside the polygon. polygonShape.Buffer seems to correctly return the buffer outside the polygon when I use a positive distance giving me a larger “MultipolygonShape”. However when I make the distance negative, polygonShape.Buffer returns the same polygonShape vertices in the “MultipolygonShape”. My units are Geography.DecimalDegrees and DistanceUnit.Kilometer.
I found the Negative Buffering sample application so I cut and pasted the code from the sample. It gets the perimeter of the polygonShape as a Lineshape and then uses the lineShape.Buffer to get a MultipolygonShape. Then it does a GetDifference using the orignal polygonShape and the multipolygonShape returned from the lineShape.Buffer. Using this code doesn’t seem to work either as the lineShape.Buffer always returns “null” for the multipolygonShape when I use a distance that is negative. Note it does retrun a valid multipolygonShape when the distance is positive and the sample code as it donwloads is coded with a positive 50 in DistanceUnit.Meters.
I found the following note "
You can also pass a negative distance, Buffer will then decrease the perimeter of the BaseShape in all directions. A negative Distance will work with only BaseAreaShape and its derived classes (Polygon, StraightRectangle, Ellipse)
on a page for “BaseShape” on the Desktop Edition.
Does anyone have any idea what I am doing wrong? Can anyone give me an example that actually uses a negative distance and works? If the note above is correct, then how would the sample work by converting the polygonShape perimeter to a LineShape to do the Buffer when negative distance only works for polygon, StraightRectangle, and Ellipse?
Thanks for any help you can provide.
Richard