LoRaWAN networks promise to play a crucial role in the Internet of Things scenario because of their low power consumption and long-range communication. However, Non-Line-of-Sight conditions may severely affect network performance. Therefore, network planning requires obtaining the best line of sight possible between the nodes and the gateway. This paper presents a system to plan LoRaWAN networks using genetic algorithms. Results show that the system locates the nodes minimizing obstructions in the communication links. Additionally, tests compared system performance against an expert judgment, achieving less than 3% error in most test cases. Results confirm the usefulness of the proposed system.