init_osmlinzaddr_spatialite.sql 756 Bytes
Newer Older
Eliot Blennerhassett's avatar
Eliot Blennerhassett committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
-- initialise osmlinzaddr.sqlite (as spatialite database)

-- Subset of LINZ address data,
CREATE TABLE linz_addr(
    linz_id mediumint,
    change_id mediumint,
    addr_type text(20),
    suburb_locality text(80),
    town_city text(80),
    full_address_number text(100),
    full_road_name text(250)
);
SELECT AddGeometryColumn('linz_addr', "geom", 4326, "POINT", "XY", 1);

-- OSM address data
CREATE TABLE osm_addr(
    type TEXT,
    osm_id INT,
    housenumber TEXT,
    street TEXT
);
SELECT AddGeometryColumn('osm_addr', "geom", 4326, "POINT", "XY", 1);

-- Cross reference of items representing the same address
CREATE TABLE osm_linz(
    'osm_id' int,
    'linz_id' int,
    'D' real  -- distance between OSM and LINZ address (? degrees ?)
);