The efficacy of the Particle Swarm Optimization (PSO) in determining the optimal locations for gateways in LoRaWAN networks is investigated. A modified PSO approach, which introduces gateway distancing measures during the initialization phase and flight time, is proposed. For the ease of comparisons and the understanding of the behavior of the algorithms under study, a square LoRaWAN area is used for simulations. Optimization results on a LoRaWAN script, implemented in NS-3, show that the modified PSO converges faster and achieves better results than the traditional PSO, as the number of gateways increases. Results further show that the modified PSO approach achieves similar performance to a deterministic approach, in which gateways are uniformly distributed in the network. This shows that for swarm intelligence techniques such as PSO to be used for gateway placement in LoRaWAN networks, gateway distancing mechanisms must be incorporated in the optimization process. These results further show that these techniques can be easily deployed in geometrically more complex LoRaWAN figures such as rectangular, triangular, circular and trapezoidal shapes. It is generally difficult to figure out a deterministic gateway placement mechanism for such shapes. As part of future work, more realistic LoRaWAN networks will be developed by using real geographical information of an area.