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:
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.
We determined that the problem occurs in a Decimal Degrees function that gets called when doing the buffering in that unit. We are working on a fix for this. In the meantime, for your geometric functions purposes, can you use a value of one meter for the buffer distance? For a line of about 665 kilometers, doing buffering of 1 meter is still very small. We will let you know as soon as we have the fix for that. Thank you.
We made a fix for the bug you described. There was a presicion issue related to a Decimal Degrees function. Basically, by passing a very small distance for buffering in Decimal Degrees, the math was not precise enough when trying to find the angle for a distance of 7 centimeters based on a sphere of 6371 kilometers of radius! (The Earth). You can get the latest build in your Customer Portal for the fix. Thank you.