A terrain mapping model is proposed using a generalized Markov random field (MRF) representation. Unlike previous work, the proposed MRF can fully represent uncertainties due to sensor pose and measurement errors, as well as data association errors in a single model. Additionally, neither homoscedasticity nor a predefined shape of the likelihood distribution is assumed. The flexibility of an MRF model allows spatial height correlations to be incorporated. The ability to include spatial correlations not only improves the accuracy through the benefits of Bayesian prior modeling, but also serves as a basis for terrain property characterization. Maximum likelihood solutions of terrain roughness are derived. Benefits of the proposed model are demonstrated experimentally on indoor and outdoor datasets. Results show that the MRF model leads to lower height estimation errors. In addition, the capability of estimating non-Gaussian height distributions allows the information about individual terrain features to be preserved. Finally, the model is able to accurately estimate the roughness of the terrain, which is beneficial for edge detection of obstacles and nontraversible terrain regions.Index Terms-Mapping, Markov random field (MRF), range sensing, sensor fusion.