filter duplicates

This commit is contained in:
Frédéric Péters 2016-07-12 19:54:55 +02:00
parent 6f09ad5af5
commit fee64cb038
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,7 @@ class ImioLiegeLisrue(BaseResource):
lisrues = []
streets = []
known_street_labels = {}
for item in lisrues:
if item.get('rue'):
street_label = item.get('rue')
@ -83,6 +84,9 @@ class ImioLiegeLisrue(BaseResource):
item.get('libelleMinuscule'))
else:
continue
if street_label in known_street_labels:
continue
known_street_labels[street_label] = True
streets.append({
'id': item.get('codeRue'),
'text': street_label.strip(),