Added ability to return a geohash in output

While latitude and longitude describe a single point on a map, a geohash encodes this information into an alphanumeric string to describe a fixed area. Geohash, a public domain geocode system, divides the world into parts on a grid and each part/cell is defined by the string of length. Every decimal place in a geohash represents a level of resolution so that more characters provide more precision. (Think of zooming into or out of a fixed area as you lengthen or shorten the geohash.)

To enable the GeoHash in output, go to the Return Values tab within Global Geocode and select these options:
  • Enable Return GeoHash.
  • Set GeoHash Level as needed. By default, it is set to 12 (the highest precision).

Example:

42.678225, -73.700022 , location @ 350 Jordan Rd, Troy NY

Geohash Level 8 = dredfcm6

Geohash Level 12 = dredfcm69jb8
Table 1. Geohash examples: Geohash level and the corresponding size of the coverage area as precision decreases
Geohash level Geohash Metric Standard Coverage area
12 te7u6g4yz02w ≤ 37.2 mm x 18.6 mm 1.46 in x 0.73 in Smart watch
11 te7u6g4yz02 ≤ 149 mm x 149 mm 6 in x 6 in Paper Napkin
10 te7u6g4yz0 ≤ 119 m x 0.596 mm 4 ft x 2 ft Dresser
8 te7u6g4y ≤ 38.2 m x 19.1 m 125 ft x 62 ft House lot
6 te7u6g ≤ 1.22 km x 0.61 km 3/4 mi x 1/3 mi 1/2 city block
4 te7u ≤ 39.1 km x 19.5 km 24 mi x12 mi City
2 te ≤ 1,250 km x 625 km 776 mi x 388 mi Countries

Returning a Geohash in the output (Sample Application)

Custom Preference Keys (case-sensitive):

  • RETURN_GEOHASH "true/false"
  • GEOHASH_LEVEL "1-12"

To return a GeoHash as part of the output, pass the custom preference "RETURN_GEOHASH":"true" along with one of the options below. By default, returnAllCustomFields is set as false.

"returnFieldsDescriptor":{
"returnAllCustomFields":"true"
},
"returnFieldsDescriptor":{
"returnedCustomFieldKeys":["GEOHASH"]
},
"returnAllCandidateInfo":"true"

Sample Return GEOHASH as an additional field while suppressing other additional fields (the default).

{
"type": "ADDRESS",
"preferences": {
"returnFieldsDescriptor":{
"returnedCustomFieldKeys":["GEOHASH"]
},
"customPreferences":{
"RETURN_GEOHASH":"true",
"GEOHASH_LEVEL":"2"
}
},
"addresses": [
{
"mainAddressLine":"1 global view troy ny",
"country": "USA"
}
]}