PurposeThe purpose of this study is to discuss the principles and factors that influence the site selection of emergency medical facilities for public health emergencies. This paper discusses the selection of the best facilities from the available facilities, proposes the capacity of new facilities, presents a logistic regression model and establishes a site selection model for emergency medical facilities for public health emergencies in megacities.Design/methodology/approachUsing Guangzhou City as the research object, seven alternative facility points and the points' capacities were preset. Nine demand points were determined, and two facility locations were selected using genetic algorithms (GAs) in MATLAB for programing simulation and operational analysis.FindingsComparing the results of the improved GA, the results show that the improved model has fewer evolutionary generations and a faster operation speed, and that the model outperforms the traditional P-center model. The GA provides a theoretical foundation for determining the construction location of emergency medical facilities in megacities in the event of a public health emergency.Research limitations/implicationsFirst, in this case study, there is no scientific assessment of the establishment of the capacity of the facility point, but that is a subjective method based on the assumption of the capacity of the surrounding existing hospitals. Second, because this is a theoretical analysis, the model developed in this study does not consider the actual driving speed and driving distance, but the speed of the unified average driving distance and the driving distance to take the average of multiple distances.Practical implicationsThe results show that the method increases the selection space of decision-makers, provides them with stable technical support, helps them quickly determine the location of emergency medical facilities to respond to disaster relief work and provides better action plans for decision makers.Social implicationsThe results show that the algorithm performs well, which verifies the applicability of this model. When the solution results of the improved GA are compared, the results show that the improved model has fewer evolutionary generations, faster operation speed and better model than the intermediate model GA. This model can more successfully find the optimal location decision scheme, making that more suitable for the location problem of megacities in the case of public health emergencies.Originality/valueThe research findings provide a theoretical and decision-making basis for the location of government emergency medical facilities, as well as guidance for enterprises constructing emergency medical facilities.