Location Geocode
I mapping all the organizations in or sandbox.
Here is a snippet of the code:
def organizationBridge = Bridges.getOrganizationBridge();
def locationBridge = Bridges.getLocationBridge();
def orgResults = organizationBridge.find(new OrganizationCriteria());
def orgs = orgResults.getOrganizations();
def locations;
def locationRef;
def location;
try{
orgs.each() {
locations = it.getLocations();
locSize = locations.size() ?: 0;
if (locSize > 0){
locationRef = locations.get(0);
location = locationBridge.findById(locationRef.getSystemId());
geocode = location.getGeocode() ?: "0,0";
geocodeList = Arrays.asList(geocode.split("\\s*,\\s*"));
row.put("Latitude", geocodeList.get(0));
row.put("Longitude", geocodeList.get(1));
}
rows.push(row);
row = new HashMap();
}
}catch(Exception e)
{
bSuccess = false;
}
Sometime getGeocode() returns a null.
How does the system know the geocode of the address?
Is there a way to refresh or update the geocodes?
Thanks
Jay

