Geocode
Table of Contents
Overview
The zoho.map.geoCode task returns the GPS coordinates (latitude and longitude) of the specified address.
Note:
- Zoho Maps use open-source address data. Hence, accuracy might not be on par with commercial vendors.
- This task cannot be used in AU domain as Zoho Maps is not available for AU users.
Syntax
<response> = zoho.map.geoCode(<address>);
where:
Params | Data type | Description |
---|---|---|
<response> | KEY-VALUE | The latitude and longitude of the specified location, and the status of the executed task. |
<address> | TEXT | The address of the location whose latitude and longitude need to be obtained. |
Example
The following script returns the latitude and longitude of the specified location:
response = zoho.map.geoCode("4141 Hacienda Dr, Pleasanton, CA 94588, United States");
where:
response
"4141 Hacienda Dr, Pleasanton, CA 94588, United States"
Response Format
Success Response
The success response will be returned in the following format:
{
"latitude": "37.68612315",
"longitude": "-121.893741811263",
"status": "success"
}
Failure Response
The failure response for an undetectable address value will be returned in the following format:
{
"error": "unable to geocode",
"status": "failure"
}