Example #1
0
        /// <summary>
        /// Computes the geometric union of a <see cref="IEnumerable{Geometry}"/><para/>
        /// If no input geometries were provided but a <see cref="GeometryFactory"/> was provided,
        /// an empty <see cref="GeometryCollection"/> is returned.
        /// </summary>
        /// <param name="geoms">A collection of geometries</param>
        /// <param name="geomFact">The geometry factory to use if the collection is empty</param>
        /// <returns>The union of the geometries
        /// or an empty GEOMETRYCOLLECTION</returns>
        public static Geometry Union(IEnumerable <Geometry> geoms, GeometryFactory geomFact)
        {
            var op = new UnaryUnionOp(geoms, geomFact);

            return(op.Union());
        }
Example #2
0
        /// <summary>Constructs a unary union operation for a <see cref="Geometry"/>
        /// (which may be a <see cref="GeometryCollection"/>).
        /// </summary>
        /// <param name="geom">A geometry to union</param>
        /// <returns>The union of the elements of the geometry
        /// or an empty GEOMETRYCOLLECTION</returns>
        public static Geometry Union(Geometry geom)
        {
            var op = new UnaryUnionOp(geom);

            return(op.Union());
        }
Example #3
0
        /// <summary>
        /// Computes the geometric union of a <see cref="IEnumerable{Geometry}"/>
        /// </summary>
        /// <param name="geoms">A collection of geometries</param>
        /// <returns>The union of the geometries,
        /// or <c>null</c> if the input is empty</returns>
        public static Geometry Union(IEnumerable <Geometry> geoms)
        {
            var op = new UnaryUnionOp(geoms);

            return(op.Union());
        }