fix typos and make interpolation tests run

This commit is contained in:
Sarah Hoffmann 2015-02-19 00:38:54 +01:00
parent a25810d317
commit 1ce3307b7a

View File

@ -766,9 +766,9 @@ BEGIN
IF addr_street is null and addr_place is null THEN IF addr_street is null and addr_place is null THEN
select nodes from planet_osm_ways where id = wayid INTO waynodes; select nodes from planet_osm_ways where id = wayid INTO waynodes;
FOR location IN SELECT street, addr_place from placex FOR location IN SELECT placex.street, placex.addr_place from placex
where osm_type = 'N' and osm_id = ANY(nodes) where osm_type = 'N' and osm_id = ANY(waynodes)
and (street is not null or addr_place is not null) and (placex.street is not null or placex.addr_place is not null)
and indexed_status < 100 and indexed_status < 100
limit 1 LOOP limit 1 LOOP
addr_street = location.street; addr_street = location.street;
@ -805,6 +805,10 @@ BEGIN
END LOOP; END LOOP;
END IF; END IF;
IF parent_place_id is null THEN
RETURN 0;
END IF;
RETURN parent_place_id; RETURN parent_place_id;
END; END;
$$ $$
@ -861,7 +865,7 @@ BEGIN
-- Ignore all nodes marked for deletion. (Might happen when the type changes.) -- Ignore all nodes marked for deletion. (Might happen when the type changes.)
select * from placex where osm_type = 'N' and osm_id = waynodes[nodeidpos]::BIGINT select * from placex where osm_type = 'N' and osm_id = waynodes[nodeidpos]::BIGINT
and indexed_status < 100 and indexed_status < 100
order by (type = 'house'),place_id limit 1 INTO nextnode; order by (type = 'address'),place_id limit 1 INTO nextnode;
IF nextnode.place_id IS NOT NULL THEN IF nextnode.place_id IS NOT NULL THEN
IF nodeidpos > 1 and nodeidpos < array_upper(waynodes, 1) THEN IF nodeidpos > 1 and nodeidpos < array_upper(waynodes, 1) THEN
@ -1396,13 +1400,11 @@ BEGIN
-- interpolations XXXXX -- interpolations XXXXX
IF NEW.class = 'place' AND NEW.type = 'houses'THEN IF NEW.class = 'place' AND NEW.type = 'houses'THEN
IF osm_type = 'W' and ST_GeometryType(NEW.geometry) = 'ST_LineString' THEN IF NEW.osm_type = 'W' and ST_GeometryType(NEW.geometry) = 'ST_LineString' THEN
NEW.parent_place_id := get_interpolation_parent(NEW.osm_id, NEW.street, NEW.addr_place, NEW.parent_place_id := get_interpolation_parent(NEW.osm_id, NEW.street, NEW.addr_place,
NEW.partition, place_centroid, NEW.geometry); NEW.partition, place_centroid, NEW.geometry);
IF NEW.parent_place_id is not null THEN
i := create_interpolation(NEW.osm_id, NEW.housenumber); i := create_interpolation(NEW.osm_id, NEW.housenumber);
END IF; END IF;
END IF;
RETURN NEW; RETURN NEW;
END IF; END IF;