mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Select all entrances for results in one query
This commit is contained in:
@@ -338,6 +338,11 @@ BEGIN
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
-- When an existing way is updated, recalculate entrances
|
||||
IF existingplacex.osm_type = 'W' and (existingplacex.rank_search > 27 or existingplacex.class IN ('landuse', 'leisure')) THEN
|
||||
PERFORM place_update_entrances(existingplacex.place_id, existingplacex.osm_id);
|
||||
END IF;
|
||||
|
||||
-- Abort the insertion (we modified the existing place instead)
|
||||
RETURN NULL;
|
||||
END;
|
||||
@@ -365,35 +370,3 @@ BEGIN
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_after_insert()
|
||||
RETURNS TRIGGER
|
||||
AS $$
|
||||
BEGIN
|
||||
{% if debug %}
|
||||
RAISE WARNING 'place_after_insert: % % % % %',NEW.osm_type,NEW.osm_id,NEW.class,NEW.type,st_area(NEW.geometry);
|
||||
{% endif %}
|
||||
|
||||
IF NEW.class IN ('routing:entrance', 'entrance') THEN
|
||||
PERFORM place_update_entrances_for_node(NEW.osm_id);
|
||||
END IF;
|
||||
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_after_delete()
|
||||
RETURNS TRIGGER
|
||||
AS $$
|
||||
BEGIN
|
||||
{% if debug %}
|
||||
RAISE WARNING 'place_after_delete: % % % % %',OLD.osm_type,OLD.osm_id,OLD.class,OLD.type,st_area(OLD.geometry);
|
||||
{% endif %}
|
||||
|
||||
IF OLD.class IN ('routing:entrance', 'entrance') THEN
|
||||
PERFORM place_update_entrances_for_node(OLD.osm_id);
|
||||
END IF;
|
||||
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
Reference in New Issue
Block a user