Proximity Searching via Apex
A new release of Geopointe will be out next week after all systems are on the Summer 11 release. With the update will come the ability to perform spatial/proximity/radial searches via Apex. Two new Apex methods are available for this:
These Apex methods enable Geopointe customers to utilize the proximity searching of Geopointe into advanced Apex logic. For information on all methods available to you, visit the Apex API page in the Help Center.
Let’s run an example. The image below displays a query (via the Geopointe UI) of our Geopointe customers within 15 miles of Wrigley Field in Chicago. We want to accomplish this same query in Apex without ever needing the UI. Now we can and the geopointe.API class will help us with this.
This method allows you to perform a radial search against a Map Object (a Salesforce object enabled for mapping) and also allows the passing in of a custom filter. Here we are saying to search around the record with id a1430000001E32gAAC and to search the Account object with a filter of Type = ‘Customer’ for records within 15 miles.
geopointe.API.radialSearchResult result = geopointe.API.radialSearchMapObject(
The method below is accomplishing the same thing, but is using a pre-defined dataset that already has the filter for Customers built into it.
geopointe.API.radialSearchResult result = geopointe.API.radialSearchDataSet(
The radialSearchResult Class
Both methods result in a geopointe.API.radialSearchResult object, which is defined with the parameters below.
There are other methods available in the geopointe.API class, so check them out. More methods will become available to our customers as time goes on and more use cases emerge.
Share these resources with your friends and colleagues.
Get more articles like this one sent to you via email
Keep up to date with Geopointe product announcements, articles, and webinars.