location.decode

The location.decode command is used to decode a latitude/longitude pair into an address.

TR50 Request
{
  "cmd": {
    "command": "location.decode",
    "params": {
      "lat": 30.455,
      "lng": -84.253333
    }
  }
}

Request Parameters

Name Type Required Description
lat Float Yes The latitude of the location.
lng Float Yes The longitude of the location.

If the command is sent successfully a success message and params list is returned. Otherwise, an error and error message will be returned.

TR50 Response
{
  "cmd": {
    "success": true,
    "params": {
      "lat": 30.455,
      "lng": -84.25349,
      "address": {
        "streetNumber": "1145",
        "street": "Buckingham Dr",
        "city": "Tallahassee",
        "state": "FL",
        "zipCode": "32308",
        "country": "US"
      }
    }
  }
}

Response Parameters

Name Type Description
lat Float The latitude of the location.
lng Float The longitude of the location.
address.streetNumber String The street number of the address.
address.street String The route of the address.
address.city String The city name of the address.
address.state String The state code of the address.
address.zipCode String The zip code of the address.
address.country String The country code of the address.

PHP API

mixed TR50httpWorker::locationDecode($lat, $lng);