The entrance of buildings is an important feature that connects their internal and external environments. Most frequently, automatic approaches for detecting building entrances are based on street-level images, which, however, are not widely available. To address this issue, we propose a more general approach for inferring the location of the main entrance of public buildings based on the association between spatial elements extracted from OpenStreetMap. In particular, we adopt three binary classification approaches: Weighted Random Forest, Balanced Random Forest, and SmoteBoost to model the association relationship. The features considered in the classification are of two types: (1) intrinsic features derived from the footprint, such as the distance to the centroid of the footprint, and (2) extrinsic features derived from spatial contexts, such as the shortest path distance to the main roads. Extensive experiments have been conducted on 320 public buildings with an average perimeter of 350 meters. The experimental results showed that a mean linear distance error of 21 meters and a mean path distance error of 22 meters were achieved by using the Weighted Random Forest and Balanced Random Forest models, ruling out 90% of the incorrect locations of the main entrance at buildings. Our work finds relevance, for example, in saving pedestrians' way-finding efforts.