some more lua logic to guess rurality.
This commit is contained in:
parent
8ba5d8e3ad
commit
f36e38b10b
1 changed files with 15 additions and 2 deletions
|
@ -81,13 +81,26 @@ function osm2pgsql.process_way(object)
|
||||||
zone = "urban"
|
zone = "urban"
|
||||||
elseif string.match(zone, "motorway") then
|
elseif string.match(zone, "motorway") then
|
||||||
zone = "motorway"
|
zone = "motorway"
|
||||||
elseif contains(URBAN_TYPES, tags.highway) then
|
elseif string.match(zone, "30") then
|
||||||
|
zone = "urban"
|
||||||
|
else
|
||||||
|
zone = "urban"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not tags["zone:traffic"] then
|
||||||
|
if contains(URBAN_TYPES, tags.highway) then
|
||||||
zone = "urban"
|
zone = "urban"
|
||||||
elseif contains(MOTORWAY_TYPES, tags.highway) then
|
elseif contains(MOTORWAY_TYPES, tags.highway) then
|
||||||
zone = "motorway"
|
zone = "motorway"
|
||||||
|
elseif (tags.maxspeed) and (tonumber(string.match(tags.maxspeed, '[%d]*'))) and tonumber(string.match(tags.maxspeed, '[%d]*')) > 60 then
|
||||||
|
zone = "rural"
|
||||||
|
elseif tags['source:maxspeed'] and string.match(tags['source:maxspeed'], "rural") then
|
||||||
|
zone = "rural"
|
||||||
|
elseif tags['source:maxspeed'] and string.match(tags['source:maxspeed'], "urban") then
|
||||||
|
zone = "urban"
|
||||||
else
|
else
|
||||||
-- we can't figure it out
|
-- we can't figure it out
|
||||||
zone = nil
|
zone = "urban"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue