Skip to content

Commit

Permalink
Merge pull request #252 from cgre-aachen/dev_gemgis2
Browse files Browse the repository at this point in the history
Fix #249
  • Loading branch information
AlexanderJuestel committed Feb 7, 2023
2 parents 391a333 + e4a7ba8 commit ce17235
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = 'Alexander Juestel'

# The full version, including alpha/beta/rc tags
release = '1.0.6'
release = '1.0.7'
version = release

# -- GemGIS configuration ---------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions gemgis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

__version_date__ = '2023-02-07'

__version__ = '1.0.6'
__version__ = '1.0.7'

__changelog__ = """What is new in version 1.0.6:
__changelog__ = """What is new in version 1.0.7:
- Removing pygeo remains
- Fix for #249
"""

Expand Down
22 changes: 2 additions & 20 deletions gemgis/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,11 @@ def create_lines_3d_polydata(gdf: gpd.geodataframe.GeoDataFrame) -> pv.core.poin
raise TypeError('Line Object must be of type GeoDataFrame')

# Checking that all elements of the GeoDataFrame are of geom_type LineString
if all(shapely.get_type_id(gdf.geometry) == 2):
if not all(shapely.get_type_id(gdf.geometry) == 1):
raise TypeError('All Shapely objects of the GeoDataFrame must be LineStrings')

# Checking if Z values are in gdf but only of geometries are flat
if not all(shapely.has_z(gdf.geometry)):
if not {'Z'}.issubset(gdf.columns):
raise ValueError('Z-values not defined')

# If XY coordinates not in gdf, extract X,Y values
if not {'X', 'Y'}.issubset(gdf.columns):
gdf = extract_xy(gdf=gdf,
reset_index=False)

# TODO: Enhance Algorithm of creating lists of points to somehow use gdf[['X', 'Y', 'Z']].values
# Creating empty list to store LineString vertices
vertices_list = []

# Creating list of points
for j in gdf.index.unique():
vertices = np.array([[gdf.loc[j].iloc[i].X, gdf.loc[j].iloc[i].Y, gdf.loc[j].iloc[i].Z]
for i in range(len(gdf.loc[j]))])
# Append arrays to list
vertices_list.append(vertices)
vertices_list = [list(gdf.geometry[i].coords) for i in range(len(gdf))]

# Creating array of points
points = np.vstack(vertices_list)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from os import path

version = '1.0.6'
version = '1.0.7'

# Loading Readme for Description on PyPi
this_directory = path.abspath(path.dirname(__file__))
Expand Down

0 comments on commit ce17235

Please sign in to comment.