Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add analyzer for power poles in france_centre_cher provided by SDE18 #2393

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions analysers/Analyser_Merge_power_pole_FR_gracethd2.py
Original file line number Diff line number Diff line change
@@ -21,11 +21,11 @@
###########################################################################

from modules.OsmoseTranslation import T_
from .Analyser_Merge import Analyser_Merge_Point, SHP, LoadGeomCentroid, Conflate, Select, Mapping
from .Analyser_Merge import Analyser_Merge_Point, GDAL, LoadGeomCentroid, Conflate, Select, Mapping


class Analyser_Merge_power_pole_FR_gracethd2 (Analyser_Merge_Point):
def __init__(self, config, source_url, dataset_name, source, srid, conflationDistance, classs, extract_operator = None, logger = None):
def __init__(self, config, source_url, dataset_name, source, conflationDistance, classs, extract_operator = None, logger = None):
Analyser_Merge_Point.__init__(self, config, logger)
self.def_class_missing_official(item = 8290, id = classs + 1, level = 3, tags = ['merge', 'power', 'fix:chair', 'fix:survey'],
title = T_('Power pole not integrated'))
@@ -37,7 +37,7 @@ def __init__(self, config, source_url, dataset_name, source, srid, conflationDis
self.init(
source_url,
dataset_name,
SHP(source, srid = srid, zip="*.shp"),
GDAL(source, zip="*.shp"),
LoadGeomCentroid(select = {"modele": ["PBOI", "PBET", "PCMP", "PMET"]}),
Conflate(
select = Select(
6 changes: 3 additions & 3 deletions analysers/Analyser_Merge_power_pole_FR_gracethd3.py
Original file line number Diff line number Diff line change
@@ -21,11 +21,11 @@
###########################################################################

from modules.OsmoseTranslation import T_
from .Analyser_Merge import Analyser_Merge_Point, SHP, LoadGeomCentroid, Conflate, Select, Mapping
from .Analyser_Merge import Analyser_Merge_Point, GDAL, LoadGeomCentroid, Conflate, Select, Mapping


class Analyser_Merge_power_pole_FR_gracethd3 (Analyser_Merge_Point):
def __init__(self, config, source_url, dataset_name, source, srid, conflationDistance, classs, extract_operator = None, logger = None):
def __init__(self, config, source_url, dataset_name, source, conflationDistance, classs, extract_operator = None, logger = None):
Analyser_Merge_Point.__init__(self, config, logger)
self.def_class_missing_official(item = 8290, id = classs + 1, level = 3, tags = ['merge', 'power', 'fix:chair', 'fix:survey'],
title = T_('Power pole not integrated'))
@@ -37,7 +37,7 @@ def __init__(self, config, source_url, dataset_name, source, srid, conflationDis
self.init(
source_url,
dataset_name,
SHP(source, srid = srid, zip="*.shp"),
GDAL(source, zip="*.shp"),
LoadGeomCentroid(),
Conflate(
select = Select(
1 change: 0 additions & 1 deletion analysers/analyser_merge_power_pole_FR_gracethd2_vendee.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@ def __init__(self, config, logger = None):
attribution="Vendée Numérique",
dataset="673d09a837eab9c52f42268b",
resource="cc66ae17-26a2-43f5-aea3-37496775776c"),
srid = 2154,
conflationDistance=5,
classs=1000,
extract_operator = {
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@ def __init__(self, config, logger = None):
attribution="Mégalis Bretagne",
dataset="6613a43e5b40aaa8022d3787",
resource="b00051b6-69e5-42c3-8229-f6b556561d83"),
srid = 2154,
conflationDistance=5,
classs=1000,
extract_operator = {
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@ def __init__(self, config, logger = None):
attribution="Syndicat Mixte Périgord Numérique",
dataset="659d72fb641c7c0d6fe6cc59",
resource="82e49c1f-976f-4be7-ab20-0a58e9badb56"),
srid = 2154,
conflationDistance=5,
classs=1000,
extract_operator = {
1 change: 0 additions & 1 deletion analysers/analyser_merge_power_pole_FR_gracethd3_jura.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@ def __init__(self, config, logger = None):
attribution="SIDEC Jura",
dataset="66158cdd04686348037417af",
resource="3f427bbd-f2bb-49dc-9457-c0aad16b1529"),
srid = 2154,
conflationDistance=5,
classs=1000,
extract_operator = {
63 changes: 63 additions & 0 deletions analysers/analyser_merge_power_pole_FR_spec_sde18.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env python
#-*- coding: utf-8 -*-

###########################################################################
## ##
## Copyrights François Lacombe - 2024 ##
## ##
## This program is free software: you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation, either version 3 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program. If not, see <http://www.gnu.org/licenses/>. ##
## ##
###########################################################################

from modules.OsmoseTranslation import T_
from .Analyser_Merge import Analyser_Merge_Point, SourceDataGouv, GDAL, LoadGeomCentroid, Conflate, Select, Mapping


class Analyser_Merge_power_pole_FR_spec_sde18 (Analyser_Merge_Point):
def __init__(self, config, logger = None):
Analyser_Merge_Point.__init__(self, config, logger)
self.def_class_missing_official(item = 8290, id = 1001, level = 3, tags = ['merge', 'power', 'fix:chair', 'fix:survey'],
title = T_('Power pole not integrated'))
self.def_class_possible_merge(item = 8291, id = 1003, level = 3, tags = ['merge', 'power', 'fix:chair', 'fix:survey'],
title = T_('Power pole integration suggestion'))
self.def_class_update_official(item = 8290, id = 1004, level = 3, tags = ['merge', 'power', 'fix:chair', 'fix:survey'],
title = T_('Power pole update'))

self.init(
"https://www.data.gouv.fr/fr/datasets/supports-eclairage-public-du-sde18/",
"Supports Eclairage Public du SDE18",
GDAL(SourceDataGouv(
attribution="SDE 18",
dataset="673b1255be2baa1d2a71c950",
resource="3d617c33-05e1-4190-a3ca-802d94dad509"
),
zip="*.shp"),
LoadGeomCentroid(select = {"_type": ["poteau", "Poteau", "POTEAU"]} ),
Conflate(
select = Select(
types = ['nodes'],
tags = {'power': 'pole'}),
conflationDistance = 5,
mapping = Mapping(
static1 = {'power': 'pole'},
static2 = {'source': self.source, 'highway': 'street_lamp', 'operator':'Enedis', 'operator:wikidata':'Q3587594'},
mapping1 = {
'material': lambda res: self.extract_material.get(res['_matiere']),
'height': lambda res: res['hauteur'] if res['hauteur'] and res['hauteur'] > 6.0 else None},
text = lambda tags, fields: {} )))

extract_material = {
'Bois': 'wood',
'Béton': 'concrete'
}
1 change: 0 additions & 1 deletion analysers/analyser_merge_power_pole_FR_spec_sdey.py
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@ def __init__(self, config, logger = None):
GDAL(Source(
attribution="Syndicat Départemental d'Energies de l'Yonne",
fileUrl="https://trouver.ternum-bfc.fr/dataset/bd94f0e8-b76b-4135-828f-c84e9711e348/resource/e21e39bc-5b51-4c23-b737-1e698ad41d0c/download/pt_lum_89_support_poteau.zip"),
srid = 2154,
zip="*.shp"),
LoadGeomCentroid(select = {"natursupor": ["EP+BT", "EP+BT+FT"]} ),
Conflate(
4 changes: 3 additions & 1 deletion osmose_config.py
Original file line number Diff line number Diff line change
@@ -367,7 +367,9 @@ class gen(default_country):
'merge_defibrillators_FR_lorient',
])

france_departement("centre/cher", 7456, "FR-18")
france_departement("centre/cher", 7456, "FR-18", include=[
'merge_power_pole_FR_spec_sde18',
])
france_departement("centre/eure_et_loir", 7374, "FR-28")
france_departement("centre/indre", 7417, "FR-36")
france_departement("centre/indre_et_loire", 7408, "FR-37")