From 01bce2e0d4bd0e77a5e52a6c695813c5b757a75f Mon Sep 17 00:00:00 2001 From: AlexanderJuestel Date: Wed, 16 Oct 2024 16:04:47 +0200 Subject: [PATCH] EditTSReader --- gemgis/raster.py | 5 ++++- gemgis/visualization.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gemgis/raster.py b/gemgis/raster.py index 5eeb7e94..8a5b5f17 100644 --- a/gemgis/raster.py +++ b/gemgis/raster.py @@ -1915,7 +1915,10 @@ def read_ts(path: Union[str, Path]) -> Tuple[list, list]: if line_type == "PROPERTIES": columns += values - elif line_type == "TFACE": + # Deleting duplicate column names + columns = list(dict.fromkeys(columns)) + + elif line_type == "TFACE" or line_type == "END": # Creating array for faces faces = np.array(faces, dtype=np.int32) diff --git a/gemgis/visualization.py b/gemgis/visualization.py index b1aff416..badd13bf 100644 --- a/gemgis/visualization.py +++ b/gemgis/visualization.py @@ -1193,7 +1193,7 @@ def create_polydata_from_ts( for i in range(len(data[0])): # Creating faces for PyVista PolyData faces = np.hstack( - np.pad(data[1][i], ((0, 0), (1, 0)), "constant", constant_values=3) + np.pad(data[1][i]-1, ((0, 0), (1, 0)), "constant", constant_values=3) ) # Creating vertices for PyVista Polydata