mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 00:52:40 +00:00
#1035 gluing on .0 is making least check always return 0.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7419 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
bfa9b8bf90
commit
1e4f6b73d8
|
@ -8,6 +8,7 @@ DECLARE
|
||||||
stmt VARCHAR;
|
stmt VARCHAR;
|
||||||
in_statefp VARCHAR;
|
in_statefp VARCHAR;
|
||||||
exact_street boolean := false;
|
exact_street boolean := false;
|
||||||
|
var_debug boolean := false;
|
||||||
BEGIN
|
BEGIN
|
||||||
IF parsed.streetName IS NULL THEN
|
IF parsed.streetName IS NULL THEN
|
||||||
-- A street name must be given. Think about it.
|
-- A street name must be given. Think about it.
|
||||||
|
@ -78,8 +79,8 @@ BEGIN
|
||||||
|| ' THEN 2'
|
|| ' THEN 2'
|
||||||
|| ' ELSE'
|
|| ' ELSE'
|
||||||
|| ' ((1.0 - '
|
|| ' ((1.0 - '
|
||||||
|| '(least_hn(' || coalesce(quote_literal(parsed.address || '.0'),'NULL') || ',least_hn(b.fromhn,b.tohn)::text) /'
|
|| '(least_hn(' || coalesce(quote_literal(parsed.address),'NULL') || ',least_hn(b.fromhn,b.tohn)::text)::numeric /'
|
||||||
|| ' greatest(1,greatest_hn(' || coalesce(quote_literal(parsed.address || '.0'),'NULL') || ',greatest_hn(b.fromhn,b.tohn)::text)))'
|
|| ' greatest(1,greatest_hn(' || coalesce(quote_literal(parsed.address),'NULL') || ',greatest_hn(b.fromhn,b.tohn)::text)))'
|
||||||
|| ') * 5)::integer + 5'
|
|| ') * 5)::integer + 5'
|
||||||
|| ' END'
|
|| ' END'
|
||||||
|| ' as sub_rating,'
|
|| ' as sub_rating,'
|
||||||
|
@ -110,7 +111,9 @@ BEGIN
|
||||||
|| ' ORDER BY 1,2,3,4,5,6,7,9'
|
|| ' ORDER BY 1,2,3,4,5,6,7,9'
|
||||||
|| ' LIMIT 10'
|
|| ' LIMIT 10'
|
||||||
;
|
;
|
||||||
--RAISE NOTICE '%', stmt;
|
IF var_debug THEN
|
||||||
|
RAISE NOTICE '%', stmt;
|
||||||
|
END IF;
|
||||||
-- If we got an exact street match then when we hit the non-exact
|
-- If we got an exact street match then when we hit the non-exact
|
||||||
-- set of tests, just drop out.
|
-- set of tests, just drop out.
|
||||||
IF NOT zip_info.exact AND exact_street THEN
|
IF NOT zip_info.exact AND exact_street THEN
|
||||||
|
@ -157,6 +160,6 @@ BEGIN
|
||||||
RETURN;
|
RETURN;
|
||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
LANGUAGE 'plpgsql' STABLE COST 1000;
|
LANGUAGE 'plpgsql' STABLE COST 1000 ROWS 50;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue