-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathking_county_feature_class.sql
88 lines (88 loc) · 2.64 KB
/
king_county_feature_class.sql
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
create or replace function kc_feature_class(n varchar(4)) RETURNS varchar as $$
DECLARE
r varchar;
BEGIN
SELECT INTO r
CASE n
WHEN 'A00' THEN 'Road'
WHEN 'A01' THEN 'Road'
WHEN 'A02' THEN 'Road tunnel'
WHEN 'A03' THEN 'Road'
WHEN 'A04' THEN 'Road'
WHEN 'A05' THEN 'Road'
WHEN 'A06' THEN 'Road tunnel'
WHEN 'A07' THEN 'Road'
WHEN 'A08' THEN 'Road'
WHEN 'A1' THEN 'Primary'
WHEN 'A10' THEN 'Primary'
WHEN 'A11' THEN 'Primary'
WHEN 'A12' THEN 'Primary tunnel'
WHEN 'A13' THEN 'Primary'
WHEN 'A14' THEN 'Primary'
WHEN 'A15' THEN 'Primary'
WHEN 'A16' THEN 'Primary tunnel'
WHEN 'A17' THEN 'Primary'
WHEN 'A18' THEN 'Primary'
WHEN 'A2' THEN 'Primary'
WHEN 'A20' THEN 'Primary'
WHEN 'A21' THEN 'Primary'
WHEN 'A22' THEN 'Primary tunnel'
WHEN 'A23' THEN 'Primary'
WHEN 'A24' THEN 'Primary'
WHEN 'A25' THEN 'Primary'
WHEN 'A26' THEN 'Primary tunnel'
WHEN 'A27' THEN 'Primary'
WHEN 'A28' THEN 'Primary'
WHEN 'A3' THEN 'Secondary'
WHEN 'A30' THEN 'Secondary'
WHEN 'A31' THEN 'Secondary'
WHEN 'A32' THEN 'Secondary'
WHEN 'A33' THEN 'Secondary'
WHEN 'A34' THEN 'Secondary'
WHEN 'A35' THEN 'Secondary'
WHEN 'A36' THEN 'Secondary tunnel'
WHEN 'A37' THEN 'Secondary'
WHEN 'A38' THEN 'Secondary'
WHEN 'A4' THEN 'Residential'
WHEN 'A40' THEN 'Residential'
WHEN 'A41' THEN 'Residential'
WHEN 'A42' THEN 'Residential tunnel'
WHEN 'A43' THEN 'Residential'
WHEN 'A44' THEN 'Residential'
WHEN 'A45' THEN 'Residential'
WHEN 'A46' THEN 'Residential tunnel'
WHEN 'A47' THEN 'Residential'
WHEN 'A48' THEN 'Residential'
WHEN 'A5' THEN 'Trail'
WHEN 'A50' THEN 'Trail (4WD)'
WHEN 'A51' THEN 'Trail (4WD)'
WHEN 'A52' THEN 'Trail (4WD)'
WHEN 'A53' THEN 'Trail (4WD)'
WHEN 'A6' THEN 'Trail'
WHEN 'A60' THEN 'Access ramp'
WHEN 'A61' THEN 'Cul-de-sac'
WHEN 'A62' THEN 'Traffic circle'
WHEN 'A63' THEN 'Access ramp'
WHEN 'A64' THEN 'Service'
WHEN 'A65' THEN 'Ferry crossing passenger seasonal'
WHEN 'A66' THEN 'Ferry crossing passenger'
WHEN 'A68' THEN 'Ferry crossing seasonal'
WHEN 'A69' THEN 'Ferry crossing'
WHEN 'A7' THEN 'Road'
WHEN 'A70' THEN 'Other'
WHEN 'A71' THEN 'Walkway'
WHEN 'A72' THEN 'Stairway'
WHEN 'A73' THEN 'Alley'
WHEN 'A74' THEN 'Driveway'
WHEN 'A75' THEN 'Parking area'
WHEN 'B00' THEN 'Railroad'
WHEN 'B01' THEN 'Railroad track'
WHEN 'B02' THEN 'Railroad track tunnel'
WHEN 'B20' THEN 'Railroad spur track'
WHEN 'B30' THEN 'Railroad yard track'
WHEN 'B51' THEN 'Trolley track'
WHEN 'C31' THEN 'Aerial tramway, monorail, or ski lift'
END;
RETURN r;
END;
$$ LANGUAGE plpgsql;