gemgis.visualization.create_lines_3d_polydata#

gemgis.visualization.create_lines_3d_polydata(gdf: geopandas.geodataframe.GeoDataFrame) pyvista.core.pointset.PolyData#

Creating lines with z-component for the plotting with PyVista

Parameters

gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the contour information

Returns

poly – PyVista Polydata Set containing the lines and vertices

Return type

pyvista.core.pointset.PolyData

New in version 1.0.x.

Example

>>> # Loading Libraries and File
>>> import gemgis as gg
>>> import geopandas as gpd
>>> gdf = gpd.read_file(filename='file.shp')
>>> gdf
    id      Z   geometry
0   None    400 LINESTRING (0.741 475.441, 35.629 429.247, 77....
1   None    300 LINESTRING (645.965 0.525, 685.141 61.866, 724...
2   None    400 LINESTRING (490.292 0.525, 505.756 40.732, 519...
3   None    600 LINESTRING (911.433 1068.585, 908.856 1026.831...
4   None    700 LINESTRING (228.432 1068.585, 239.772 1017.037...
>>> # Create mesh from LineStrings
>>> polydata = gg.visualization.create_lines_3d_polydata(gdf=gdf)
>>> polydata
    PolyData    Information
N   Cells       7
N   Points      121
X   Bounds      7.409e-01, 9.717e+02
Y   Bounds      5.250e-01, 1.069e+03
Z   Bounds      3.000e+02, 7.000e+02
N   Arrays      0

See also

create_dem_3d

Creating a mesh from a Digital Elevation Model

create_points_3d

Creating a mesh from points