Commit 4603dbfc authored by Eliot Blennerhassett's avatar Eliot Blennerhassett

Moved some examples into main SQL script

parent 923d07b6
......@@ -17,54 +17,13 @@ WHERE
osm_linz.linz_id is NULL
and linz_addr.addr_type != "Water"
ORDER BY linz_addr.town_city, linz_addr.suburb_locality
LIMIT 25;
LIMIT 25; -- for testing
-- exact match on number, street, and close proximity
-- 39047/46858
create table temp.exact as
SELECT
o.osm_id as osm_id,
l.linz_id as linz_id,
Distance(o.geom, l.geom) as D
FROM osm_addr as o
JOIN linz_addr as l on
o.housenumber = l.full_address_number
and o.street = l.full_road_name
and D < 0.001
-- remaining OSM entries with streets
-- 6539/46858
create table temp.inexact as
select type, osm_addr.osm_id, housenumber, street, geom
from osm_addr
left outer join exact
on osm_addr.osm_id = exact.osm_id
where exact.osm_id is null and street is not null
order by street, housenumber
-- and without streets
-- 1272/46858
create table temp.streetnull as
select type, osm_addr.osm_id, housenumber, street, geom
from osm_addr
left outer join exact
on osm_addr.osm_id = exact.osm_id
where exact.osm_id is null and street is null
order by street, housenumber
create table temp.streetnull_linz as
SELECT
o.osm_id as osm_id,
l.linz_id as linz_id,
Distance(o.geom, l.geom) as D
FROM streetnull as o
JOIN linz_addr as l on
o.housenumber = l.full_address_number
and D < 0.001
-- items in streetnull that had no identified LINZ equivalent
-- OSM items had no identified LINZ equivalent
SELECT "type", a."osm_id", "housenumber", "street", "geom"
FROM "streetnull" as a
outer left join streetnull_linz as b
FROM osm_addr as a
outer left join osm_linz as b
on a.osm_id = b.osm_id
where b.osm_id is NULL
order by street, housenumber
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment