Commit 32689f30 authored by Eliot Blennerhassett's avatar Eliot Blennerhassett

Calculate distances in metres

parent bed7e2bc
......@@ -3,7 +3,7 @@
.trace ON
/*-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
ATTACH DATABASE "nz_address-osm_raw.sqlite" AS "osm";
DELETE FROM osm_addr;
......@@ -81,8 +81,6 @@ order by town_city, suburb_locality;
-- ---------------------------------------------------------------------
*/
-- ---------------------------------------------------------------------
-- matching linz vs OSM nodes on housenumber and empirically determined distance
-- (Will take quite a long time!)
......@@ -95,18 +93,18 @@ SELECT
o.is_way as is_way,
o.osm_id as osm_id,
l.linz_id as linz_id,
Distance(o.geom, l.geom) as D
Distance(o.geom, l.geom, 0) 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;
and D < 50;
-- remaining OSM entries with streets
-- 6539/46858
create table temp.inexact as
select
is_way,
osm_addr.is_way,
osm_addr.osm_id,
housenumber,
street,
......@@ -121,7 +119,7 @@ order by street, housenumber
-- and without streets
insert into temp.inexact
select
is_way,
osm_addr.is_way,
osm_addr.osm_id,
housenumber,
street,
......@@ -139,11 +137,11 @@ SELECT
o.is_way as is_way,
o.osm_id as osm_id,
l.linz_id as linz_id,
Distance(o.geom, l.geom) as D
Distance(o.geom, l.geom, 0) as D
FROM temp.inexact as o
JOIN linz_addr as l on
o.housenumber = l.full_address_number
and D < 0.001
and D < 40
;
-- Can be reviewed, then
......
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