public static Geometry ToLines(Geometry g1, Geometry g2)
        {
            var geoms = FunctionsUtil.BuildGeometry(g1, g2);

            return(FunctionsUtil.GetFactoryOrDefault(new[] { g1, g2 })
                   .BuildGeometry(LinearComponentExtracter.GetLines(geoms)));
        }
        public static Geometry ToPoints(Geometry g1, Geometry g2)
        {
            var geoms = FunctionsUtil.BuildGeometry(g1, g2);

            return(FunctionsUtil.GetFactoryOrDefault(new[] { g1, g2 })
                   .CreateMultiPointFromCoords(geoms.Coordinates));
        }
        public static IGeometry Clip(IGeometry a, IGeometry mask)
        {
            var geoms = new List <IGeometry>();

            for (int i = 0; i < a.NumGeometries; i++)
            {
                var clip = a.GetGeometryN(i).Intersection(mask);
                geoms.Add(clip);
            }
            return(FunctionsUtil.BuildGeometry(geoms, a));
        }