|
@@ -2,31 +2,31 @@
|
|
|
|
|
|
|
|
@author: olivier.massot, 2018
|
|
@author: olivier.massot, 2018
|
|
|
'''
|
|
'''
|
|
|
-from core import gis
|
|
|
|
|
|
|
+from core import gis_
|
|
|
from core.cerberus_extend import is_int, is_float, \
|
|
from core.cerberus_extend import is_int, is_float, \
|
|
|
- is_modern_french_date
|
|
|
|
|
|
|
+ is_modern_french_date, is_multi_int
|
|
|
from core.validation import BaseGeoModel
|
|
from core.validation import BaseGeoModel
|
|
|
from schemas.common import INSEE_VALIDES, XMIN, YMIN, XMAX, YMAX
|
|
from schemas.common import INSEE_VALIDES, XMIN, YMIN, XMAX, YMAX
|
|
|
|
|
|
|
|
|
|
|
|
|
class Artere(BaseGeoModel):
|
|
class Artere(BaseGeoModel):
|
|
|
filename = "artere_geo.shp"
|
|
filename = "artere_geo.shp"
|
|
|
- schema = {'geom': {'geometry': (gis.POLYLINE, (XMIN, YMIN, XMAX, YMAX))},
|
|
|
|
|
- 'AR_ID_INSE': {'type': 'string', 'empty': False, 'allowed': INSEE_VALIDES},
|
|
|
|
|
|
|
+ geom_type = gis_.GEOM_LINE
|
|
|
|
|
+ bounding_box = (XMIN,YMIN,XMAX,YMAX)
|
|
|
|
|
+ schema = {'AR_ID_INSE': {'type': 'string', 'empty': False, 'allowed': INSEE_VALIDES},
|
|
|
'AR_LONG': {'empty': False, 'validator': is_float},
|
|
'AR_LONG': {'empty': False, 'validator': is_float},
|
|
|
'AR_ETAT': {'type': 'string', 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
'AR_ETAT': {'type': 'string', 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
|
'AR_OCCP': {'type': 'string', 'empty': False, 'allowed': ['0', '1.1', '1.2', '2', '3', '4']},
|
|
'AR_OCCP': {'type': 'string', 'empty': False, 'allowed': ['0', '1.1', '1.2', '2', '3', '4']},
|
|
|
'AR_NOEUD_A': {'type': 'string', 'empty': False, 'maxlength': 20},
|
|
'AR_NOEUD_A': {'type': 'string', 'empty': False, 'maxlength': 20},
|
|
|
'AR_NOEUD_B': {'type': 'string', 'empty': False, 'maxlength': 20},
|
|
'AR_NOEUD_B': {'type': 'string', 'empty': False, 'maxlength': 20},
|
|
|
- 'AR_NB_FOUR': {'empty': False, 'validator': is_int},
|
|
|
|
|
-# 'AR_NB_FOUR': {'type': 'string', 'maxlength': 10},
|
|
|
|
|
|
|
+ 'AR_NB_FOUR': {'empty': False, 'validator': is_multi_int},
|
|
|
'AR_FOU_DIS': {'empty': False, 'validator': is_int},
|
|
'AR_FOU_DIS': {'empty': False, 'validator': is_int},
|
|
|
'AR_TYPE_FO': {'type': 'string', 'empty': False, 'multiallowed': ['PVC', 'PEHD', 'SOUS-TUBAGE PEHD', 'SOUS-TUBAGE SOUPLE', 'FACADE', 'AERIEN', 'ENCORBELLEMENT', 'AUTRE']},
|
|
'AR_TYPE_FO': {'type': 'string', 'empty': False, 'multiallowed': ['PVC', 'PEHD', 'SOUS-TUBAGE PEHD', 'SOUS-TUBAGE SOUPLE', 'FACADE', 'AERIEN', 'ENCORBELLEMENT', 'AUTRE']},
|
|
|
- 'AR_DIAM_FO': {'type': 'string', 'empty': False, 'multiallowed': ['10', '14', '18', '25', '28', '32', '40', '45', '60', 'NUL']},
|
|
|
|
|
- 'AR_PRO_FOU': {'type': 'string', 'empty': False, 'multiallowed': ['MANCHE NUMERIQUE', 'COLLECTIVITE', 'ORANGE', 'AUTRE (à préciser)']},
|
|
|
|
|
|
|
+ 'AR_DIAM_FO': {'type': 'string', 'empty': False, 'multiallowed': ['10', '14', '18', '25', '28', '32', '40', '45', '60', '80', '150', 'NUL']},
|
|
|
|
|
+ 'AR_PRO_FOU': {'type': 'string', 'empty': False, 'multiallowed': ['MANCHE NUMERIQUE', 'COLLECTIVITE', 'ORANGE', 'PRIVE', 'ERDF', 'AUTRE (à préciser)']},
|
|
|
'AR_PRO_CAB': {'type': 'string', 'empty': False, 'allowed': ['MANCHE NUMERIQUE']},
|
|
'AR_PRO_CAB': {'type': 'string', 'empty': False, 'allowed': ['MANCHE NUMERIQUE']},
|
|
|
'AR_GEST_FO': {'type': 'string', 'empty': False, 'multiallowed': ['MANCHE NUMERIQUE', 'MANCHE TELECOM', 'COLLECTIVITE', 'ORANGE', 'MANCHE FIBRE', 'PRIVE', 'ERDF', 'AUTRE (à préciser)', 'NUL']},
|
|
'AR_GEST_FO': {'type': 'string', 'empty': False, 'multiallowed': ['MANCHE NUMERIQUE', 'MANCHE TELECOM', 'COLLECTIVITE', 'ORANGE', 'MANCHE FIBRE', 'PRIVE', 'ERDF', 'AUTRE (à préciser)', 'NUL']},
|
|
|
- 'AR_UTIL_FO': {'type': 'string', 'empty': False, 'multiallowed': ['MANCHE NUMERIQUE', 'MANCHE TELECOM', 'COLLECTIVITE', 'ORANGE', 'PRIVE', 'AUTRE (à préciser)', 'NUL']},
|
|
|
|
|
|
|
+ 'AR_UTIL_FO': {'type': 'string', 'empty': False, 'multiallowed': ['MANCHE NUMERIQUE', 'MANCHE TELECOM', 'MANCHE FIBRE', 'COLLECTIVITE', 'ORANGE', 'PRIVE', 'AUTRE (à préciser)', 'NUL']},
|
|
|
'AR_DATE_IN': {'empty': False, 'validator': is_modern_french_date},
|
|
'AR_DATE_IN': {'empty': False, 'validator': is_modern_french_date},
|
|
|
'AR_DATE_RE': {'empty': False, 'validator': is_modern_french_date},
|
|
'AR_DATE_RE': {'empty': False, 'validator': is_modern_french_date},
|
|
|
'AR_REF_PLA': {'type': 'string', 'maxlength': 100},
|
|
'AR_REF_PLA': {'type': 'string', 'maxlength': 100},
|
|
@@ -41,8 +41,9 @@ class Artere(BaseGeoModel):
|
|
|
|
|
|
|
|
class Cable(BaseGeoModel):
|
|
class Cable(BaseGeoModel):
|
|
|
filename = "cable_geo.shp"
|
|
filename = "cable_geo.shp"
|
|
|
- schema = {'geom': {'geometry': (gis.POLYLINE, (XMIN, YMIN, XMAX, YMAX))},
|
|
|
|
|
- 'CA_NUMERO': {'type': 'string', 'maxlength': 17},
|
|
|
|
|
|
|
+ geom_type = gis_.GEOM_LINE
|
|
|
|
|
+ bounding_box = (XMIN,YMIN,XMAX,YMAX)
|
|
|
|
|
+ schema = {'CA_NUMERO': {'type': 'string', 'maxlength': 17},
|
|
|
'CA_TYPE': {'type': 'string', 'maxlength': 10, 'empty': False, 'allowed': ['AERIEN', 'IMMEUBLE', 'FACADE', 'MIXTE', 'SOUTERRAIN']},
|
|
'CA_TYPE': {'type': 'string', 'maxlength': 10, 'empty': False, 'allowed': ['AERIEN', 'IMMEUBLE', 'FACADE', 'MIXTE', 'SOUTERRAIN']},
|
|
|
'CA_ETAT': {'type': 'string', 'maxlength': 1, 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
'CA_ETAT': {'type': 'string', 'maxlength': 1, 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
|
'CA_LONG': {'validator': is_float},
|
|
'CA_LONG': {'validator': is_float},
|
|
@@ -65,9 +66,10 @@ class Cable(BaseGeoModel):
|
|
|
|
|
|
|
|
class Equipement(BaseGeoModel):
|
|
class Equipement(BaseGeoModel):
|
|
|
filename = "equipement_passif.shp"
|
|
filename = "equipement_passif.shp"
|
|
|
- schema = {'geom': {'geometry': (gis.POINT, (XMIN, YMIN, XMAX, YMAX))},
|
|
|
|
|
- 'EQ_NOM': {'type': 'string', 'maxlength': 10, 'contains_any_of': ['PBO', 'BPE', 'BAI']},
|
|
|
|
|
- 'EQ_NOM_NOE': {'type': 'string', 'maxlength': 14},
|
|
|
|
|
|
|
+ geom_type = gis_.GEOM_POINT
|
|
|
|
|
+ bounding_box = (XMIN,YMIN,XMAX,YMAX)
|
|
|
|
|
+ schema = {'EQ_NOM': {'type': 'string', 'maxlength': 10, 'contains_any_of': ['PBO', 'BPE', 'BAI']},
|
|
|
|
|
+ 'EQ_NOM_NOE': {'type': 'string', 'maxlength': 30},
|
|
|
'EQ_ETAT': {'type': 'string', 'maxlength': 1, 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
'EQ_ETAT': {'type': 'string', 'maxlength': 1, 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
|
'EQ_OCCP': {'type': 'string', 'maxlength': 3, 'empty': False, 'allowed': ['0', '1.1', '1.2', '2', '3', '4']},
|
|
'EQ_OCCP': {'type': 'string', 'maxlength': 3, 'empty': False, 'allowed': ['0', '1.1', '1.2', '2', '3', '4']},
|
|
|
'EQ_TYPE': {'type': 'string', 'empty': False, 'allowed': ['PBO', 'PBOE', 'BPE', 'BAI']},
|
|
'EQ_TYPE': {'type': 'string', 'empty': False, 'allowed': ['PBO', 'PBOE', 'BPE', 'BAI']},
|
|
@@ -85,8 +87,9 @@ class Equipement(BaseGeoModel):
|
|
|
|
|
|
|
|
class Noeud(BaseGeoModel):
|
|
class Noeud(BaseGeoModel):
|
|
|
filename = "noeud_geo.shp"
|
|
filename = "noeud_geo.shp"
|
|
|
- schema = {'geom': {'geometry': (gis.POINT, (XMIN, YMIN, XMAX, YMAX))},
|
|
|
|
|
- 'NO_NOM': {'type': 'string', 'maxlength': 20},
|
|
|
|
|
|
|
+ geom_type = gis_.GEOM_POINT
|
|
|
|
|
+ bounding_box = (XMIN,YMIN,XMAX,YMAX)
|
|
|
|
|
+ schema = {'NO_NOM': {'type': 'string', 'maxlength': 30},
|
|
|
'NO_ID_INSE': {'type': 'string', 'empty': False, 'allowed': INSEE_VALIDES},
|
|
'NO_ID_INSE': {'type': 'string', 'empty': False, 'allowed': INSEE_VALIDES},
|
|
|
'NO_VOIE': {'type': 'string', 'maxlength': 100},
|
|
'NO_VOIE': {'type': 'string', 'maxlength': 100},
|
|
|
'NO_ETAT': {'type': 'string', 'maxlength': 1, 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
'NO_ETAT': {'type': 'string', 'maxlength': 1, 'empty': False, 'allowed': ['0', '1', '2', '3', '4']},
|
|
@@ -97,7 +100,7 @@ class Noeud(BaseGeoModel):
|
|
|
'NO_CODE_PH': {'type': 'string', 'maxlength': 20},
|
|
'NO_CODE_PH': {'type': 'string', 'maxlength': 20},
|
|
|
'NO_TECH_PS': {'type': 'string', 'maxlength': 20, 'empty': False, 'multiallowed': ['COAX', 'CUT', 'ECL', 'ELEC', 'VP', 'OPT', 'NC']},
|
|
'NO_TECH_PS': {'type': 'string', 'maxlength': 20, 'empty': False, 'multiallowed': ['COAX', 'CUT', 'ECL', 'ELEC', 'VP', 'OPT', 'NC']},
|
|
|
'NO_AMO': {'type': 'string', 'maxlength': 20},
|
|
'NO_AMO': {'type': 'string', 'maxlength': 20},
|
|
|
- 'NO_PLINOX': {'type': 'string', 'maxlength': 3, 'empty': False, 'allowed': ['OUI', 'NON']},
|
|
|
|
|
|
|
+ 'NO_PLINOX': {'required':False, 'type': 'string', 'maxlength': 3, 'allowed': ['OUI', 'NON']},
|
|
|
'NO_X': {'empty': False, 'validator': is_float},
|
|
'NO_X': {'empty': False, 'validator': is_float},
|
|
|
'NO_Y': {'empty': False, 'validator': is_float},
|
|
'NO_Y': {'empty': False, 'validator': is_float},
|
|
|
'NO_PRO': {'type': 'string', 'maxlength': 20, 'empty': False, 'allowed': ['MANCHE NUMERIQUE', 'COLLECTIVITE', 'ORANGE', 'ERDF', 'PRIVE', 'AUTRE (à préciser)', 'NUL']},
|
|
'NO_PRO': {'type': 'string', 'maxlength': 20, 'empty': False, 'allowed': ['MANCHE NUMERIQUE', 'COLLECTIVITE', 'ORANGE', 'ERDF', 'PRIVE', 'AUTRE (à préciser)', 'NUL']},
|
|
@@ -116,8 +119,9 @@ class Noeud(BaseGeoModel):
|
|
|
|
|
|
|
|
class Tranchee(BaseGeoModel):
|
|
class Tranchee(BaseGeoModel):
|
|
|
filename = "tranchee_geo.shp"
|
|
filename = "tranchee_geo.shp"
|
|
|
- schema = {'geom': {'geometry': (gis.POLYLINE, (XMIN, YMIN, XMAX, YMAX))},
|
|
|
|
|
- 'TR_ID_INSE': {'type': 'string', 'empty': False, 'allowed': INSEE_VALIDES},
|
|
|
|
|
|
|
+ geom_type = gis_.GEOM_LINE
|
|
|
|
|
+ bounding_box = (XMIN,YMIN,XMAX,YMAX)
|
|
|
|
|
+ schema = {'TR_ID_INSE': {'type': 'string', 'empty': False, 'allowed': INSEE_VALIDES},
|
|
|
'TR_VOIE': {'type': 'string', 'maxlength': 200},
|
|
'TR_VOIE': {'type': 'string', 'maxlength': 200},
|
|
|
'TR_TYP_IMP': {'type': 'string', 'empty': False, 'allowed': ['ACCOTEMENT STABILISE', 'ACCOTEMENT NON STABILISE', 'CHAUSSEE LOURDE', 'CHAUSSEE LEGERE', 'FOSSE', 'TROTTOIR', 'ESPACE VERT', 'ENCORBELLEMENT']},
|
|
'TR_TYP_IMP': {'type': 'string', 'empty': False, 'allowed': ['ACCOTEMENT STABILISE', 'ACCOTEMENT NON STABILISE', 'CHAUSSEE LOURDE', 'CHAUSSEE LEGERE', 'FOSSE', 'TROTTOIR', 'ESPACE VERT', 'ENCORBELLEMENT']},
|
|
|
'TR_MOD_POS': {'type': 'string', 'empty': False, 'allowed': ['TRADITIONNEL', 'MICRO TRANCHEE', 'FONCAGE 60', 'FONCAGE 90', 'FONCAGE 120', 'TRANCHEUSE', 'FORAGE URBAIN', 'FORAGE RURAL', 'ENCORBELLEMENT']},
|
|
'TR_MOD_POS': {'type': 'string', 'empty': False, 'allowed': ['TRADITIONNEL', 'MICRO TRANCHEE', 'FONCAGE 60', 'FONCAGE 90', 'FONCAGE 120', 'TRANCHEUSE', 'FORAGE URBAIN', 'FORAGE RURAL', 'ENCORBELLEMENT']},
|
|
@@ -143,8 +147,9 @@ class Tranchee(BaseGeoModel):
|
|
|
|
|
|
|
|
class Zapbo(BaseGeoModel):
|
|
class Zapbo(BaseGeoModel):
|
|
|
filename = "zapbo_geo.shp"
|
|
filename = "zapbo_geo.shp"
|
|
|
- schema = {'geom': {'geometry': (gis.POLYGON, (XMIN, YMIN, XMAX, YMAX))},
|
|
|
|
|
- 'ID_ZAPBO': {'type': 'string', 'maxlength': 30, 'contains_any_of': ['PBO', 'BPE']},
|
|
|
|
|
|
|
+ geom_type = gis_.GEOM_POLYGON
|
|
|
|
|
+ bounding_box = (XMIN,YMIN,XMAX,YMAX)
|
|
|
|
|
+ schema = {'ID_ZAPBO': {'type': 'string', 'maxlength': 30, 'contains_any_of': ['PBO', 'BPE']},
|
|
|
'COMMENTAIR': {'type': 'string', 'maxlength': 254, 'empty': True},
|
|
'COMMENTAIR': {'type': 'string', 'maxlength': 254, 'empty': True},
|
|
|
'STATUT': {'type': 'string', 'empty': False, 'allowed': ['APS', 'APD', 'EXE', 'REC']}}
|
|
'STATUT': {'type': 'string', 'empty': False, 'allowed': ['APS', 'APD', 'EXE', 'REC']}}
|
|
|
|
|
|