示例#1
0
		private Geometry ComputeGeometry(IGeometryList resultPointList, 
            IGeometryList resultLineList, IGeometryList resultPolyList)
		{
			GeometryList geomList = new GeometryList();
			// element geometries of the result are always in the order P,L,A
			geomList.AddRange(resultPointList);
			geomList.AddRange(resultLineList);
			geomList.AddRange(resultPolyList);

			// build the most specific geometry possible
			return geomFact.BuildGeometry(geomList);
		}
示例#2
0
        protected virtual Geometry Transform(Polygon geom, Geometry parent)
        {
            bool     isAllValidLinearRings = true;
            Geometry shell = Transform(geom.ExteriorRing, geom);

            if (shell == null ||
                !(shell.GeometryType == GeometryType.LinearRing) ||
                shell.IsEmpty)
            {
                isAllValidLinearRings = false;
            }

            GeometryList holes = new GeometryList();

            for (int i = 0; i < geom.NumInteriorRings; i++)
            {
                Geometry hole = Transform(geom.InteriorRing(i), geom);
                if (hole == null || hole.IsEmpty)
                {
                    continue;
                }

                if (!(hole.GeometryType == GeometryType.LinearRing))
                {
                    isAllValidLinearRings = false;
                }

                holes.Add(hole);
            }

            if (isAllValidLinearRings)
            {
                return(geomFactory.CreatePolygon((LinearRing)shell,
                                                 holes.ToLinearRingArray()));
            }
            else
            {
                GeometryList components = new GeometryList();
                if (shell != null)
                {
                    components.Add(shell);
                }

                components.AddRange(holes);

                return(geomFactory.BuildGeometry(components));
            }
        }
示例#3
0
 public void AddGeometry(IEnumerable <IBrepGeometry> geometrys)
 {
     GeometryList.AddRange(geometrys);
 }