The route is announced early for a couple of reasons. 1st it allows the roads along the route to be upgraded - except the cobblestone parts :-)and second lots of hotel reservations and other travel arraignments need to be made for those planning on watching at least part of it.
I used to train with a couple of guys who bought condos in France in a very old building along a river at the base of one of the famous climbs. (for the life of me I can't remember which town but I remember watching the tour stage that went through there a year or two later)
Anyway, he told me the little village swelled from about 1,500 to 10 or 20 thousand with people camping all up and down the valley. In a couple of little taverns they had televised tour coverage and people would congregate there to watch the stages after doing their own rides in the morning.
On the day that the tour came through the valley everyone was crammed into the taverns and around different video stations that had been set up. They monitored the progress of the peloton and about five minutes before they hit town everyone ran to the roadsides and as soon as the bunch went by they all scrambled back into the taverns to watch the summit finish.
...very fun and festive.