Task allocation is a fundamental problem in multi-robot systems where heterogeneous robots cooperate to perform a complex mission. A general requirement in a task allocation algorithm is to find an optimal set of robots to execute a certain task. This paper presents the work that harnesses an area decomposition algorithm, and a space-based middleware to facilitate task allocation process in unstructured and dynamic environments. To reduce spatial interference between robots, area decomposition algorithm divides a working area into cells which are then dynamically assigned to robots. In addition, coordination and collaboration among distributed robots are realized through a space-based middleware. For this purpose, the space-based middleware is extended with a semantic model of robot capabilities to improve task selection in terms of flexibility, scalability, and reduced communication overhead during task allocation. In this way a framework which exploits the synergy of area decomposition and semantically enriched space-based approach is created. We conducted performance tests in a specific precision agriculture use case focusing on the utilization of a robotic fleet for weed control introduced in the European Project RHEA – Robot Fleets for Highly Effective Agriculture and Forestry Management.