// This is where the real work is done.
        public void AddLine(double x, double y, double?z, double?m)
        {
            // If we've already found a point, then we're done.  We just need to keep ignoring these
            // pesky calls.
            if (_foundPoint != null)
            {
                return;
            }

            // Make a point for our current position.
            var thisPoint = CheckShapePointAndGet(m, Ext.GetPoint(x, y, z, m, _srid));

            // is the found point between this point and the last, or past this point?
            if (m != null && _measure.IsWithinRange(_lastPoint.M.Value, m.Value))
            {
                // now we need to do the hard work and find the point in between these two
                _foundPoint = Functions.LRS.Geometry.InterpolateBetweenGeom(_lastPoint, thisPoint, _measure);
                if (_lastPoint.IsWithinTolerance(_foundPoint, _tolerance))
                {
                    _foundPoint  = _lastPoint;
                    IsShapePoint = true;
                }
                else if (thisPoint.IsWithinTolerance(_foundPoint, _tolerance))
                {
                    _foundPoint  = thisPoint;
                    IsShapePoint = true;
                }
            }
            else
            {
                // it's past this point---just step along the line
                _lastPoint = thisPoint;
            }
        }
        // Start the figure.  Note that since we only operate on LineStrings, this should only be executed
        // once.
        public void BeginFigure(double x, double y, double?z, double?m)
        {
            if (_foundPoint != null)
            {
                return;
            }

            // Memorize the point.
            _lastPoint = CheckShapePointAndGet(m, Ext.GetPoint(x, y, z, m, _srid));
        }