Skip to content

Commit

Permalink
Add operator wikidata tag to power analysers
Browse files Browse the repository at this point in the history
  • Loading branch information
flacombe committed Feb 23, 2025
1 parent 8c6761d commit 9d1566f
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 16 deletions.
3 changes: 2 additions & 1 deletion analysers/Analyser_Merge_power_pole_FR_gracethd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def __init__(self, config, source_url, dataset_name, source, conflationDistance,
static2 = {'source': self.source},
mapping1 = {
'material': lambda res: self.extract_material.get(res['modele']),
'operator': lambda res: extract_operator.get(res['gestionnai'], extract_operator.get(res['proprietai'])),
'operator': lambda res: extract_operator.get(res['gestionnai'])[0] if res['gestionnai'] in extract_operator else extract_operator.get(res['proprietai'])[0] if res['proprietai'] in extract_operator else None,
'operator:wikidata': lambda res: extract_operator.get(res['gestionnai'])[1] if res['gestionnai'] in extract_operator else extract_operator.get(res['proprietai'])[1] if res['proprietai'] in extract_operator else None,
'height': lambda res: res['prof_haut'] if res['prof_haut'] and float(res['prof_haut']) > 6.0 else None},
text = lambda tags, fields: {} )))

Expand Down
3 changes: 2 additions & 1 deletion analysers/Analyser_Merge_power_pole_FR_gracethd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def __init__(self, config, source_url, dataset_name, source, conflationDistance,
static2 = {'source': self.source},
mapping1 = {
'material': lambda res: self.extract_material.get(res['pt_nature']),
'operator': lambda res: extract_operator.get(res['pt_gest'], extract_operator.get(res['pt_prop'])),
'operator': lambda res: extract_operator.get(res['pt_gest'])[0] if res['pt_gest'] in extract_operator else extract_operator.get(res['pt_prop'])[0] if res['pt_prop'] in extract_operator else None,
'operator:wikidata': lambda res: extract_operator.get(res['pt_gest'])[1] if res['pt_gest'] in extract_operator else extract_operator.get(res['pt_prop'])[1] if res['pt_prop'] in extract_operator else None,
'height': lambda res: res['pt_a_haut'] if res['pt_a_haut'] and float(res['pt_a_haut']) > 6.0 else None},
text = lambda tags, fields: {} )))

Expand Down
2 changes: 1 addition & 1 deletion analysers/analyser_merge_power_pole_FR_gracethd2_vendee.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def __init__(self, config, logger = None):
conflationDistance=5,
classs=1010,
extract_operator = {
'ENEDIS': 'Enedis'
'ENEDIS': ['Enedis', 'Q3587594']
},
logger=logger)
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def __init__(self, config, logger = None):
conflationDistance=5,
classs=1020,
extract_operator = {
'ORMB0000000003': 'Enedis'
'ORMB0000000003': ['Enedis','Q3587594']
},
logger=logger)
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def __init__(self, config, logger = None):
conflationDistance=5,
classs=1030,
extract_operator = {
'OR000000000003': 'Enedis'
'OR000000000003': ['Enedis','Q3587594']
},
logger=logger)
2 changes: 1 addition & 1 deletion analysers/analyser_merge_power_pole_FR_gracethd3_jura.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def __init__(self, config, logger = None):
conflationDistance=5,
classs=1040,
extract_operator = {
'OR00000003': 'Enedis'
'OR00000003': ['Enedis', 'Q3587594']
},
logger=logger)
8 changes: 1 addition & 7 deletions analysers/analyser_merge_power_pole_FR_spec_sdey.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,13 @@ def __init__(self, config, logger = None):
tags = {'power': 'pole'}),
conflationDistance = 5,
mapping = Mapping(
static1 = {'power': 'pole'},
static1 = {'power': 'pole', 'operator':'Enedis', 'operator:wikidata':'Q3587594'},
static2 = {'source': self.source, 'highway': 'street_lamp'},
mapping1 = {
'material': lambda res: self.extract_material.get(res['matieresup']),
'operator': lambda res: self.extract_operator.get(res['natursupor']),
'height': lambda res: res['haut_mat_m'] if res['haut_mat_m'] and res['haut_mat_m'].isnumeric() and float(res['haut_mat_m']) > 6.0 else None},
text = lambda tags, fields: {} )))

extract_operator = {
'EP+BT': 'Enedis',
'EP+BT+FT': 'Enedis'
}

extract_material = {
'BOIS': 'wood',
'BETON': 'concrete',
Expand Down
37 changes: 34 additions & 3 deletions analysers/analyser_merge_power_substation_minor_FR.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,40 @@ def __init__(self, config, logger = None):
static2 = {
"substation": "minor_distribution", # Currently default value, we're unable to destinguish distribution and minor_distribution in opendata
"voltage": "20000"}, # Currently lawful default value as there is no opendata to define it. Mappers may be knowledgeable
mapping1 = {
"operator": lambda res: self.extract_operator.get(res['GRD'])[0] if res['GRD'] in self.extract_operator else res['GRD'],
"operator:wikidata": lambda res: self.extract_operator.get(res['GRD'])[1] if res['GRD'] in self.extract_operator else None,
"name": lambda fields: fields["Nom poste"] if fields["Nom poste"] != "" else None},
mapping2 = {
"operator": "GRD",
"name": lambda fields: fields["Nom poste"] if fields["Nom poste"] != "" and fields["GRD"] != "Strasbourg Électricité Réseaux" else None,
"ref": lambda fields: fields["Nom poste"] if fields["Nom poste"] != "" and fields["GRD"] == "Strasbourg Électricité Réseaux" else None,
"source": lambda fields: self.source() + " - " + fields["GRD"]},
)))

# Main source: https://wiki.openstreetmap.org/wiki/Power_networks/France/Exploitants#Entreprises_de_distribution
extract_operator = {
"Coopérative d'électricité de Saint Martin de Londres": ['CESML', None],
#"Ene'O - Energies Services Occitans": [None, None],
'Enedis': ['Enedis', 'Q3587594'],
#'Energie développement services du Briançonnais': [None, None],
'Energie et Services de Seyssel': ['ESSeyssel', 'Q92878829'],
#'Gascogne Energies Services': [None, None],
'Gedia': ['Gedia', None],
'GÉRÉDIS': ['Gérédis', 'Q112115590'],
'GreenAlp': ['GreenAlp', 'Q115580260'],
#'Gignac Energie': [None, None],
"Régie d'Electricité de Thônes": ['REThones', 'Q115579327'],
#'Régie Services Energie': [None, None],
'réséda': ['réséda', 'Q112115721'],
'SOREA': ['Sorea', 'Q115470007'],
'SRD': ['SRD', 'Q110319893'],
#'SEM Beauvois Distrelec': [None, None],
#'SEML ENERGIES HAUTE TARENTAISE': [None, None],
'SICAE du Carmausin': ['SICAE-Carmausin', None],
'SICAE Est': ['SICAE Est', None],
'SICAE Oise': ['SICAE Oise', None],
'SICAE de la Somme et du Cambraisis': ['SICAE-Somme', None],
'SICAP': ['SICAP', None],
'Strasbourg Électricité Réseaux': ['SER', 'Q107352347'],
"Syndicat d'électricité synergie Maurienne": ['Synergie Maurienne', None],
'Synelva': ['Synelva', 'Q115470023'],
'Vialis': ['Vialis', 'Q113841490'],
}

0 comments on commit 9d1566f

Please sign in to comment.