Would it be possible for the following to be made into an app?

Your location would basically turn on or off your WIFI. At set intervals it would take your GPS location, once your within a certain distance and close enough to use your predefined WIFI location, it would automatically enable your WIFI. As you leave the WIFI range it would automatically disable your WIFI.