The aim of our work is to present a variant analysis of the threat to buildings in the event of mining the underground coal seam using longwall face. QGIS, the currently open-source spatial information system, was used to assess the threat to buildings. The assessment consisted of comparing the hazard category of the mining area with the resistance category of the building. In the case of mines, an inventory of the resistance of buildings is carried out during the development of mining plans. The second important aspect of our work is the transition from traditional CAD technology to the use of GIS technology. The new technology makes it easier and quicker to carry out analyses such as the threat posed by mining to listed buildings. It helps to produce annexes to the mining plan, such as hazard maps for buildings and a table listing buildings at risk.