Hi,
I ran into a problem as part of a 'Split by Line' function I am working on. Since MS does not provide a direct way to split by a line shape, I am buffering a line and then taking the difference between the line and the shape being split. The problem occurs when I try to buffer the line by a very small amount when the line is in a coordinate system that has decimal degrees for its MapUnit. Here is the line of code that causes the problem:
oBufferResult = moLine.Buffer( _
0.001, 30, BufferCapType.Round, GeographyUnit.Meter, DistanceUnit.Meter).Polygons(0)
As you can see, since the requested units are meters, the buffer distance would be 1 millimeter. I would actually like to make that distance even smaller so that the shape being split (usually polygons but also lines) would not be significantly altered.
The problem is that whenever the requested distance goes below about 0.12 meters I receive an error: Object reference not set to an instance of an object. When the buffer distance is lower than about 0.07 the error no longer occurs but a buffer is produced that is WAY too big.
I am using version 4.5.0.0
I have attached a sample project so you can take a look.
Thanks,
Steve
BufferTest.zip (147 KB)