We present a general methodology to study the morphology of complex thin film surfaces by evaluating the percentage of flat area through the use of atomic force microscopy. We prove that this is the key parameter to assess the suitability of a layer and ensure the desired epitaxy of the subsequent layer In a heterostructure. The method has been verified by applying it to chemically deposited YBa2Cu3O7 (YBCO) superconducting films grown on buffer layers with different surface morphologies. We demonstrate that, indeed, YBCO self-field critical current density is controlled by the buffer layer flat area fraction. © 2008 The Japan Society of Applied Physics.