During the COVID-19 pandemic, a system was established in China that required testing of all residents for COVID-19. It consisted of sampling stations, laboratories capable of carrying out DNA investigations and vehicles carrying out immediate transfer of all samples from the former to the latter. Using Beilin District, Xi’an City, Shaanxi Province, China as example, we designed a genetic algorithm based on a two-stage location coverage model for the location of the sampling stations with regard to existing residencies as well as the transfer between the sampling stations and the laboratories. The aim was to estimate the minimum transportation costs between these units. In the first stage, the model considered demands for testing in residential areas, with the objective of minimizing the costs related to travel between residencies and sampling stations. In the second stage, this approach was extended to cover the location of the laboratories doing the DNAinvestigation, with the aim of minimizing the transportation costs between them and the sampling stations as well as the estimating the number of laboratories needed. Solutions were based on sampling stations and laboratories existing in 2022, with the results visualized by geographic information systems (GIS). The results show that the genetic algorithm designed in this paper had a better solution speed than the Gurobi algorithm. The convergence was better and the larger the network size, the more efficient the genetic algorithm solution time.