This commit is contained in:
Alex38Lyon
2025-08-27 19:11:11 +02:00
parent af1b72f5c4
commit 4e8b86db56
12 changed files with 1028 additions and 430 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ error_count = 0 # Compteur d'erreurs
## [Survey_Data] default values
Author = "Created by pyCreateTh.py"
Copyright = "# Copyright(C) pyCreateTh.py"
CopyrightShort = "Licence(C) pyCreateTh.py"
CopyrightShort = "License(C) pyCreateTh.py"
mapComment = "Created by pyCreateTh.py"
cs = "UTM30"
club = "Therion"
@@ -131,7 +131,7 @@ def writethconfig(pdata, icomments, icoupe, thlang, dictcave,
f2w.write(u'encoding utf-8 \n\n')
f2w.write(u'# File written by pytro2th (Xavier Robert) \n')
f2w.write(u'# Copyright (C) %s Xavier Robert <xavier.robert***@***ird.fr> \n' %(str(datetime.datetime.now().year)))
f2w.write(u'# This work is under the licence Creatice Commonc CC-by-nc-sa v.4 \n\n')
f2w.write(u'# This work is under the License Creatice Commonc CC-by-nc-sa v.4 \n\n')
if icomments:
@@ -561,7 +561,7 @@ def writethc(pdata, cavename = None, istructure = True):
Author: Xavier Robert, Lima 2016/06/27
Licence: CCby-nc
License: CCby-nc
"""
# Open the file
@@ -331,7 +331,7 @@ def write_thtot(file, cavename = u'cave', icomments = True, thlang = 'en'):
if icomments:
if thlang == u'fr':
file.write(u'# Copyright (C) %s Xavier Robert <xavier.robert***@***ird.fr>\n' %(str(datetime.datetime.now().year)))
file.write(u'# Ce travaille est sous la licence Creative Commons Attribution-ShareAlike-NonCommecial :\n')
file.write(u'# Ce travaille est sous la License Creative Commons Attribution-ShareAlike-NonCommecial :\n')
file.write(u'# <http://creativecommons.org/licenses/by-nc-sa/4.0/>\n\n')
elif thlang == u'en':
file.write(u'# Copyright (C) %s Xavier Robert <xavier.robert***@***ird.fr>\n' %(str(datetime.datetime.now().year)))
@@ -429,7 +429,7 @@ def write_thmaps(file, cavename = u'cave', icomments = True, thlang = 'en'):
if icomments:
if thlang == u'fr':
file.write(u'# Copyright (C) %s Xavier Robert <xavier.robert***@***ird.fr>\n' %(str(datetime.datetime.now().year)))
file.write(u'# Ce travail est sous la licence Creative Commons Attribution-ShareAlike-NonCommecial :\n')
file.write(u'# Ce travail est sous la License Creative Commons Attribution-ShareAlike-NonCommecial :\n')
file.write(u'# <http://creativecommons.org/licenses/by-nc-sa/4.0/>\n\n')
elif thlang == u'en':
file.write(u'# Copyright (C) %s Xavier Robert <xavier.robert***@***ird.fr>\n' %(str(datetime.datetime.now().year)))
@@ -498,7 +498,7 @@ def write_thcoords(file, cavename = u'cave', coordinates = None, coordsyst = Non
if icomments:
if thlang == u'fr':
file.write(u'# Copyright (C) %s Xavier Robert <xavier.robert***@***ird.fr>\n' %(str(datetime.datetime.now().year)))
file.write(u'# Ce travail est sous la licence Creative Commons Attribution-ShareAlike-NonCommecial :\n')
file.write(u'# Ce travail est sous la License Creative Commons Attribution-ShareAlike-NonCommecial :\n')
file.write(u'# <http://creativecommons.org/licenses/by-nc-sa/4.0/>\n\n')
elif thlang == u'en':
file.write(u'# Copyright (C) %s Xavier Robert <xavier.robert***@***ird.fr>\n' %(str(datetime.datetime.now().year)))
@@ -16,7 +16,7 @@ The different arguments are described.
xavier.robert@ujf-grenoble.fr
(c) licence CCby-nc : http://creativecommons.org/licenses/by-nc/3.0/ 2015
(c) License CCby-nc : http://creativecommons.org/licenses/by-nc/3.0/ 2015
"""
+2 -2
View File
@@ -152,7 +152,7 @@ def tro2th(fle_tro_fnme = None, fle_th_fnme = None,
Author: Xavier Robert, Lima 2016/06/27
Licence: CCby-nc
License: CCby-nc
"""
if thlang in [u'fr', u'FR', u'Fr', u'fR']: thlang = u'fr'
@@ -388,7 +388,7 @@ def convert_tro(fle_tro_fnme, fle_tro_encoding=None, fle_th_fnme = None, cavenam
Author: Xavier Robert, Lima 2016/06/27
Licence: CCby-nc
License: CCby-nc
"""
#from codecs import open
@@ -53,7 +53,7 @@ def read_vtopo_header(lines):
Author: Xavier Robert, Lima 2016/06/27
Licence: CCby-nc
License: CCby-nc
"""
# coord_dict: French Lambert system. To find number of your system, see extern/proj4/nad/epsg
@@ -122,7 +122,7 @@ def read_settings(line):
Author: Xavier Robert, Lima 2016/06/27
Licence: CCby-nc
License: CCby-nc
"""
# Question: Do we have to update the code in function of the vtopo version number?
param = line[6:].rstrip(u'\n\r').split(u' ')
@@ -173,7 +173,7 @@ def read_data(lines, settings, j, iline):
Author: Xavier Robert, Lima 2016/06/27
Licence: CCby-nc
License: CCby-nc
"""
data = []
@@ -216,7 +216,7 @@ def convert_text(lines):
Author: Xavier Robert, Lima 2016/06/27
Licence: CCby-nc
License: CCby-nc
"""
dictcaract ={'\xe8' : u'è',
'\xe0' : u'à',
File diff suppressed because it is too large Load Diff
+39 -32
View File
@@ -27,7 +27,7 @@ encoding utf-8
###############################################################################################
## La ligne source spécifie le fichier ou sont les donnees topo
## jb.th". (Au fichier "jb.th" il faudra avoir une ligne
## "input "nomducavite.th2" pour specifier le fichier ou se trouvent
## "input "nomcavite.th2" pour spécifier le fichier ou se trouvent
## les donnees du dessin, comme ça, ce fichier thconfig appellera
## "jb.th" et a leur tour, "jb.th" appellera
## "jb-dessin.th2")
@@ -44,7 +44,9 @@ input {configPath}config.thc
## Ici, on peut specifier des choses comme les symboles à utiliser (UIS, etc)
## ou imprimer des explications des symboles
###############################################################################################
## Début de la définition du layout "Layout-Plan"
###############################################################################################
layout layout-Plan
## Call the config settings (Layout config inside the config.thc file)
copy fonts_1000
@@ -158,24 +160,24 @@ layout layout-Plan
overlap 2 cm
code tex-map
\legendwidth=15cm
\legendtextsize={\size[12]}
\legendtextheadersize={\size[28]} %%% Taille du titre
\legendtextsectionsize={\size[14]} %%% Taille du titre
%\legendtextcolor={\color[0 0 110]} %# RGB values 0--100
\legendwidth=15cm %%% Largeur cartouche
\legendtextsize={\size[12]} %%% Police principale
\legendtextheadersize={\size[28]} %%% Taille du titre
\legendtextsectionsize={\size[14]} %%% Taille des sous titres
%\legendtextcolor={\color[0 0 110]} %%% RGB values 0--100
% Output map title as determined by Therion is stored in caveName, défini par la une Map.
% It will be empty if there are multiple maps selected for any one projection
% AND there are multiple source surveys identified in the thconfig file
% ie Therion can not infer a unique title from the input data given.
% This code allows you to define an output map title {caveName} if it happens to be empty
\edef\temp{\the\caveName} % caveName from Therion
\edef\nostring{} % empty string
\ifx\temp\nostring % test if caveName is empty
\edef\temp{\the\cavename} %%% cavename from Therion
\edef\nostring{} %%% empty string
\ifx\temp\nostring %%% test if cavename is empty
% if empty
reassign caveName to describe selected maps as a group
\else % if not empty keep the value set by therion, or assign an override caveName here
reassign cavename to describe selected maps as a group
\else %%% if not empty keep the value set by therion, or assign an override cavename here
\fi
\caveName={{caveName}, Plan 1:{Scale}} % Note Alex : Bug avec certains fichiers ?
\cavename={{caveName}, Plan 1:{Scale}} %%% Note Alex : Bug avec certains fichiers ?
\newtoks\club \club={{club}}
%\newtoks\thanksto \thanksto={{thanksto}}
\newtoks\wpage \wpage={{wpage}}
@@ -185,9 +187,10 @@ layout layout-Plan
endcode
endlayout
## fin de la définition du layout
###############################################################################################
##debut de la definition du layout "layout-Extended"
###############################################################################################
layout layout-Extended
## Call the config settings (Layout config inside the config.thc file)
copy drawingconfig
@@ -300,24 +303,24 @@ layout layout-Extended
## Modification du Titre de la topo
code tex-map
\legendwidth=15cm
\legendtextsize={\size[12]}
\legendtextheadersize={\size[28]} %%% Taille du titre
\legendtextsectionsize={\size[14]} %%% Taille du titre
%\legendtextcolor={\color[0 0 110]} %# RGB values 0--100
\legendwidth=15cm %%% Largeur cartouche
\legendtextsize={\size[12]} %%% Police principale
\legendtextheadersize={\size[28]} %%% Taille du titre
\legendtextsectionsize={\size[14]} %%% Taille des sous titres
%\legendtextcolor={\color[0 0 110]} %%% RGB values 0--100
% Output map title as determined by Therion is stored in caveName, défini par la une Map.
% It will be empty if there are multiple maps selected for any one projection
% AND there are multiple source surveys identified in the thconfig file
% ie Therion can not infer a unique title from the input data given.
% This code allows you to define an output map title {caveName} if it happens to be empty
\edef\temp{\the\caveName} % caveName from Therion
\edef\nostring{} % empty string
\ifx\temp\nostring % test if caveName is empty
\edef\temp{\the\cavename} %%% cavename from Therion
\edef\nostring{} %%% empty string
\ifx\temp\nostring %%% test if cavename is empty
% if empty
reassign caveName to describe selected maps as a group
\else % if not empty keep the value set by therion, or assign an override caveName here
reassign cavename to describe selected maps as a group
\else %%% if not empty keep the value set by therion, or assign an override cavename here
\fi
\caveName={{caveName}, Coupe développée 1:{Scale}} % Note Alex : Bug avec certains fichiers ?
\cavename={{caveName}, Coupe développée 1:{Scale}} %%% Note Alex : Bug avec certains fichiers ?
\newtoks\club \club={{club}}
%\newtoks\thanksto \thanksto={{thanksto}}
\newtoks\wpage \wpage={{wpage}}
@@ -327,9 +330,11 @@ layout layout-Extended
endcode
endlayout
## Fin de la definition du Layout
###############################################################################################
## Début de la définition du Layout "layout-kml"
###############################################################################################
layout layout-kml
## Définition du système de projection du plan
cs EPSG:2154
@@ -341,7 +346,9 @@ layout layout-kml
color map-fg [0 0 100]
endlayout
###############################################################################################
## Début de la définition du Layout "xviexport"
###############################################################################################
layout xviexport
# cs UTM32
## echelle à laquelle on veut dessiner la topo
@@ -358,29 +365,29 @@ endlayout
# 3-EXPORT
###############################################################################################
## Export des xvi pour le dessin si besoin
## Export des xvi pour le dessin si besoin
# export map -proj plan -layout xviexport -fmt xvi -o Data/{fileName}-Plan.xvi
# export map -proj extended -layout xviexport -fmt xvi -o Data/{fileName}-Extended.xvi
## Selection des Maps à exporter
## Selection des Maps à exporter
# select MP-{fileName}-Plan-tot@{fileName}
# select MC-{fileName}-Extended-tot@{fileName}
## Export des fichiers pdf, plan et coupe.
## ATTENTION, la topo étant énorme, il faut mettre l'option ne traçant pas la centerline !
## Export des fichiers pdf, plan et coupe.
## ATTENTION, la topo étant énorme, il faut mettre l'option ne traçant pas la centerline !
# export map -projection plan -fmt pdf -layout layout-Plan -o Outputs/{fileName}-Plan.pdf
# export map -projection extended -fmt pdf -layout layout-Extended -o Outputs/{fileName}-Extended.pdf
## Export du fichier 3d pour Loch
## Export du fichier 3d pour Loch
export model -enable all -o Outputs/{fileName}.lox
# export model -enable all -o Outputs/{fileName}.kml
# export model -enable all -o Outputs/{fileName}.plt
## Export des fichiers ESRI
## Export des fichiers ESRI
# export map -proj plan -fmt esri -o Outputs/{fileName}
# export model -fmt esri -o Outputs/SHP/therion -enc UTF-8
## Autres exports
## Autres exports
# export map -proj plan -fmt kml -o Outputs/{fileName}.kml -layout layout-kml
# export model -fmt kml -o Outputs/{fileName}-model.kml -enable all
# export model -enable all -o Outputs/{fileName}-3D.kml
+1 -1
View File
@@ -6,7 +6,7 @@ Author = Alexandre Pont
Copyright1 = # Copyright (C) ARSIP 2025
Copyright2 = # This work is under the Creative Commons Attribution-NonCommercial-NoDerivatives License:
Copyright3 = # <http://creativecommons.org/licenses/by-nc-nd/4.0/>
Copyright_Short = Licence CC by-nc-nd : http://creativecommons.org/licenses/by-nc-nd/4.0/
Copyright_Short = License CC by-nc-nd : http://creativecommons.org/licenses/by-nc-nd/4.0/
map_comment = Massif de la Pierre Saint Martin - Larra
club = ARSIP
thanksto = Merci à tout le monde
+4 -6
View File
@@ -38,7 +38,7 @@ En cours :
"""
Version = "2025.07.04"
Version = "2025.08.27"
#################################################################################################
#################################################################################################
@@ -2900,7 +2900,7 @@ if __name__ == u'__main__':
args.file = select_file_tk_window()
# print(f"Selected file : {args.file}")
output_log = splitext(abspath(args.file))[0]+".log"
output_log = splitext(abspath(args.file))[0] + ".log"
log = setup_logger(output_log, debug_log)
# log.debug("Ceci est un message de debug")
@@ -3107,8 +3107,6 @@ if __name__ == u'__main__':
if os.path.isfile(destination_file):
os.remove(destination_file)
shutil.move(output_log, destination_path)
if not args.update :
shutil.move(output_log, destination_path)