Geocoder: Should max_results=1 return lowest "rated" result?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Geocoder: Should max_results=1 return lowest "rated" result?

Dan Ball
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.
_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: Geocoder: Should max_results=1 return lowest "rated" result?

Regina Obe
It's a bug.

I think it's the same ticketed here:

https://trac.osgeo.org/postgis/ticket/1622

I've added this example to the list.  Probably won't be able to revisit this until after 2.2.3 release, so slated for 2.2.4.





-----Original Message-----
From: postgis-users [mailto:[hidden email]] On Behalf Of Dan Ball
Sent: Saturday, October 01, 2016 2:37 PM
To: [hidden email]
Subject: [postgis-users] Geocoder: Should max_results=1 return lowest "rated" result?

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.
_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

A little freelance job to write a postgis function to cut a compass corner off a polygon

jabraham
I need some functionality that I think is best put into a function, probably in pgsql.  This has been on the todo list for years, but since I can't seem to get to it, maybe one of you would like to help out. I don't think it should take long for someone who has the skills. I'd really appreciate the help.

You obviously need to have some experience writing postgis functions. The function would divide up a polygon by cutting off one of the compass corners using east-west and north-south lines. I think you'll have to use a bisection method to find the correct position of one of the lines, as the area (rather than the extent) of the corner-section to be cut off will be specified as a function parameter.  

I wrote down the planned algorithm and threw it on upwork here https://www.upwork.com/jobs/~01b6948ce256e51f85  (I'm not sure whether upwork is the best platform to ask for postgis freelance work, let me know if you have other ideas.)

Hope someone can help,

--
John Abraham
403-232-1060


_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users