/// <summary>
        ///  Snaps the vertices in the component <see cref="LineString" />s
        ///  of the source geometry to the vertices of the given snap geometry.
        /// </summary>
        /// <param name="g">a geometry to snap the source to</param>
        /// <param name="tolerance"></param>
        /// <returns>a new snapped Geometry</returns>
        public Geometry SnapTo(Geometry g, double tolerance)
        {
            var snapPts = ExtractTargetCoordinates(g);

            var snapTrans = new SnapTransformer(tolerance, snapPts);

            return(snapTrans.Transform(_srcGeom));
        }
        /// Snaps the vertices in the component <see cref="LineString" />s
        /// of the source geometry to the vertices of the same geometry.
        /// Allows optionally cleaning the result to ensure it is topologically valid
        /// (which fixes issues such as topology collapses in polygonal inputs).
        /// <param name="snapTolerance">The snapping tolerance</param>
        /// <param name="cleanResult">Whether the result should be made valid</param>
        /// <returns>The geometry snapped to itself</returns>
        public Geometry SnapToSelf(double snapTolerance, bool cleanResult)
        {
            var snapPts = ExtractTargetCoordinates(_srcGeom);

            var snapTrans   = new SnapTransformer(snapTolerance, snapPts, true);
            var snappedGeom = snapTrans.Transform(_srcGeom);
            var result      = snappedGeom;

            if (cleanResult && result is IPolygonal)
            {
                // TODO: use better cleaning approach
                result = snappedGeom.Buffer(0);
            }
            return(result);
        }