[postgis-users] Geocoder: Should max_results=1 return lowest "rated" result?

Dan Ball danpelota at gmail.com
Sat Oct 1 11:36:44 PDT 2016


The docs indicate that setting max_results=1 in the geocode function should return only the “best” result. Should that result be identical to the result with the lowest rating?

For instance:

geocoder=# select geocode('146 Southwest 169 Avenue, Miramar Pembroke Pines FL', 1);
                                                     geocode
------------------------------------------------------------------------------------------------------------------
 ("(146,S,393,""Co Hwy"",,,""Walton Beaches"",FL,32459,t)",0101000020AD10000007DBE596AB8E55C002C9CA3B625F3E40,67)
(1 row)

geocoder=# select geocode('146 Southwest 169 Avenue, Miramar Pembroke Pines FL');
                                                     geocode
------------------------------------------------------------------------------------------------------------------
 ("(146,SW,114,Ave,,,""Pembroke Pines"",FL,33025,t)",0101000020AD10000064078265381354C035907724A3013A40,24)
 ("(146,SW,169th,Ave,,,""Pembroke Pines"",FL,33027,t)",0101000020AD10000085951892EB1754C089DABB5364013A40,24)
 ("(,NW,163,Ave,,,""Pembroke Pines"",FL,33028,t)",0101000020AD10000096CB585E501754C0C71DCAB668033A40,25)
 ("(146,NW,154,Ave,,,""Pembroke Pines"",FL,33028,t)",0101000020AD100000053008B7611654C037C975C134023A40,26)
 ("(,SW,169th,Ave,,,""Southwest Ranches"",FL,33331,t)",0101000020AD100000BE44B145ED1754C06C5A2BCBD3083A40,34)
 ("(,SW,130,Ave,,,Miramar,FL,33027,t)",0101000020AD100000A9A4E81B631454C06B5E878997F53940,34)
 ("(146,S,393,""Co Hwy"",,,""Walton Beaches"",FL,32459,t)",0101000020AD10000007DBE596AB8E55C002C9CA3B625F3E40,67)
 ("(146,N,393,""Co Hwy"",,,""Walton Beaches"",FL,32459,t)",0101000020AD100000B5FC0832A08E55C063DA14287D633E40,69)
 ("(146,N,395,""Co Hwy"",,,""Walton Beaches"",FL,32459,t)",0101000020AD10000031489EC6338855C0B89153A5C95B3E40,69)
 ("(146,,98,""US Hwy"",,,""Walton Beaches"",FL,32459,t)",0101000020AD10000012204B4DEE8B55C00EE20CEE095E3E40,69)
(10 rows)


The result returned with max_results=1 has a rating of 67, while there are 6 other results with lower ratings. Is this expected behavior?

(Note that the input address is missing a zip code and has an erroneous city component; Miramar and Pembroke Pines are two different cities).

I’m using PostGIS 2.2.2.


More information about the postgis-users mailing list