Nowadays, the number of disasters occurred and the people affected have been increasing. Everyday, newspapers report new disasters around the world. Immediately after the occurrence of a disaster, the first responders go to the affected region to rescue people and solve eventual problems. These areas offer many dangers to the rescue team. Furthermore, the communication network infrastructure has usually been destroyed. For these reasons, it is important to create a structure to sense environmental data to detect hazards. This structure needs to be independent, easy deployed and adapted to different situations. This paper presents a energy efficient mechanism for processing spatial queries on wireless sensor networks to detect dangers in disaster situations. This is different from other studies found in literature, that only process spatial queries with rectangular regions of interest. The proposed mechanism manipulates queries with regions of interest that have irregular shapes and reduce the overhearing consumption. In the scenarios analyzed, this mechanism decreased by about 60% of energy consumption, with an inaccuracy of approximately 14% in information collected, if compared with the network without improvements.