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); }
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)); } }
public void AddGeometry(IEnumerable <IBrepGeometry> geometrys) { GeometryList.AddRange(geometrys); }