-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlire_modele.py
39 lines (32 loc) · 1.03 KB
/
lire_modele.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# coding: utf-8
"""
Lecture d'un modèle Crue10
"""
import os.path
import sys
from crue10.utils import ExceptionCrue10, logger
from crue10.etude import Etude
try:
FileNotFoundError
except NameError: # Python2 fix
FileNotFoundError = IOError
try:
# Get modele
etude = Etude(os.path.join('..', '..', 'Crue10_examples', 'sharepoint_modeles_Conc',
'Etu_BE2016_conc', 'Etu_BE2016_conc.etu.xml'))
modele = etude.get_scenario_courant().modele
modele.read_all()
print(modele)
for sous_modele in modele.liste_sous_modeles:
print(sous_modele)
# sous_modele.convert_sectionidem_to_sectionprofil()
# Write some output files
# modele.write_mascaret_geometry('../tmp/Etu_VS2003_Conc.georef')
modele.write_shp_limites_lits_numerotes('../tmp/limites.shp')
modele.write_shp_sectionprofil_as_points('../tmp/liste_sections.shp')
except FileNotFoundError as e:
logger.critical(e)
sys.exit(1)
except ExceptionCrue10 as e:
logger.critical(e)
sys.exit(2)