@@ -3354,35 +3354,46 @@ def create_linestring_from_xyz_points(
3354
3354
zcol : str = "Z" ,
3355
3355
drop_nan : bool = True ,
3356
3356
) -> shapely .geometry .linestring .LineString :
3357
- """
3358
- Create LineString from an array or GeoDataFrame containing X, Y, and Z coordinates of points.
3357
+ """Create LineString from an array or GeoDataFrame containing X, Y, and Z coordinates of points.
3359
3358
3360
3359
Parameters
3361
3360
__________
3362
3361
points : Union[np.ndarray, gpd.geodataframe.GeoDataFrame]
3363
3362
NumPy Array or GeoDataFrame containing XYZ points.
3364
- nodata : Union[int, float])
3363
+
3364
+ +----+-------+-------+-------+
3365
+ | | X | Y | Z |
3366
+ +----+-------+-------+-------+
3367
+ | 0 | 3.23 | 5.69 | 2.03 |
3368
+ +----+-------+-------+-------+
3369
+ | 1 | 3.24 | 5.68 | 2.02 |
3370
+ +----+-------+-------+-------+
3371
+ | 2 | 3.25 | 5.67 | 1.97 |
3372
+ +----+-------+-------+-------+
3373
+ | 3 | 3.26 | 5.66 | 1.95 |
3374
+ +----+-------+-------+-------+
3375
+
3376
+ nodata : Union[int, float]), default: ``9999.0``
3365
3377
Nodata value to filter out points outside a designated area, e.g. ``nodata=9999.0``, default is ``9999.0``.
3366
- xcol : str
3378
+ xcol : str, default: ``'X'``
3367
3379
Name of the X column in the dataset, e.g. ``xcol='X'``, default is ``'X'``.
3368
- ycol : str
3380
+ ycol : str, default: ``'Y'``
3369
3381
Name of the Y column in the dataset, e.g. ``ycol='Y'``, default is ``'Y'``.
3370
- zcol : str
3382
+ zcol : str, default: ``'Z'``
3371
3383
Name of the Z column in the dataset, e.g. ``zcol='Z'``, default is ``'Z'``.
3372
- drop_nan : bool
3384
+ drop_nan : bool, default: ``True``
3373
3385
Boolean argument to drop points that contain a ``nan`` value as Z value. Options include ``True`` and
3374
3386
``False``, default is ``True``.
3375
3387
3376
3388
Returns
3377
3389
_______
3378
3390
3379
3391
line : shapely.geometry.linestring.LineString
3380
- LineString Z constructed from provided point values
3392
+ LineString Z constructed from provided point values.
3381
3393
3382
3394
.. versionadded:: 1.0.x
3383
3395
3384
- .. versionchanged:: 1.1
3385
- Adding argument `drop_nan` and code to drop coordinates that contain ``nan`` values as Z coordinates.
3396
+ .. versionchanged:: 1.2
3386
3397
3387
3398
Example
3388
3399
_______
@@ -3391,6 +3402,20 @@ def create_linestring_from_xyz_points(
3391
3402
>>> import gemgis as gg
3392
3403
>>> import numpy as np
3393
3404
>>> points = np.array([[3.23, 5.69, 2.03],[3.24, 5.68, 2.02],[3.25, 5.67, 1.97],[3.26, 5.66, 1.95]])
3405
+ >>> points
3406
+
3407
+ +----+-------+-------+-------+
3408
+ | | X | Y | Z |
3409
+ +----+-------+-------+-------+
3410
+ | 0 | 3.23 | 5.69 | 2.03 |
3411
+ +----+-------+-------+-------+
3412
+ | 1 | 3.24 | 5.68 | 2.02 |
3413
+ +----+-------+-------+-------+
3414
+ | 2 | 3.25 | 5.67 | 1.97 |
3415
+ +----+-------+-------+-------+
3416
+ | 3 | 3.26 | 5.66 | 1.95 |
3417
+ +----+-------+-------+-------+
3418
+
3394
3419
3395
3420
>>> # Creating LineStrings from points
3396
3421
>>> linestring = gg.vector.create_linestring_from_xyz_points(points=points)
0 commit comments