Skip to content

Commit 9367e5e

Browse files
committed
Remove analyser
1 parent 5fb58c4 commit 9367e5e

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

analysers/analyser_osmosis_relation_multipolygon.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -161,43 +161,6 @@
161161
COUNT(*) > 1
162162
"""
163163

164-
sql40 = """
165-
SELECT
166-
ways.id,
167-
ST_AsText(way_locate(ways.linestring)),
168-
ways.tags->'area',
169-
ways.tags->'landuse',
170-
ways.tags->'natural',
171-
ways.tags->'waterway',
172-
ways.tags->'leisure',
173-
ways.tags->'amenity',
174-
ways.tags->'building',
175-
COALESCE(ways.tags->'area', ways.tags->'landuse', ways.tags->'natural', ways.tags->'waterway', ways.tags->'leisure', ways.tags->'amenity', ways.tags->'building')
176-
FROM
177-
{0}ways AS ways
178-
LEFT JOIN relation_members ON
179-
relation_members.member_id = ways.id AND
180-
relation_members.member_type = 'W'
181-
WHERE
182-
ways.tags != ''::hstore AND
183-
(
184-
(ways.tags?'area' AND ways.tags->'area' in ('yes', 'true')) OR
185-
ways.tags?'landuse' OR
186-
(ways.tags?'natural' AND ways.tags->'natural' in ('bare_rock', 'bay', 'beach', 'fell', 'glacier', 'grassland', 'heath', 'hot_spring', 'moor', 'mud', 'rock', 'sand', 'scree', 'scrub', 'shingle', 'sinkhole', 'stone', 'water', 'wetland', 'wood') AND (NOT ways.tags?'bay' OR ways.tags->'bay' != 'fjord')) OR
187-
(ways.tags?'waterway' AND ways.tags->'waterway' in ('boatyard', 'dock', 'fuel', 'riverbank')) OR
188-
(ways.tags?'leisure' AND ways.tags->'leisure' in ('adult_gaming_centre', 'amusement_arcade', 'bandstand', 'beach_resort', 'bird_hide', 'common', 'dance', 'dog_park', 'firepit', 'fishing', 'fitness_centre', 'garden', 'golf_course', 'hackerspace', 'horse_riding', 'ice_rink', 'marina', 'miniature_golf', 'nature_reserve', 'park', 'picnic_table', 'pitch', 'playground', 'sports_centre', 'stadium', 'summer_camp', 'swimming_area', 'swimming_pool', 'water_park', 'wildlife_hide')) OR
189-
(ways.tags?'amenity' AND ways.tags->'amenity' in ('animal_boarding', 'animal_shelter', 'arts_centre', 'baby_hatch', 'bank', 'bar', 'bicycle_rental', 'bicycle_repair_station', 'biergarten', 'blood_donation', 'boat_sharing', 'brothel', 'bus_station', 'cafe', 'car_rental', 'car_sharing', 'car_wash', 'casino', 'cinema', 'clinic', 'college', 'community_centre', 'courthouse', 'coworking_space', 'crematorium', 'crypt', 'dentist', 'dive_centre', 'doctors', 'dojo', 'driving_school', 'embassy', 'fast_food', 'ferry_terminal', 'fire_station', 'firepit', 'food_court', 'fountain', 'fuel', 'gambling', 'game_feeding', 'grave_yard', 'gym', 'hospital', 'hunting_stand', 'ice_cream', 'internet_cafe', 'kindergarten', 'kneipp_water_cure', 'language_school', 'library', 'marketplace', 'motorcycle_parking', 'music_school', 'nightclub', 'nursing_home', 'parking', 'parking_space', 'pharmacy', 'place_of_worship', 'planetarium', 'police', 'post_office', 'prison', 'pub', 'public_bookcase', 'public_building', 'ranger_station', 'recycling', 'rescue_station', 'restaurant', 'sauna', 'school', 'shelter', 'shower', 'social_centre', 'social_facility', 'studio', 'swingerclub', 'taxi', 'theatre', 'toilets', 'townhall', 'university', 'veterinary', 'waste_transfer_station')) OR
190-
ways.tags?'building'
191-
) AND
192-
ways.linestring IS NOT NULL AND
193-
NOT ways.is_polygon AND
194-
relation_members.member_id IS NULL AND
195-
-- Avoid confusing warnings for invalid polygons. Any closed way with >3 nodes that doesn't match
196-
-- is_polygon (with any of the tags above) must be an invalid polygon (which is checked elsewhere)
197-
-- Note: use array_length instead of ST_NPoints as the former includes nodes outside of the extract
198-
(NOT ST_IsClosed(ways.linestring) OR array_length(ways.nodes,1) = 3)
199-
"""
200-
201164
class Analyser_Osmosis_Relation_Multipolygon(Analyser_Osmosis):
202165

203166
def __init__(self, config, logger = None):
@@ -220,13 +183,6 @@ def __init__(self, config, logger = None):
220183
detail = T_(
221184
'''Multipolygon does not define nature, several found on the outer role
222185
members.'''))
223-
self.classs_change[4] = self.def_class(item = 1170, level = 1, tags = ['relation', 'fix:chair', 'geom'],
224-
title = T_('Should be polygon, part of multipolygon or not having area tag'),
225-
detail = T_(
226-
'''The nature of the way indicates that it is a surface, the way would be
227-
a polygon or a part of a multipolygon as outer role.'''),
228-
fix = T_(
229-
'''Close the way to make a polygon or add to a multipolygon.'''))
230186

231187
self.callback10 = lambda res: {"class":1, "data":[self.relation_full, self.way_full, self.way_full, self.positionAsText]}
232188
self.callback20 = lambda res: {"class":2, "subclass":stablehash64(res[11]), "data":[self.relation_full, self.way_full, self.positionAsText],
@@ -235,9 +191,6 @@ def __init__(self, config, logger = None):
235191
self.callback30 = lambda res: {"class":3, "subclass":1, "data":[self.relation_full, self.positionAsText],
236192
"text": {"en": u", ".join(map(lambda k: "{0}=({1})".format(*k), filter(lambda k: k[1], (("landuse",res[2]), ("natural",res[3]), ("waterway",res[4]), ("building",res[5])))))}
237193
}
238-
self.callback40 = lambda res: {"class":4, "subclass":stablehash64(res[9]), "data":[self.way_full, self.positionAsText],
239-
"text": {"en": u", ".join(map(lambda k: "{0}={1}".format(*k), filter(lambda k: k[1], (("area",res[2]), ("landuse",res[3]), ("natural",res[4]), ("waterway",res[5]), ("leisure",res[6]), ("amenity",res[7]), ("building",res[8])))))}
240-
}
241194

242195
def analyser_osmosis_common(self):
243196
self.run(sql30, self.callback30)
@@ -247,7 +200,6 @@ def analyser_osmosis_full(self):
247200
self.run(sql11)
248201
self.run(sql12.format("", "", ""), self.callback10)
249202
self.run(sql20.format("", ""), self.callback20)
250-
self.run(sql40.format(""), self.callback40)
251203

252204
def analyser_osmosis_diff(self):
253205
self.run(sql10)
@@ -258,4 +210,3 @@ def analyser_osmosis_diff(self):
258210
self.run(sql12.format("not_touched_", "not_touched_", "touched_"), self.callback10)
259211
self.run(sql20.format("touched_", ""), self.callback20)
260212
self.run(sql20.format("not_touched_", "touched_"), self.callback20)
261-
self.run(sql40.format("touched_"), self.callback40)

0 commit comments

Comments
 (0)