This paper proposes a distributed coordination algorithm for robotic sensor networks to detect boundaries that separate areas of abrupt change of spatial phenomena. We consider an aggregate objective function, termed wombliness, that measures the change of the spatial field along the closed polygonal curve defined by the location of the sensors in the environment. We encode the network task as the optimization of the wombliness and characterize the smoothness properties of the objective function. In general, the complexity of the spatial phenomena makes the gradient flow cause self-intersections in the polygonal curve described by the network. Therefore, we design a distributed coordination algorithm that allows for network splitting and merging while guaranteeing the monotonic evolution of wombliness. The technical approach combines ideas from statistical estimation, dynamical systems, and hybrid modeling and design.