) AS sub
JOIN state s ON ($10 = s.statefp)
ORDER BY 1,2,3,4,5,6,7,9
- LIMIT 20) As foo ORDER BY sub_rating, exact_address DESC LIMIT ' || max_results ;
+ LIMIT 20) As foo ORDER BY sub_rating, exact_address DESC LIMIT ' || max_results*10 ;
IF var_debug THEN
RAISE NOTICE 'stmt: %',
RETURN;
END IF;
- IF var_n >= max_results THEN --we have exceeded our desired limit
+ IF var_n >= max_results AND RATING < 10 THEN --we have exceeded our desired limit and rating is not horrible
RETURN;
END IF;
#1392a|State Hwy 121, Coppell, TX|POINT(-96.993397 32.985954)|8
#1392b|State Hwy 121, Coppell, TX|POINT(-96.993416 32.987025)|18
#1392b|State Hwy 121, Coppell, TX|POINT(-96.993397 32.985954)|18
+#2899|POINT(-72.4863 41.2807)|0
SELECT '#1392a' AS ticket, pprint_addy(addy), st_astext(geomout),rating FROM geocode_intersection('State Hwy 121', 'N Denton Tap Rd', 'TX', 'Coppell', '', 2);
SELECT '#1392b' AS ticket, pprint_addy(addy), st_astext(geomout),rating FROM geocode_intersection('State Hwy 121', 'N Denton Tap Rd', 'TX','', '', 2);
--
+
+-- Geocode 1 not returning best answer
+SELECT '#2899' AS ticket, st_astext(ST_SnapToGrid(geomout,0.0001)),rating FROM geocode('22 Minnow Ln, Westbrook, CT 06498',1);
\timing