Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        private void ComputeGeometry()
        {
            BufferOriginalPrecision();
            if (resultGeometry != null)
                return;

            // try and compute with decreasing precision
            for (int precDigits = MaxPrecisionDigits; precDigits >= 0; precDigits--)
            {
                try
                {
                    BufferFixedPrecision(precDigits);
                }
                catch (TopologyException ex)
                {
                    saveException = ex;
                    // don't propagate the exception - it will be detected by fact that resultGeometry is null
                }
                if (resultGeometry != null)
                    return;
            }

            // tried everything - have to bail
            throw saveException;
        }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 private void BufferOriginalPrecision()
 {
     try
     {
         BufferBuilder bufBuilder = new BufferBuilder();
         bufBuilder.QuadrantSegments = quadrantSegments;
         bufBuilder.EndCapStyle = endCapStyle;
         resultGeometry = bufBuilder.Buffer(argGeom, distance);
     }
     catch (TopologyException ex)
     {
         saveException = ex;
         // don't propagate the exception - it will be detected by fact that resultGeometry is null
     }
 }