mirror of
https://github.com/Alex38Lyon/Synthese-PSM_LARRA.git
synced 2026-09-30 07:21:55 +00:00
Update pyThtoQgis.py
This commit is contained in:
@@ -242,6 +242,7 @@ def extractVertices(input_gpkg_path, output_gpkg_path):
|
||||
- Ajoute un attribut 'angle' correspondant à la direction locale de la ligne (en degrés)
|
||||
- Si le fichier de sortie existe, les points sont ajoutés à la fin
|
||||
"""
|
||||
try :
|
||||
|
||||
log.info(f"Extract vertices from : {Colors.ENDC}{input_gpkg_path}{Colors.INFO} to {Colors.ENDC}{output_gpkg_path}")
|
||||
|
||||
@@ -420,6 +421,10 @@ def extractVertices(input_gpkg_path, output_gpkg_path):
|
||||
|
||||
return
|
||||
|
||||
except RuntimeError as e:
|
||||
log.error(f"extractVertices, unable to validate geometry: {e}, continuing anyway.")
|
||||
globalDat.errorCount += 1
|
||||
|
||||
#################################################################################################
|
||||
def diagnostic(file_path):
|
||||
try:
|
||||
@@ -531,17 +536,18 @@ def diagnostic(file_path):
|
||||
return invalid
|
||||
|
||||
except RuntimeError as e:
|
||||
log.warning(f"Unable to validate geometry: {e}, Continuing anyway.")
|
||||
log.error(f"diagnostic, unable to validate geometry: {e}, continuing anyway.")
|
||||
globalDat.errorCount += 1
|
||||
|
||||
|
||||
#################################################################################################
|
||||
def fix_geometry(geom, GetFID):
|
||||
|
||||
try:
|
||||
if geom is None:
|
||||
return None
|
||||
|
||||
geom = geom.Clone()
|
||||
|
||||
try:
|
||||
geom.CloseRings() # ferme anneaux
|
||||
|
||||
# geom = geom.RemoveDuplicatePoints() # supprime points dupliqués
|
||||
|
||||
Reference in New Issue
Block a user