How are buildings currently connected?
If via dark fiber or MAN I’d suggest one S8700 at main site and S8500 in LSP (local survivable processor) mode for the other sites.
Site cabinets could be fiber connected and they would all work together as one large PBX as opposed to several smaller ones. You would be able to use 4, 5 or 6 digit dialing between buildings depending on your dialplan and you’d have local survivability with S8500’s in LSP mode.
I’m assuming each building has its own trunking with your carrier. I’d work with your carrier to develope a routing plan between sites in case of local failure.
Since it would all act as one PBX with main S8700 any cabinet at any site would recognize DNIS digits and route accordingly.