mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
remove support for AUX housenumber tables
These tables have never been actively maintained and the code is completely untested. With the upcomming changes, it is unlikely that the code remains usable. This removes the aux tables and all code that references them.
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
CREATE TABLE location_property_aux () INHERITS (location_property);
|
||||
CREATE INDEX idx_location_property_aux_place_id ON location_property_aux USING BTREE (place_id);
|
||||
CREATE INDEX idx_location_property_aux_parent_place_id ON location_property_aux USING BTREE (parent_place_id);
|
||||
CREATE INDEX idx_location_property_aux_housenumber_parent_place_id ON location_property_aux USING BTREE (parent_place_id, housenumber);
|
||||
GRANT SELECT ON location_property_aux TO "{www-user}";
|
||||
|
||||
@@ -135,20 +135,6 @@ BEGIN
|
||||
END IF;
|
||||
{% endif %}
|
||||
|
||||
-- then additional data
|
||||
{% if config.get_bool('USE_AUX_LOCATION_DATA') %}
|
||||
IF place IS NULL THEN
|
||||
SELECT parent_place_id as place_id, 'us' as country_code,
|
||||
housenumber, postcode,
|
||||
'place' as class, 'house' as type,
|
||||
null as name, null as address,
|
||||
centroid
|
||||
INTO place
|
||||
FROM location_property_aux
|
||||
WHERE place_id = in_place_id;
|
||||
END IF;
|
||||
{% endif %}
|
||||
|
||||
-- postcode table
|
||||
IF place IS NULL THEN
|
||||
SELECT parent_place_id as place_id, country_code,
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
-- Functions for adding external data (currently unused).
|
||||
|
||||
CREATE OR REPLACE FUNCTION aux_create_property(pointgeo GEOMETRY, in_housenumber TEXT,
|
||||
in_street TEXT, in_isin TEXT,
|
||||
in_postcode TEXT, in_countrycode char(2))
|
||||
RETURNS INTEGER
|
||||
AS $$
|
||||
DECLARE
|
||||
|
||||
newpoints INTEGER;
|
||||
place_centroid GEOMETRY;
|
||||
out_partition INTEGER;
|
||||
out_parent_place_id BIGINT;
|
||||
location RECORD;
|
||||
address_street_word_ids INTEGER[];
|
||||
out_postcode TEXT;
|
||||
|
||||
BEGIN
|
||||
|
||||
place_centroid := ST_Centroid(pointgeo);
|
||||
out_partition := get_partition(in_countrycode);
|
||||
out_parent_place_id := null;
|
||||
|
||||
address_street_word_ids := word_ids_from_name(in_street);
|
||||
IF address_street_word_ids IS NOT NULL THEN
|
||||
out_parent_place_id := getNearestNamedRoadPlaceId(out_partition, place_centroid,
|
||||
address_street_word_ids);
|
||||
END IF;
|
||||
|
||||
IF out_parent_place_id IS NULL THEN
|
||||
SELECT getNearestRoadPlaceId(out_partition, place_centroid)
|
||||
INTO out_parent_place_id;
|
||||
END LOOP;
|
||||
END IF;
|
||||
|
||||
out_postcode := in_postcode;
|
||||
IF out_postcode IS NULL THEN
|
||||
SELECT postcode from placex where place_id = out_parent_place_id INTO out_postcode;
|
||||
END IF;
|
||||
-- XXX look into postcode table
|
||||
|
||||
newpoints := 0;
|
||||
insert into location_property_aux (place_id, partition, parent_place_id,
|
||||
housenumber, postcode, centroid)
|
||||
values (nextval('seq_place'), out_partition, out_parent_place_id,
|
||||
in_housenumber, out_postcode, place_centroid);
|
||||
newpoints := newpoints + 1;
|
||||
|
||||
RETURN newpoints;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
@@ -84,22 +84,6 @@ CREATE TABLE location_area_country (
|
||||
CREATE INDEX idx_location_area_country_geometry ON location_area_country USING GIST (geometry) {{db.tablespace.address_index}};
|
||||
|
||||
|
||||
drop table IF EXISTS location_property CASCADE;
|
||||
CREATE TABLE location_property (
|
||||
place_id BIGINT,
|
||||
parent_place_id BIGINT,
|
||||
partition SMALLINT,
|
||||
housenumber TEXT,
|
||||
postcode TEXT,
|
||||
centroid GEOMETRY(Point, 4326)
|
||||
);
|
||||
|
||||
CREATE TABLE location_property_aux () INHERITS (location_property);
|
||||
CREATE INDEX idx_location_property_aux_place_id ON location_property_aux USING BTREE (place_id);
|
||||
CREATE INDEX idx_location_property_aux_parent_place_id ON location_property_aux USING BTREE (parent_place_id);
|
||||
CREATE INDEX idx_location_property_aux_housenumber_parent_place_id ON location_property_aux USING BTREE (parent_place_id, housenumber);
|
||||
GRANT SELECT ON location_property_aux TO "{{config.DATABASE_WEBUSER}}";
|
||||
|
||||
CREATE TABLE location_property_tiger (
|
||||
place_id BIGINT,
|
||||
parent_place_id BIGINT,
|
||||
|
||||
Reference in New Issue
Block a user