Scanning near-field optical microscopy (SNOM) is a powerful tool providing measurement of the near-field intensity of nano-structured surface layers. These measurements can be combined with rigorous solving of Maxwell's equations to gain insight into light propagation inside the layer. However, there are often major differences between the simulated near-field intensity directly above the surface and SNOM measurements. The SNOM measurements are being performed in a way that sample and probe have a distance of about 20 nm at their closest point, therefore the finite size of the probe has a severe impact on the measurement, e.g. for textured surfaces. Any steep flank present in the topography leads to an increased distance between the aperture of the probe and the sample surface, since the shortest distance between sample and probe occurs at the side of the tip. This behavior modifies the measurement at all points where the geometry does not allow for the aperture to be placed 20 nm over the topography, since another part of the probe would get in contact with the surface. To account for these topography artifacts in our simulations, we developed an algorithm to calculate the height of the probe above each point of the surface. Taking this position into account for each point of the topography measurement, we are able to obtain an intensity distribution at the same positions as the SNOM measurement. This intensity distribution shows a much better agreement to experiment than assuming a constant distance of 20 nm from the surface. We illustrate this algorithm and its consequences for comparisons between SNOM measurements and simulation using the textured transparent front contact of a silicon-based thin-film solar cell as an example. In such devices, the absorber layer of the cell is typically thinner than the absorption length of the incident light, especially in the long wavelength region. Due to the texture, the effective light path can be prolonged, and near-field measurements allow for an insight into light intensity close to the interface as well as guided modes.