A global site selection for astronomy was performed with 1 km spatial resolution (similar to 1 gigapixel in size) using long-term and up-to-date datasets to classify the entire terrestrial surface of the Earth. Satellite instruments are used to get the following datasets of geographical information system (GIS) layers: cloud coverage, digital elevation model, artificial light, precipitable water vapour, aerosol optical depth, wind speed, and land use and land cover. A multi-criteria decision analysis (MCDA) technique is applied to these datasets, creating four different series where each layer will have a specific weight. We introduce for the first time a suitability index for astronomical sites (SIAS). This index can be used to find suitable locations and to compare different sites or observatories. The midwestern Andes in South America and the Tibetan Plateau in western China were found to be the best in all SIAS series. Considering all the series, less than 3 per cent of all terrestrial surfaces are found to be the best regions to establish an astronomical observatory. In addition to this, only approximately 10 per cent of all current observatories are located in good locations in all SIAS series. Amateurs, institutions or countries aiming to construct an observatory could create a shortlist of potential site locations using a layout of SIAS values for each country without spending time and budget. The outcomes and datasets of this study have been made available through a website, the Astro GIS Database, at www.astrogis.org.