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)
|
- 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
|
- 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}")
|
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
|
return
|
||||||
|
|
||||||
|
except RuntimeError as e:
|
||||||
|
log.error(f"extractVertices, unable to validate geometry: {e}, continuing anyway.")
|
||||||
|
globalDat.errorCount += 1
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
def diagnostic(file_path):
|
def diagnostic(file_path):
|
||||||
try:
|
try:
|
||||||
@@ -531,17 +536,18 @@ def diagnostic(file_path):
|
|||||||
return invalid
|
return invalid
|
||||||
|
|
||||||
except RuntimeError as e:
|
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):
|
def fix_geometry(geom, GetFID):
|
||||||
|
try:
|
||||||
if geom is None:
|
if geom is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
geom = geom.Clone()
|
geom = geom.Clone()
|
||||||
|
|
||||||
try:
|
|
||||||
geom.CloseRings() # ferme anneaux
|
geom.CloseRings() # ferme anneaux
|
||||||
|
|
||||||
# geom = geom.RemoveDuplicatePoints() # supprime points dupliqués
|
# geom = geom.RemoveDuplicatePoints() # supprime points dupliqués
|
||||||
|
|||||||
Reference in New Issue
Block a user