As soon as I read about it, I got excited. The news is Salesforce is providing the GeoLocations support and is in Pilot program in Summer ’12 release. I have been huge fan of Geolocations capabilities since using it in one of the Mobile App Dev project that I was working seperately.
I quickly raised a case in Salesforce to nominate my Dev org for this pilot program. I just got the reply from Salesforce folks that they accepted it.
The Geolocation is a new composite field type, which has two components: longitude and latitude. It can be added to any object. Decimal point precision can be set. Users have the choice to display coordinates in decimal point or degree, minute, and second notations.
Simple test that I did was I added a new field(geolocation__c) in my Account object of type Geolocation (ofcourse).
I updated some of my existing Accounts by randomly adding dummy values to this field. Then I ran the following apex in my developer console to search all Accounts within the 1 mile radius of a given Geolocation.
List<Account> accts = [SELECT Name FROM Account WHERE DISTANCE(geolocation__c, GEOLOCATION(37.794915,-122.394733), ‘mi’) <= 1];
System.debug(‘Count: ‘ +accts.size());
for(Account acct : accts)
System.debug(‘Account: ‘ +acct.Name);
Neat, I got the desired result. The possibility is huge. I look forward to using it for various purposes.