mirror of
https://github.com/Alex38Lyon/Synthese-PSM_LARRA.git
synced 2026-06-01 13:59:13 +00:00
pyCreateTh
This commit is contained in:
@@ -63,3 +63,29 @@
|
||||
2025-06-16 21:47:56,152 - INFO - ********************************************************************************************************************************************
|
||||
2025-06-16 21:47:56,153 - ERROR - !!! file not yet supported
|
||||
2025-06-16 21:47:56,154 - ERROR - !!! There were 1 errors during 3.19 secondes, check the log file ~\..\pyCreateTh.log
|
||||
2025-06-17 18:45:15,108 - INFO - ********************************************************************************************************************************************
|
||||
2025-06-17 18:45:15,108 - INFO - * Conversion Th, Dat, Mak files to Therion files and folders
|
||||
2025-06-17 18:45:15,109 - INFO - * Script pyCreateTh by : alexandre.pont@yahoo.fr
|
||||
2025-06-17 18:45:15,109 - INFO - * Version : 2025.06.17
|
||||
2025-06-17 18:45:15,109 - INFO - * Input file :
|
||||
2025-06-17 18:45:15,109 - INFO - * Output file : ~\.
|
||||
2025-06-17 18:45:15,110 - INFO - * Log file : ~\..\pyCreateTh.log
|
||||
2025-06-17 18:45:15,110 - INFO - *
|
||||
2025-06-17 18:45:15,110 - INFO - *
|
||||
2025-06-17 18:45:15,110 - INFO - *
|
||||
2025-06-17 18:45:15,111 - INFO - ********************************************************************************************************************************************
|
||||
2025-06-17 18:45:15,112 - ERROR - !!! file not yet supported
|
||||
2025-06-17 18:45:15,112 - ERROR - !!! There were 1 errors during 3.06 secondes, check the log file ~\..\pyCreateTh.log
|
||||
2025-06-18 21:39:26,689 - INFO - ********************************************************************************************************************************************
|
||||
2025-06-18 21:39:26,689 - INFO - * Conversion Th, Dat, Mak files to Therion files and folders
|
||||
2025-06-18 21:39:26,690 - INFO - * Script pyCreateTh by : alexandre.pont@yahoo.fr
|
||||
2025-06-18 21:39:26,690 - INFO - * Version : 2025.06.18
|
||||
2025-06-18 21:39:26,690 - INFO - * Input file :
|
||||
2025-06-18 21:39:26,690 - INFO - * Output file : ~\.
|
||||
2025-06-18 21:39:26,690 - INFO - * Log file : ~\..\pyCreateTh.log
|
||||
2025-06-18 21:39:26,690 - INFO - *
|
||||
2025-06-18 21:39:26,691 - INFO - *
|
||||
2025-06-18 21:39:26,691 - INFO - *
|
||||
2025-06-18 21:39:26,691 - INFO - ********************************************************************************************************************************************
|
||||
2025-06-18 21:39:26,692 - ERROR - !!! file not yet supported
|
||||
2025-06-18 21:39:26,692 - ERROR - !!! There were 1 errors during 32.63 secondes, check the log file ~\..\pyCreateTh.log
|
||||
|
||||
+3
@@ -2,6 +2,7 @@
|
||||
"cSpell.words": [
|
||||
"annee",
|
||||
"ansi",
|
||||
"ARSIP",
|
||||
"australiangeodetic",
|
||||
"australiangeodeticdatum",
|
||||
"backclino",
|
||||
@@ -14,6 +15,7 @@
|
||||
"cumcount",
|
||||
"datat",
|
||||
"depmatch",
|
||||
"depthchange",
|
||||
"depthre",
|
||||
"downcasting",
|
||||
"drawnexemptextendedre",
|
||||
@@ -36,6 +38,7 @@
|
||||
"Geophysicaya",
|
||||
"isin",
|
||||
"Koef",
|
||||
"Larra",
|
||||
"lengthre",
|
||||
"lenmatch",
|
||||
"levelname",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,25 +1,142 @@
|
||||
## Global data for pyCreateTh.py
|
||||
"""
|
||||
#############################################################################################
|
||||
global_data.py for pyCreateTh.py
|
||||
#############################################################################################
|
||||
"""
|
||||
|
||||
|
||||
# # [Survey_Data] default values
|
||||
# Author = "Created by pyCreateTh.py"
|
||||
# Copyright = "# Copyright (C) pyCreateTh.py"
|
||||
# Copyright_Short = "Licence (C) pyCreateTh.py"
|
||||
# map_comment = "Created by pyCreateTh.py"
|
||||
# cs = "UTM30"
|
||||
# club = "Therion"
|
||||
# thanksto = "Therion"
|
||||
# datat = "https://therion.speleo.sk/"
|
||||
# wpage = "https://therion.speleo.sk/"
|
||||
#################################################################################################
|
||||
|
||||
# ## [Application_data] default values
|
||||
# template_path = "./Template"
|
||||
# station_by_scrap = 20
|
||||
# final_therion_exe = True
|
||||
# therion_path = "C:/Therion/therion.exe"
|
||||
# LINES = -1
|
||||
# NAMES = -1
|
||||
|
||||
# configIni = "config.ini" # Default config file name
|
||||
# debug_log = False # Mode debug des messages
|
||||
error_count = 0 # Compteur d'erreurs
|
||||
error_count = 0 # Compteur d'erreurs
|
||||
|
||||
#################################################################################################
|
||||
thFileDat = """
|
||||
encoding utf-8
|
||||
# File generated by pyCreateTh.py version {VERSION} date: {DATE}
|
||||
|
||||
survey {SURVEY_NAME} -title "{COMMENT}"
|
||||
\tcenterline
|
||||
\t\tdate {SURVEY_DATE}
|
||||
\t\t# team "{SURVEY_TEAM}"
|
||||
{FIX_POINTS}
|
||||
|
||||
\t\t# explo-date "{EXPLO_DATE}"
|
||||
\t\t# explo-team "{EXPLO_TEAM}"
|
||||
|
||||
\t\tunits {LENGTH}
|
||||
\t\tunits {COMPASS}
|
||||
\t\tunits {CLINO}
|
||||
\t\t{DATA_FORMAT}
|
||||
|
||||
\t#{DATA}
|
||||
|
||||
\tendcenterline
|
||||
endsurvey
|
||||
|
||||
{SOURCE}
|
||||
"""
|
||||
|
||||
#################################################################################################
|
||||
thconfigTemplate = """
|
||||
source "{th_file}"
|
||||
layout minimal
|
||||
scale 1 {scale}
|
||||
endlayout
|
||||
|
||||
select {selector}
|
||||
|
||||
#export model -o "{th_name}.lox"
|
||||
export map -projection plan -o "{th_name}-Plan.xvi" -layout minimal -layout-debug station-names
|
||||
export map -projection extended -o "{th_name}-Extended.xvi" -layout minimal -layout-debug station-names
|
||||
"""
|
||||
|
||||
#################################################################################################
|
||||
th2FileHeader = """encoding utf-8"""
|
||||
|
||||
th2File = """
|
||||
##XTHERION## xth_me_area_adjust {X_Min} {Y_Min} {X_Max} {Y_Max}
|
||||
##XTHERION## xth_me_area_zoom_to 100
|
||||
##XTHERION## xth_me_image_insert {insert_XVI}
|
||||
|
||||
{Copyright}
|
||||
# File generated by pyCreateTh.py version {version} date: {date}
|
||||
|
||||
# x_min: {X_Min}, x_max: {X_Max} ecart : {X_Max_X_Min}
|
||||
# y_min: {Y_Min}, y_max: {Y_Max} ecart : {Y_Max_Y_Min}
|
||||
|
||||
scrap S{projection_short}-{name}_01 -station-names "" "@{name}" -projection {projection} -author {year} "{author}" -copyright {year} "{Copyright_Short}"
|
||||
|
||||
{points}
|
||||
|
||||
{names}
|
||||
|
||||
{lines}
|
||||
|
||||
endscrap
|
||||
"""
|
||||
|
||||
th2Point = """ point {x} {y} station -name {station}"""
|
||||
th2Name = """ point {x} {y} station-name -align tr -scale xs -text {station}"""
|
||||
|
||||
th2Line = """
|
||||
line u:Shot_Survey
|
||||
{x1} {y1}
|
||||
{x2} {y2}
|
||||
endline
|
||||
"""
|
||||
|
||||
th2Scrap = """
|
||||
|
||||
scrap S{projection_short}-{name}_{num:02} -station-names "" "@{name}" -projection {projection} -author {year} "{author}" -copyright {year} "{Copyright_Short}"
|
||||
|
||||
endscrap
|
||||
"""
|
||||
|
||||
#################################################################################################
|
||||
datumToEPSG = {
|
||||
# Datums globaux
|
||||
"wgs84": "326", # UTM Nord (WGS84) - EPSG:326XX
|
||||
"etrs89": "258", # UTM Nord (ETRS89) - Europe
|
||||
|
||||
# Datums européens
|
||||
"european1950": "230", # ED50 / UTM Nord - Europe
|
||||
"ed50": "230",
|
||||
|
||||
# Datums nord-américains
|
||||
"nad27": "267", # UTM Nord (NAD27) - Amérique du Nord
|
||||
"northamericandatum1927": "267",
|
||||
"northamerican1927": "267",
|
||||
"nad83": "269", # UTM Nord (NAD83) - Amérique du Nord
|
||||
"northamericandatum1983": "269",
|
||||
"northamerican1983" : "269",
|
||||
|
||||
# Datums français
|
||||
"ntf": "275", # UTM Nord (NTF) - France (Paris)
|
||||
"nouvelletriangulationfrançaise": "275",
|
||||
|
||||
# Datums africains
|
||||
"clarke1880": "297", # UTM Nord (Clarke 1880) - Afrique
|
||||
|
||||
# Datums australiens
|
||||
"agd66": "202", # UTM Nord (AGD66) - Australie
|
||||
"australiangeodeticdatum1966": "202",
|
||||
"australiangeodetic1966": "202",
|
||||
"agd84": "203", # UTM Nord (AGD84) - Australie
|
||||
"australiangeodeticdatum1984": "203",
|
||||
"australiangeodetic1984": "203",
|
||||
"gda94": "283", # UTM Nord (GDA94) - Australie
|
||||
"geocentricdatumofaustralia1994": "283",
|
||||
"geocentricofaustralia1994": "283",
|
||||
|
||||
# Datums asiatiques
|
||||
"pulkovo1942": "284", # UTM Nord (Pulkovo 1942) - Russie/CEI
|
||||
"beijing1954": "214", # UTM Nord (Beijing 1954) - Chine
|
||||
|
||||
# Datums sud-américains
|
||||
"sad69": "291", # UTM Nord (SAD69) - Amérique du Sud
|
||||
"southamericandatum1969": "291",
|
||||
"southamerican1969": "291",
|
||||
"sirgas2000": "319", # UTM Nord (SIRGAS 2000) - Amérique Latine
|
||||
}
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
"""
|
||||
#############################################################################################
|
||||
logger_config.py for pyCreateTh.py
|
||||
#############################################################################################
|
||||
"""
|
||||
import logging
|
||||
import sys
|
||||
import re
|
||||
|
||||
#################################################################################################
|
||||
# Couleurs ANSI par niveau de log
|
||||
#################################################################################################
|
||||
COLOR_CODES = {
|
||||
logging.DEBUG: "\033[94m", # Bleu
|
||||
logging.INFO: "\033[92m", # Vert
|
||||
@@ -12,19 +19,25 @@ COLOR_CODES = {
|
||||
}
|
||||
RESET = "\033[0m"
|
||||
|
||||
#################################################################################################
|
||||
# Supprime les codes ANSI (pour l'écriture dans les fichiers)
|
||||
#################################################################################################
|
||||
def strip_ansi_codes(text):
|
||||
ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
|
||||
return ansi_escape.sub('', text)
|
||||
|
||||
#################################################################################################
|
||||
# Formatter pour la console avec couleurs
|
||||
#################################################################################################
|
||||
class ConsoleFormatter(logging.Formatter):
|
||||
def format(self, record):
|
||||
color = COLOR_CODES.get(record.levelno, "")
|
||||
message = super().format(record)
|
||||
return f"{color}{message}{RESET}"
|
||||
|
||||
#################################################################################################
|
||||
# Formatter pour le fichier avec "!!!" sur les erreurs
|
||||
#################################################################################################
|
||||
class FileFormatter(logging.Formatter):
|
||||
def format(self, record):
|
||||
clean_msg = strip_ansi_codes(record.getMessage())
|
||||
@@ -41,8 +54,11 @@ class FileFormatter(logging.Formatter):
|
||||
sinfo=record.stack_info
|
||||
)
|
||||
return super().format(record_copy)
|
||||
|
||||
|
||||
|
||||
#################################################################################################
|
||||
# Fonction de configuration du logger
|
||||
#################################################################################################
|
||||
def setup_logger(logfile="app.log", debug_log=False):
|
||||
logger = logging.getLogger("Logger")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
"""
|
||||
#############################################################################################
|
||||
therion.py for pyCreateTh.py
|
||||
#############################################################################################
|
||||
"""
|
||||
|
||||
import tempfile
|
||||
import shutil
|
||||
import os
|
||||
@@ -48,7 +54,7 @@ def safe_relpath(path):
|
||||
return valeur
|
||||
|
||||
except ValueError:
|
||||
max_depth = 6 # Profondeur maximale pour tronquer le chemin
|
||||
max_depth = 4 # Profondeur maximale pour tronquer le chemin
|
||||
|
||||
# Disques différents, afficher le chemin relatif partiel depuis la racine commune
|
||||
path_parts = abs_path.split(os.sep)
|
||||
@@ -103,7 +109,6 @@ def compile_templateOld(template, template_args, **kwargs):
|
||||
# Compiler une configuration générée dynamiquement à partir d'un template texte. #
|
||||
#################################################################################################
|
||||
def compile_template(template, template_args, **kwargs):
|
||||
|
||||
logfile = ""
|
||||
tmpdir = None
|
||||
try:
|
||||
@@ -117,7 +122,6 @@ def compile_template(template, template_args, **kwargs):
|
||||
|
||||
therion_path = kwargs.get("therion_path", "therion")
|
||||
|
||||
# Écriture des fichiers config + log
|
||||
with open(config_file, "w", encoding="utf-8") as tmp:
|
||||
tmp.write(config)
|
||||
tmp.flush()
|
||||
@@ -125,14 +129,15 @@ def compile_template(template, template_args, **kwargs):
|
||||
# Exécution de Therion
|
||||
result = subprocess.run(
|
||||
[therion_path, config_file, "-l", log_file],
|
||||
stdin=subprocess.DEVNULL, # Évite toute attente d'entrée clavier
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True, # Décode automatiquement en UTF-8 (avec fallback ci-dessous)
|
||||
text=True,
|
||||
timeout=kwargs.get("timeout", 30),
|
||||
errors="replace" # Remplace caractères invalides (évite UnicodeDecodeError)
|
||||
errors="replace"
|
||||
)
|
||||
|
||||
# Lecture du log (en mode tolérant)
|
||||
# Lecture du fichier log
|
||||
try:
|
||||
with open(log_file, "r", encoding="cp1252", errors="replace") as f:
|
||||
logfile = f.read()
|
||||
@@ -140,23 +145,24 @@ def compile_template(template, template_args, **kwargs):
|
||||
log.warning(f"Could not read Therion log: {Colors.ENDC}{log_err}")
|
||||
|
||||
# Analyse du code retour
|
||||
if result.returncode != 0:
|
||||
log.error(f"Therion compilation failed with return code: {Colors.ENDC}{result.returncode} {Colors.ERROR}{result.stdout}")
|
||||
if result.returncode != 0 or "press any key" in result.stdout.lower():
|
||||
log.error(f"Therion compilation failed with return code: {Colors.ENDC}{result.returncode}\n{Colors.WHITE}{result.stdout}")
|
||||
global_data.error_count += 1
|
||||
|
||||
else:
|
||||
log.info(f"Therion compilation successful")
|
||||
return "Therion error", tmpdir
|
||||
|
||||
stat = get_stats_from_log(logfile)
|
||||
|
||||
log.info(f"Therion compilation successful, length: {Colors.ENDC}{stat["length"]}m{Colors.INFO}, depth: {Colors.ENDC}{stat["depth"]}m")
|
||||
return logfile, tmpdir
|
||||
|
||||
except subprocess.TimeoutExpired:
|
||||
log.error(f"Therion process timed out and was terminated {Colors.ENDC}{logfile}")
|
||||
log.error(f"Therion process timed out and was terminated : {Colors.ENDC}{logfile}")
|
||||
global_data.error_count += 1
|
||||
return "Therion error", tmpdir
|
||||
|
||||
except Exception as e:
|
||||
log.error(f"Therion template compilation error: {Colors.ENDC}{e}")
|
||||
global_data.error_count += 1
|
||||
global_data.error_count += 1
|
||||
return "Therion error", tmpdir
|
||||
|
||||
finally:
|
||||
@@ -166,54 +172,7 @@ def compile_template(template, template_args, **kwargs):
|
||||
except Exception as cleanup_err:
|
||||
log.warning(f"Could not delete temp directory: {Colors.ENDC}{cleanup_err}")
|
||||
|
||||
|
||||
#################################################################################################
|
||||
# Compilation Therion (version avec blocage) #
|
||||
# Compiler directement un fichier .th déjà existant avec Therion.
|
||||
#################################################################################################
|
||||
def compile_fileOld(filename, **kwargs):
|
||||
|
||||
try:
|
||||
tmpdir = os.path.dirname(filename)
|
||||
log_file = join(tmpdir, "therion.log").replace("\\", "/")
|
||||
therion_path = kwargs["therion_path"] if "therion_path" in kwargs else "therion"
|
||||
|
||||
process = subprocess.Popen(
|
||||
[therion_path, filename, "-l", log_file],
|
||||
cwd=tmpdir,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT, # fusion stdout + stderr
|
||||
universal_newlines=True, # décodage automatique en texte
|
||||
bufsize=1 # ligne par ligne
|
||||
)
|
||||
|
||||
log.info(f"Start therion compilation file : {Colors.ENDC}{safe_relpath(filename)}")
|
||||
# Lecture en temps réel
|
||||
for line in process.stdout:
|
||||
line = line.rstrip()
|
||||
lower_line = line.lower()
|
||||
if "error" in lower_line:
|
||||
log.error(f" [Therion_Compile] {Colors.ENDC}{line}")
|
||||
elif "warning" in lower_line:
|
||||
log.warning(f" [Therion_Compile] {Colors.ENDC}{line}")
|
||||
else:
|
||||
log.debug(f" [Therion_Compile] {Colors.ENDC}{line}")
|
||||
|
||||
process.wait()
|
||||
|
||||
# Si la commande échoue, result.returncode sera non nul
|
||||
if process.returncode != 0:
|
||||
# Affichage des erreurs et de la sortie standard
|
||||
log.error(f"Error during Therion compilation, stderr : \n{Colors.ENDC}{process.stderr.decode()}")
|
||||
global_data.error_count += 1
|
||||
|
||||
log.info(f"Therion file : {Colors.ENDC}{safe_relpath(filename)}{Colors.GREEN} succeeded")
|
||||
|
||||
except Exception as e:
|
||||
log.error(f"Therion file {Colors.ENDC}{safe_relpath(filename, os.path.expanduser('~'))}{Colors.ERROR} compilation error: {Colors.ENDC}{e}")
|
||||
global_data.error_count += 1
|
||||
|
||||
|
||||
|
||||
#################################################################################################
|
||||
# Compilation Therion (version sans blocage) #
|
||||
#################################################################################################
|
||||
@@ -243,12 +202,14 @@ def compile_file(filename, **kwargs):
|
||||
for line in proc.stdout:
|
||||
line = line.rstrip()
|
||||
lower_line = line.lower()
|
||||
if "error" in lower_line:
|
||||
log.error(f"[Therion_Compile] {Colors.ENDC}{line}")
|
||||
if "average loop error" in lower_line:
|
||||
log.warning(f"[Therion_Compile] {Colors.ENDC}{line}")
|
||||
elif "error" in lower_line:
|
||||
log.error(f"[Therion_Compile] {Colors.ENDC}{line}")
|
||||
elif "warning" in lower_line:
|
||||
log.warning(f" [Therion_Compile] {Colors.ENDC}{line}")
|
||||
log.warning(f"[Therion_Compile] {Colors.ENDC}{line}")
|
||||
else:
|
||||
log.debug(f" [Therion_Compile] {Colors.ENDC}{line}")
|
||||
log.debug(f"[Therion_Compile] {Colors.ENDC}{line}")
|
||||
except Exception as e:
|
||||
log.warning(f"Reading Therion output: {Colors.ENDC}{e}")
|
||||
|
||||
@@ -283,7 +244,7 @@ def compile_file(filename, **kwargs):
|
||||
def compile_file_th(filepath, **kwargs):
|
||||
template = """source {filepath}
|
||||
layout test
|
||||
scale 1 500
|
||||
scale 1 100
|
||||
endlayout
|
||||
"""
|
||||
template_args = {"filepath": filepath}
|
||||
@@ -295,8 +256,6 @@ def compile_file_th(filepath, **kwargs):
|
||||
lengthre = re.compile(r".*Longueur totale de la topographie = \s*(\S+)m")
|
||||
depthre = re.compile(r".*Longueur totale verticale =\s*(\S+)m")
|
||||
|
||||
|
||||
#################################################################################################
|
||||
def get_stats_from_log(log):
|
||||
lenmatch = lengthre.findall(log)
|
||||
depmatch = depthre.findall(log)
|
||||
@@ -309,7 +268,6 @@ def get_stats_from_log(log):
|
||||
syscoord = re.compile(r".*output coordinate system: \s*(\S+)")
|
||||
|
||||
|
||||
#################################################################################################
|
||||
def get_syscoord_from_log(log):
|
||||
lenmatch = syscoord.findall(log)
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
encoding utf-8
|
||||
######################################################################################################################################
|
||||
# Version pyCreate_th2.py By Alex 2025 01 02
|
||||
# Version pyCreateTh.py By Alex MàJ 2025 01 02
|
||||
######################################################################################################################################
|
||||
|
||||
|
||||
|
||||
######################################################################################################################################
|
||||
# Licence
|
||||
######################################################################################################################################
|
||||
|
||||
@@ -3,11 +3,11 @@ encoding utf-8
|
||||
|
||||
{Copyright}
|
||||
|
||||
map MP-{fileName}-Plan-tot -title "{fileName}"
|
||||
map MP-{fileName}-Plan-tot -title "{caveName}"
|
||||
{other_scraps_plan}
|
||||
endmap
|
||||
|
||||
map MC-{fileName}-Extended-tot -title "{fileName}"
|
||||
map MC-{fileName}-Extended-tot -title "{caveName}"
|
||||
{other_scraps_extended}
|
||||
endmap
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
encoding utf-8
|
||||
{file_info}
|
||||
|
||||
{Copyright}
|
||||
|
||||
to add this survey in a main survey add in your -tot.th file:
|
||||
|
||||
input Data/{fileName}/{fileName}-tot.th
|
||||
equate
|
||||
# Fix point list
|
||||
{fixPointList}
|
||||
|
||||
# Survey list :
|
||||
{readMeList}
|
||||
|
||||
|
||||
# Error list :
|
||||
{errorList}
|
||||
@@ -3,6 +3,6 @@ encoding utf-8
|
||||
|
||||
{Copyright}
|
||||
|
||||
survey {fileName} -title "{fileName}"
|
||||
survey {fileName} -title "{caveName}"
|
||||
{totData}
|
||||
endsurvey
|
||||
|
||||
@@ -44,19 +44,6 @@ 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 "xviexport"
|
||||
layout xviexport
|
||||
#cs UTM32
|
||||
## echelle à laquelle on veut dessiner la topo
|
||||
scale 1 {Scale}
|
||||
#scale 1 1000
|
||||
## taille de la grille
|
||||
grid-size 2 2 2 m
|
||||
## mettre la grille en arrière plan
|
||||
grid bottom
|
||||
endlayout
|
||||
## fin de la définition du layout "xviexport"
|
||||
|
||||
## Début de la définition du layout "Layout-Plan"
|
||||
layout layout-Plan
|
||||
## Call the config settings (Layout config inside the config.thc file)
|
||||
@@ -103,7 +90,7 @@ layout layout-Plan
|
||||
|
||||
## Couleurs de la topographie
|
||||
#colour map-bg [70 90 70]
|
||||
#colour map-fg [100 100 80]
|
||||
#colour map-fg [100 100 80]
|
||||
#colour map-fg altitude
|
||||
#colour map-fg explo-date
|
||||
#colour map-fg topo-date
|
||||
@@ -120,9 +107,9 @@ layout layout-Plan
|
||||
## Auteur
|
||||
doc-author "{Author}"
|
||||
## Titre
|
||||
doc-title "{cavename} Plan - 1:{Scale}"
|
||||
doc-subject "{cavename}, topographie en plan"
|
||||
doc-keywords "Cave, Survey, {cavename}, Pierre saint Martin - Larra, {map_comment}"
|
||||
doc-title "{caveName} Plan - 1:{Scale}"
|
||||
doc-subject "{caveName}, topographie en plan"
|
||||
doc-keywords "Cave, Survey, {caveName}, {mapComment}"
|
||||
|
||||
## Maintenant on spécifie la position de la manchette, dont l'intérieur est occupé par le titre, auteurs, etc.
|
||||
## Nous pouvons indiquer les cordonnées du point de la topo ou l'on veut la manchette :
|
||||
@@ -144,8 +131,8 @@ layout layout-Plan
|
||||
legend-columns 2
|
||||
## Un commentaire à ajouter au titre, on pourrait indiquer ici la mairie où est placée la cavité
|
||||
## dont le nom est probablement le titre de la topo.
|
||||
map-comment "{map_comment}"
|
||||
#map-comment "{map_comment}<br>Coordonnées : ({cs}/WGS84) xxx.xxx xxxx.xxx, Alt.: xxxx m"
|
||||
map-comment "{mapComment}"
|
||||
#map-comment "{mapComment}<br>Coordonnées : ({cs}/WGS84) xxx.xxx xxxx.xxx, Alt.: xxxx m"
|
||||
|
||||
## Afficher les statistiques d'explo/topo par équipe/nom. C'est lourd
|
||||
## si la cavité est importante et qu'il y a beaucoup d'explorateurs/topographes.
|
||||
@@ -159,7 +146,7 @@ layout layout-Plan
|
||||
# symbol-hide point station
|
||||
# symbol-hide line survey
|
||||
# symbol-hide group
|
||||
# symbol-show line wall
|
||||
# symbol-show line wall
|
||||
# symbol-hide point station-name
|
||||
# symbol-hide point u:symbol_plan
|
||||
# symbol-hide point u:symbol_extend
|
||||
@@ -176,19 +163,19 @@ layout layout-Plan
|
||||
\legendtextheadersize={\size[28]} %%% Taille du titre
|
||||
\legendtextsectionsize={\size[14]} %%% Taille du titre
|
||||
%\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.
|
||||
% 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
|
||||
% 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
|
||||
\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}}
|
||||
@@ -198,6 +185,7 @@ layout layout-Plan
|
||||
endcode
|
||||
|
||||
endlayout
|
||||
## fin de la définition du layout
|
||||
|
||||
##debut de la definition du layout "layout-Extended"
|
||||
layout layout-Extended
|
||||
@@ -244,7 +232,7 @@ layout layout-Extended
|
||||
|
||||
## Couleurs de la topographie
|
||||
#colour map-bg [70 90 70]
|
||||
#colour map-fg [100 100 80]
|
||||
#colour map-fg [100 100 80]
|
||||
#colour map-fg altitude
|
||||
#colour map-fg explo-date
|
||||
#colour map-fg topo-date
|
||||
@@ -261,10 +249,10 @@ layout layout-Extended
|
||||
## Auteur
|
||||
doc-author "{Author}"
|
||||
## Titre
|
||||
doc-title "{cavename} Coupe développée - 1:{Scale}"
|
||||
doc-title "{caveName} Coupe développée - 1:{Scale}"
|
||||
|
||||
doc-subject "{cavename}, topographie en coupe développée"
|
||||
doc-keywords "Cave, Survey, {cavename}, Pierre saint Martin - Larra, Coupe développée, {map_comment}"
|
||||
doc-subject "{caveName}, topographie en coupe développée"
|
||||
doc-keywords "Cave, Survey, {caveName}, {mapComment}"
|
||||
|
||||
## Maintenant on spécifie la position de la manchette, dont l'intérieur est occupé par le titre, auteurs, etc.
|
||||
## Nous pouvons indiquer les cordonnées du point de la topo ou l'on veut la manchette :
|
||||
@@ -285,8 +273,8 @@ layout layout-Extended
|
||||
legend-columns 2
|
||||
## Un commentaire à ajouter au titre, on pourrait indiquer ici la mairie où est placée la cavité
|
||||
## dont le nom est probablement le titre de la topo.
|
||||
map-comment "{map_comment}"
|
||||
#map-comment "{map_comment}<br>Coordonnées : ({cs}/WGS84) xxx.xxx xxxx.xxx, Alt.: xxxx m"
|
||||
map-comment "{mapComment}"
|
||||
#map-comment "{mapComment}<br>Coordonnées : ({cs}/WGS84) xxx.xxx xxxx.xxx, Alt.: xxxx m"
|
||||
|
||||
## Afficher les statistiques d'explo/topo par équipe/nom. C'est lourd
|
||||
## si la cavité est importante et qu'il y a beaucoup d'explorateurs/topographes.
|
||||
@@ -300,7 +288,7 @@ layout layout-Extended
|
||||
# symbol-hide point station
|
||||
# symbol-hide line survey
|
||||
# symbol-hide group
|
||||
# symbol-show line wall
|
||||
# symbol-show line wall
|
||||
# symbol-hide point u:symbol_plan
|
||||
# symbol-hide point u:symbol_extend
|
||||
# debug scrap-names
|
||||
@@ -317,19 +305,19 @@ layout layout-Extended
|
||||
\legendtextheadersize={\size[28]} %%% Taille du titre
|
||||
\legendtextsectionsize={\size[14]} %%% Taille du titre
|
||||
%\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.
|
||||
% 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
|
||||
% 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
|
||||
\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}}
|
||||
@@ -339,8 +327,9 @@ layout layout-Extended
|
||||
endcode
|
||||
|
||||
endlayout
|
||||
## Fin de la definition du Layout "normal"
|
||||
## 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
|
||||
@@ -352,39 +341,56 @@ 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
|
||||
scale 1 {Scale}
|
||||
# scale 1 1000
|
||||
## taille de la grille
|
||||
grid-size 2 2 2 m
|
||||
## mettre la grille en arrière plan
|
||||
grid bottom
|
||||
endlayout
|
||||
## fin de la définition du layout
|
||||
|
||||
###############################################################################################
|
||||
# 3-EXPORT
|
||||
###############################################################################################
|
||||
|
||||
## 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
|
||||
## 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
|
||||
# select MP-{fileName}-Plan-tot@{fileName}
|
||||
# select MC-{fileName}-Extended-tot@{fileName}
|
||||
## 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 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 model -enable all -o Outputs/{fileName}.lox
|
||||
# export model -enable all -o Outputs/{fileName}.kml
|
||||
# export model -enable all -o Outputs/{fileName}.plt
|
||||
|
||||
## Export du fichier 3d pour Loch
|
||||
export model -enable all -o Outputs/{fileName}.lox
|
||||
export model -enable all -o Outputs/{fileName}.kml
|
||||
## Export des fichiers ESRI
|
||||
# export map -proj plan -fmt esri -o Outputs/{fileName}
|
||||
# export model -fmt esri -o Outputs/SHP/therion -enc UTF-8
|
||||
|
||||
## Export des fichiers ESRI
|
||||
# export map -proj plan -fmt esri -o Outputs/{fileName}
|
||||
## 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
|
||||
# export cave-list -location on -o Outputs/{fileName}-Cave-list.html
|
||||
# export survey-list -location on -o Outputs/{fileName}-Surveys.html
|
||||
# export database -fmt sql -o Outputs/{fileName}-database.sql
|
||||
# export continuation-list -o Outputs/{fileName}-Continuations.html
|
||||
|
||||
## Export des fichiers kml
|
||||
# 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
|
||||
# export cave-list -location on -o Outputs/{fileName}-Cave-list.html
|
||||
# export survey-list -location on -o Outputs/{fileName}-Surveys.html
|
||||
|
||||
|
||||
###############################################################################################
|
||||
## END
|
||||
## END FILE
|
||||
###############################################################################################
|
||||
@@ -1,4 +1,4 @@
|
||||
# Configuration values for pyCreate_th2.ph
|
||||
# Configuration values for pyCreateTh.ph
|
||||
[Survey_Data]
|
||||
Author = Alexandre Pont
|
||||
Copyright1 = # Copyright (C) ARSIP 2025
|
||||
@@ -7,7 +7,7 @@ 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/
|
||||
map_comment = Massif de la Pierre Saint Martin - Larra
|
||||
club = ARSIP
|
||||
thanksto = Merçi à tout le monde
|
||||
thanksto = Merci à tout le monde
|
||||
datat = https://github.com/Alex38Lyon/Synthese-PSM_LARRA
|
||||
wpage = https://www.arsip.fr/
|
||||
cs = UTM30
|
||||
@@ -18,5 +18,5 @@ template_path = ./template
|
||||
station_by_scrap = 30
|
||||
final_therion_exe = True
|
||||
therion_path = C:\Program Files\Therion\therion.exe
|
||||
shot_lines_in_th2_files = True
|
||||
shot_lines_in_th2_files = False
|
||||
station_name_in_th2_files = True
|
||||
|
||||
+831
-873
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
||||
numpy
|
||||
ttkthemes
|
||||
matplotlib
|
||||
pandas
|
||||
Shapely
|
||||
Fiona
|
||||
pyproj
|
||||
scipy
|
||||
netCDF4
|
||||
xarray
|
||||
joblib
|
||||
geopandas
|
||||
motionless
|
||||
salem
|
||||
configparser
|
||||
Reference in New Issue
Block a user