def get_district_mismatches(self, comparison_view='compare', district_id=182):
"""Get OSM entities which have an fhrs:id for which there is no match
in the database.
district_id (integer): Boundary Line district ID
Returns dict
"""
dict_cur = self.connection.cursor(cursor_factory=DictCursor)
sql = ('SELECT osm_name, osm_fhrsid, TRIM(TRAILING ' ' FROM osm_type) as osm_type,\n' +
'osm_id, CONCAT(substring(osm_type FROM 1 FOR 1), osm_id) AS osm_ident\n' +
'FROM compare\n' +
'WHERE status = \'mismatch\' AND osm_district_id = %s')
values = (district_id,)
dict_cur.execute(sql, values)
result = []
for row in dict_cur.fetchall():
result.append(row)
return result
评论列表
文章目录