mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 05:14:07 +00:00
write interpolated house numbers complete out and avoid reindexing
This commit is contained in:
@@ -891,23 +891,27 @@ BEGIN
|
|||||||
|
|
||||||
startnumber := startnumber + stepsize;
|
startnumber := startnumber + stepsize;
|
||||||
-- correct for odd/even
|
-- correct for odd/even
|
||||||
IF (interpolationtype = 'odd' AND startnumber%2 = 0) OR (interpolationtype = 'even' AND startnumber%2 = 1) THEN
|
IF (interpolationtype = 'odd' AND startnumber%2 = 0)
|
||||||
|
OR (interpolationtype = 'even' AND startnumber%2 = 1) THEN
|
||||||
startnumber := startnumber - 1;
|
startnumber := startnumber - 1;
|
||||||
END IF;
|
END IF;
|
||||||
endnumber := endnumber - 1;
|
endnumber := endnumber - 1;
|
||||||
|
|
||||||
delete from placex where osm_type = 'N' and osm_id = prevnode.osm_id and type = 'house' and place_id != prevnode.place_id;
|
delete from placex where osm_type = 'N' and osm_id = prevnode.osm_id
|
||||||
|
and place_id != prevnode.place_id;
|
||||||
FOR housenum IN startnumber..endnumber BY stepsize LOOP
|
FOR housenum IN startnumber..endnumber BY stepsize LOOP
|
||||||
-- this should really copy postcodes but it puts a huge burden on
|
insert into placex (place_id, partition, osm_type, osm_id,
|
||||||
-- the system for no big benefit ideally postcodes should move up to the way
|
class, type, admin_level, housenumber,
|
||||||
insert into placex (place_id, partition, osm_type, osm_id, class, type, admin_level,
|
postcode,
|
||||||
housenumber, street, addr_place, isin, postcode,
|
country_code, parent_place_id, rank_address, rank_search,
|
||||||
country_code, parent_place_id, rank_address, rank_search,
|
indexed_status, indexed_date, geometry_sector,
|
||||||
indexed_status, geometry)
|
geometry)
|
||||||
values (nextval('seq_place'), partition, 'N', prevnode.osm_id, 'place', 'house', prevnode.admin_level,
|
values (nextval('seq_place'), partition, 'N', prevnode.osm_id,
|
||||||
housenum, prevnode.street, prevnode.addr_place, prevnode.isin, coalesce(prevnode.postcode, defpostalcode),
|
'place', 'address', prevnode.admin_level, housenum,
|
||||||
prevnode.country_code, prevnode.parent_place_id, prevnode.rank_address, prevnode.rank_search,
|
coalesce(prevnode.postcode, defpostalcode),
|
||||||
0, ST_LineInterpolatePoint(sectiongeo, (housenum::float-orginalstartnumber::float)/originalnumberrange::float));
|
prevnode.country_code, parent_place_id, 30, 30,
|
||||||
|
0, now(), geometry_sector, calculated_country_code,
|
||||||
|
ST_LineInterpolatePoint(sectiongeo, (housenum::float-orginalstartnumber::float)/originalnumberrange::float));
|
||||||
newpoints := newpoints + 1;
|
newpoints := newpoints + 1;
|
||||||
--RAISE WARNING 'interpolation number % % ',prevnode.place_id,housenum;
|
--RAISE WARNING 'interpolation number % % ',prevnode.place_id,housenum;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
@@ -944,8 +948,9 @@ DECLARE
|
|||||||
BEGIN
|
BEGIN
|
||||||
--DEBUG: RAISE WARNING '% %',NEW.osm_type,NEW.osm_id;
|
--DEBUG: RAISE WARNING '% %',NEW.osm_type,NEW.osm_id;
|
||||||
|
|
||||||
IF place_id is not null THEN
|
-- ignore interpolated addresses
|
||||||
RETURN NEW; -- already indexed (happens for interpolated addresses
|
IF NEW.class = 'place' and NEW.type = 'address' THEN
|
||||||
|
RETURN NEW;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- just block these
|
-- just block these
|
||||||
@@ -1331,6 +1336,11 @@ BEGIN
|
|||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
-- ignore interpolated addresses
|
||||||
|
IF NEW.class = 'place' and NEW.type = 'address' THEN
|
||||||
|
RETURN NEW;
|
||||||
|
END IF;
|
||||||
|
|
||||||
--DEBUG: RAISE WARNING 'placex_update % %',NEW.osm_type,NEW.osm_id;
|
--DEBUG: RAISE WARNING 'placex_update % %',NEW.osm_type,NEW.osm_id;
|
||||||
|
|
||||||
--RAISE WARNING '%',NEW.place_id;
|
--RAISE WARNING '%',NEW.place_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user