This paper introduces a spatial location allocation (SLA) method for urban parks based on Particle Swarm Optimization (PSO). PSO is an effective optimization method on the basis of swarm intelligence. The algorithms of it are population based random search algorithms inspired by the social behavior of bird flocks. Compared with the other artificial intelligence (AI) algorithms, PSO is simple, easy to implement, needs fewer parameters. In the problem of SLA for urban park, three factors: population density, accessibility and competitiveness, were considered to configure a specified number of parks in this study. To find the locations of parks which satisfy these requirements, the calculation of SLA using the traditional overlaying method is with high complexity. The PSO method can decrease the complexity of computation and locate a set of parks in reasonable time. A case study in Baoshan District of Shanghai, China was proposed. The service area analysis of the simulation result of urban parks convinced that the result can confirm the fairness of public green-space service and the PSO method is a practicable and efficient approach in SLA problem. The method can easily be extended for other service facilities, for instance, the location allocation of water-saving irrigation systems, agriculture service centers, hospitals, supermarkets and cinemas, etc.