File: arealdekke.lua

package info (click to toggle)
sosi2osm 1.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 240 kB
  • sloc: cpp: 442; makefile: 26; sh: 11
file content (88 lines) | stat: -rw-r--r-- 3,067 bytes parent folder | download | duplicates (4)
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
out = {}

for i, indent, tokens in tokens, info, 0 do
    if tokens[1] == "FLATE" then
		out["type"] = "multipolygon"
    elseif tokens[1] == "OBJTYPE" then
		if tokens[2] == "Myr" then
			out["natural"]="wetland"
        elseif tokens[2] == "Innsjø" then
			out["natural"]="water"
        elseif tokens[2] == "ElvBekk" then
			out["waterway"]="river"
        elseif tokens[2] == "InnsjøElvSperre" then
            out["waterway"]="weir"
        elseif tokens[2] == "Skog" then
            out["natural"]="wood"
        elseif tokens[2] == "Dam" then
            out["waterway"]="dam"
        elseif tokens[2] == "DyrketMark" then
            out["landuse"]="farm"
        elseif tokens[2] == "ÅpentOmråde" then
            out["natural"]="grassland"
        elseif tokens[2] == "TettBebyggelse" then
            out["landuse"]="residential"
        elseif tokens[2] == "Industriområde" then
            out["landuse"]="industrial"
        elseif tokens[2] == "BymessigBebyggelse" then
            out["landuse"]="residential"
        elseif tokens[2] == "Havflate" then
            return {}
        elseif tokens[2] == "SportIdrettPlass" then
            out["leisure"] = "pitch"
        elseif tokens[2] == "Gravplass" then
            out["landuse"] = "cemetery"
        elseif tokens[2] == "Golfbane" then
            out["leisure"] = "golf_course"
        elseif tokens[2] == "Steinbrudd" then
            out["landuse"] = "quarry"
        elseif tokens[2] == "Alpinbakke" then
            out["route"] = "piste"
            out["piste:type"] = "downhill"
        elseif tokens[2] == "Arealbrukgrense" then
        
        elseif tokens[2] == "FiktivDelelinje" then
        
        elseif tokens[2] == "Innsjøkant" then
        
        elseif tokens[2] == "KantUtsnitt" then

        elseif tokens[2] == "InnsjøkantRegulert" then
        
        elseif tokens[2] == "ElvBekkKant" then
        
        elseif tokens[2] == "HavElvSperre" then
            out["natural"] = "coastline"
        elseif tokens[2] == "Kystkontur" then
            out["natural"] = "coastline"
        elseif tokens[2] == "Helikopterplass" then
            out["aeroway"] = "helipad"
        elseif tokens[2] == "Skjær" then
            out["seamark:type"] = "rock"
        elseif tokens[2] == "Tregruppe" then
            out["natural"] = "tree"
            
        else
            out[tokens[1]] = tokens[2]
		end
    elseif tokens[1] == "HØYDE" then
        out["elev"]= tokens[2]
    elseif tokens[1] == "OPPDATERINGSDATO" then
        out["source:date"] = tokens[2]
    elseif tokens[1] == "DATAFANGSTDATO" then
        out["source:date"] = tokens[2]
    elseif tokens[1] == "KVALITET" then
    
    elseif tokens[1] == "KURVE" or tokens[1] == "PUNKT" or tokens[1] == "VANNBR" or  tokens[1] == "VATNLNR" then
        
    elseif tokens[1] == "NAVN" then
        out["name"] = tokens[2]
    elseif #tokens == 2 then
        out[tokens[1]] = tokens[2]
    elseif #tokens > 2 then
        out["lko"..tokens[1]] = table.concat(tokens, "; ", 2)
    end
end

return out