Skip to content

Commit

Permalink
Support area in factorized osmosis table highway osm-fr#518
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Jun 19, 2019
1 parent 0b59859 commit 4b8d201
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion analysers/Analyser_Osmosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Analyser_Osmosis(Analyser):
tags->'highway' LIKE '%_link' AS is_link,
(tags?'junction' AND tags->'junction' = 'roundabout') AS is_roundabout,
(tags?'oneway' AND tags->'oneway' IN ('yes', 'true', '1', '-1')) AS is_oneway,
(tags?'area' AND tags->'area' != 'no') AS is_area,
CASE tags->'highway'
WHEN 'motorway' THEN 1
WHEN 'primary' THEN 1
Expand Down Expand Up @@ -73,7 +74,6 @@ class Analyser_Osmosis(Analyser):
tags != ''::hstore AND
tags?'highway' AND
tags->'highway' NOT IN ('services', 'planned', 'proposed', 'construction', 'rest_area', 'razed', 'no') AND
(NOT tags?'area' OR tags->'area' = 'no') AND
ST_NPoints(linestring) >= 2
;
Expand All @@ -97,6 +97,8 @@ class Analyser_Osmosis(Analyser):
level
FROM
highways
WHERE
NOT is_area
;
ANALYZE {0}.highway_ends;
Expand Down
2 changes: 1 addition & 1 deletion analysers/analyser_osmosis_highway_area_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
JOIN {1}highways AS ways ON
ways.id = way_nodes.way_id AND
ways.highway = 'pedestrian' AND
(NOT ways.tags?'area' OR ways.tags->'area'='no')
NOT ways.is_area
WHERE
nodes.tags != ''::hstore AND
nodes.tags?'barrier' AND
Expand Down
3 changes: 2 additions & 1 deletion analysers/analyser_osmosis_highway_turn_lanes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
highway = 'motorway' OR
(highway = 'trunk' AND is_oneway)
) AND
tags?'turn:lanes'
tags?'turn:lanes' AND
NOT is_area
"""

sql11 = """
Expand Down
1 change: 1 addition & 0 deletions analysers/analyser_osmosis_relation_restriction.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
relation_members.member_role IN ('from', 'via', 'to')
JOIN highways AS ways ON
ways.id = relation_members.member_id AND
NOT is_area AND
ST_NPoints(ways.linestring) > 1
WHERE
nwfrom = 1 AND
Expand Down
2 changes: 1 addition & 1 deletion analysers/analyser_osmosis_roundabout.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
-- tags
ways.level < 5 AND -- it's a car road
NOT is_roundabout AND
NOT ways.tags?'area' AND
NOT is_area AND
(NOT ways.tags?'name' OR ways.tags->'name' LIKE 'Rond%' OR ways.tags->'name' LIKE 'Giratoire%') AND -- no name or start with 'Rond' or 'Giratoire' (French)
-- geometry
ways.is_polygon AND -- It's a polygon
Expand Down
3 changes: 2 additions & 1 deletion analysers/analyser_osmosis_roundabout_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
highways
WHERE
is_roundabout AND
NOT is_area AND
array_length(nodes, 1) > 3 AND
nodes[1] = nodes[array_length(nodes,1)] AND
level(highway) IS NOT NULL
Expand Down Expand Up @@ -237,7 +238,7 @@
WHERE
ways.highway NOT IN ('footway') AND
ways.tags->'access' NOT IN ('no', 'psv', 'private') AND
NOT ways.tags?'area'
NOT is_area
"""

class Analyser_Osmosis_Roundabout_Level(Analyser_Osmosis):
Expand Down

0 comments on commit 4b8d201

Please sign in to comment.