Determine geolocation in shell / Terminal on OS X 10.5
According to Apple Developer documentation, the feature is available from OS X 10.6 or later.

Alternative to hardware-based GPS, how about DNS-based geolocation option for OSX 10.5? May be worth your time to google those.