Yes, it can be done. I have used Tasker mainly for this feature. There's a page at YAWA - Wifi Automate when near cell tower and AP - Tasker Wiki that describes what to do. It's based off the cell tower that your phone is connecting to, so there's no need to enable GPS.
The link above looks...