Iso-Contour Queries and Gradient Routing with Guaranteed Delivery in Sensor Networks