private static DSPolygon FromPolygon(IPolygon geometry, DSGeometryFactory factory, bool setUserData) { var shell = (DSLinearRing)FromLineString(geometry.Shell, factory, setUserData); DSLinearRing[] holes = null; if (geometry.Holes != null && geometry.Holes.Length > 0) { holes = new DSLinearRing[geometry.Holes.Length]; for (var i = 0; i < holes.Length; i++) { holes[i] = (DSLinearRing)FromLineString(geometry.Holes[i], factory, setUserData); } } var result = factory.CreatePolygon(shell, holes); if (setUserData) { result.UserData = geometry.UserData; } return(result); }
private static DSPolygon FromPolygon(IPolygon geometry, DSGeometryFactory factory, bool setUserData) { var shell = (DSLinearRing)FromLineString(geometry.Shell, factory, setUserData); DSLinearRing[] holes = null; if (geometry.Holes != null && geometry.Holes.Length > 0) { holes = new DSLinearRing[geometry.Holes.Length]; for (var i = 0; i < holes.Length; i++) holes[i] = (DSLinearRing)FromLineString(geometry.Holes[i], factory, setUserData); } var result = factory.CreatePolygon(shell, holes); if (setUserData) result.UserData = geometry.UserData; return result; }