- --DEBUG: RAISE WARNING '% isaddress: %', location.place_id, location_isaddress;
- -- Add it to the list of search terms
- IF NOT %REVERSE-ONLY% THEN
- nameaddress_vector := array_merge(nameaddress_vector,
- location.keywords::integer[]);
- END IF;
-
- INSERT INTO place_addressline (place_id, address_place_id, fromarea,
- isaddress, distance, cached_rank_address)
- VALUES (obj_place_id, location.place_id, true,
- location_isaddress, location.distance, location.rank_address);
-
- IF location_isaddress THEN
- -- add postcode if we have one
- -- (If multiple postcodes are available, we end up with the highest ranking one.)
- IF location.postcode is not null THEN
- postcode = location.postcode;
- END IF;
-
- address_havelevel[location.rank_address] := true;
- -- add a hack against postcode ranks
- IF NOT location.isguess
- AND location.rank_address != 11 AND location.rank_address != 5
- THEN
+ -- Recompute the areas we need for hierarchy sanity checks.
+ IF location.rank_address != 11 AND location.rank_address != 5 THEN
+ IF location.isguess THEN
+ current_node_area := place_node_fuzzy_area(location.centroid,
+ location.rank_search);
+ ELSE
+ current_node_area := NULL;