## 1 Introduction  
Unmanned Aerial Vehicles (UAVs) have been recognized as a new entity in the future wireless communication systems, and UAVs can play different roles in different applications. They can be receivers of navigating commands sent by remote control units when they carry out missions like surveillance [1], and the receivers of the sensory data sent by sensor nodes when they are employed to collect data in wireless sensor networks [2]. They can also be transmitters to send sensory data to desired nodes [3]. UAVs often outperform their counterparts such as unmanned ground robots thanks to their excellent mobility and high probability of having Line-of-Sight (LoS) with other objects. However, the LoS feature can also pose threats in communication security. Consider the case where a UAV needs to send its sensory data to a remote ground unit. When there are eavesdroppers in presence, the transmitted data can be easily collected by the eavesdroppers, which may lead to information leakage [4]. There are different approaches to protecting the wireless communication of UAVs. A common approach is encryption, which encodes a message in such a way that only authorized parties can access it and those who are not authorized cannot. However, if the eavesdropper somehow knows the encoding/decoding schemes used by the transmitter/receiver, it can extract information from the collected data. In recent years, physical layer security has attracted much attention. The basic idea is to enlarge the received rate at the desired node and reduce that at the eavesdropper, so that even if the eavesdropper could receive the transmitted data, it cannot be decoded successfully. Following this approach, Ref. [5] considers the optimal deployment of a UAV to secure the communication between the UAV and a ground node in the presence of eavesdroppers. Ref. [6] jointly optimizes the trajectory of the UAV and the transmit power of the ground node to avoid eavesdropping. Ref. [7] takes into account the No-fly zone (NFZ), such as the controlled areas with the risks of being targeted by ground-to-air missiles, in the process of path planning. The difference lies in the consideration of the negative impacts of the NFZ. The NFZ in that reference refers to some restricted areas such as some controlled air space, and it does not block the LoS between the UAV and the intended node and that between the UAV and the sun. However, the NFZ considered in the current paper refers to some tall buildings in urban environments. They may not only block the signal propagation but also prevent the UAV from harvesting energy. Then, the avoidance of the NFZ is similar to the conventional obstacle avoidance. Beyond the case with the stationary ground node and the stationary eavesdroppers, the more challenging situation with a moving ground node and moving eavesdroppers is investigated in [3], and the 3D UAV trajectory planning problem has been studied. One limitation of many publications on this topic is that they consider a free environment, where the UAV, the ground node and the eavesdroppers can have LoS [8]. They may not work in urban environments, since the LoS can be blocked by tall buildings [9]. For example, NFZ considered in [7] refers to some restricted areas such as some controlled air spaces, and they do not block the LoS between the UAV and the intended node and that between the UAV and the sun. Then, the avoidance of the NFZ is similar to the conventional collision avoidance. Moreover, the publication [7], as well as many other papers in this area, does not consider scenarios with some tall buildings in urban environments which may not only block the signal propagation but also prevent the UAV from harvesting energy. Another limitation is that the energy efficiency has not been comprehensively considered in these publications. Solar-powered UAVs have been employed to prolong the operation duration. However, the negative impacts of the urban environment on energy harvesting have not been well considered.