You could setup regions using the flood fill. When the fill hits a door, river, etc. it stops creating the "region" and creates a "connector region" that is another flood fill. If it hits a wall, channel or rock formation, it aborts. If you wanted, you could even cache the items or wall contents in the region and query regions for items. When querying the region, it can either store the items in a container object that has item management functions to "give" items to dwarfs that pick it up or it can use a "link array" to identify which of the items in "item array" is contained therein. You could setup a region class that has functions to combine regions or split them based on building a door or digging a channel in the region if needed. Each of these fills is placed in a node array that can be quickly navigated without checking each tile in the region. The following map sets up regions A, B, and C and uses door [ + ] (connector region) to connect A-B and B-C. These are separated by # wall. When looking for stone, the program doesn't have to check each tile for stone, but you can query the region for the stone content. Then you step to the next region until you build a list of "directions" that the dwarf can follow to get to the stone. You'd only need to path check the regions in the node array.
AAAAAAAAAAAAAAAAAAAA
AAA#######AAAAAAAAAA
AAA#BBBBB#AAAAAAAAAA
AAA+BB#+##AAAAAAAAAA
AAA#BB#CC#AAAAAAAAAA
AAA#BB#CC#AAAAAAAAAA
AAA#######AAAAAAAAAA
AAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAA
This would rely on doors or transition areas. Identifying transitions in open areas is another thing. You could possibly setup the flood fill to cap regions at a certain width/length, then transition to a new region.
Edit: Connector regions are nothing more than a regular region. I just didn't label them to try to keep the complexity of the diagram down.