This study applies p-median to discuss where to locate not in my back yard facilities in Taiwan such as the compulsory treatment hospital for those who harasses sexually after the execution of punishment. A spatial analysis is used to suggest the government not just consider both hard and soft wares according to standard requirements but also their identities as not inmates serving prison sentence when choosing compulsory treatment hospital for those who harasses sexually after the execution of punishment. Under the protection of personal freedom based on the Constitution, to strengthen seamless convergence between hospitals, prisons, prosecutor offices, centers for prevention of domestic violence and sexual assault, and police departments in a community support network is required. The result of this research shows that when for those who harasses sexually scatter, hospitals are labeled, those who harasses sexually and takes compulsory treatment after the execution of punishment are identified as not inmates serving prison sentence are protected by personal freedom, and the cost for maintaining public security around hospitals have the same factor weights, credits are the same, which means that locating one hospital in each county or city, one hospital in each life zone, or one hospital in Taiwan are all allowed and further analysis is necessary. If factor weights are not the same, the best choice for locating hospitals differ, thus, policy makers can set up factor weights based on needs to search for the best way to plan and locate hospitals.