In this demonstration video, a Raytheon employee shows how their "RIOT" system can categorize huge piles of social network data to track where a person has been and where they are likely going to be. It strips the EXIF data from images that are posted online which includes latitude and longitude, dates, and times. It also uses "check in" data from apps to find out where people are and when.
It also is capable of finding relationships between users on social networking sites, in order to allow further information gathering about the person or group you are tracking.
If you want to defend from this kind of "mass surveillance" program, your best bet would be to make as much of your social network data private as possible. Of course this data is moved around the internet unencrypted when your friends access it anyway, so the only true defense would be to not use social media entirely. Clearly, checking in at places is a bad idea if you want to stay under the radar. Furthermore, it would be wise to learn how to strip EXIF data from images.