Wireless sensor networks (WSNs) allow us to instrument the physicalworld in novel ways, providing detailed insight that has not beenpossible hitherto. Since WSNs provide an interface to the physicalworld, each sensor node has a location in physical space, therebyenabling us to associate spatial properties with data. Since WSNscan perform periodic sensing tasks, we can also associate temporalmarkers with data. In the environmental sciences, in particular,WSNs are on the way to becoming an important tool for the modellingof spatially and temporally extended physical phenomena. However,support for high-level and expressive spatial-analytic tasks thatcan be executed inside WSNs is still incipient. By spatialanalysis we mean the ability to explore relationships betweenspatially-referenced entities (e.g., a vineyard, or a weather front)and to derive representations grounded on such relationships (e.g.,the geometrical extent of that part of a vineyard that is covered bymist as the intersection of the geometries that characterize thevineyard and the weather front, respectively). The motivation forthis endeavour stems primarily from applications where importantdecisions hinge on the detection of an event of interest (e.g., thepresence, and spatio-temporal progression, of mist over a cultivatedfield may trigger a particular action) that can be characterized byan event-defining predicate (e.g., humidity greater than 98 andtemperature less than 10). At present, in-network spatial analysisin WSN is not catered for by a comprehensive, expressive,well-founded framework. While there has been work on WSN eventboundary detection and, in particular, on detecting topologicalchange of WSN-represented spatial entities, this work has tended tobe comparatively narrow in scope and aims.The contributions made in this research are constrained to WSNswhere every node is tethered to one location in physical space. Theresearch contributions reported here include (a) the definition of aframework for representing geometries; (b) the detailedcharacterization of an algebra of spatial operators closelyinspired, in its scope and structure, by the Schneider-G¨uting ROSEalgebra (i.e., one that is based on a discrete underlying geometry)over the geometries representable by the framework above; (c)distributed in-network algorithms for the operations in the spatialalgebra over the representable geometries, thereby enabling (i) newgeometries to be derived from induced and asserted ones, and (ii)topological relationships between geometries to be identified; (d)an algorithmic strategy for the evaluation of complex algebraicexpressions that is divided into logically-cohesive components; (e)the development of a task processing system that each node isequipped with, thereby with allowing users to evaluate tasks onnodes; and (f) an empirical performance study of the resultingsystem.