
    \i                         S r SSKrSSKrSSKJr  SSKJrJr  SSK	J
r
  S/r " S S\5      r\\R                  R                  S'   g)	z#Line strings and related utilities.    N)deprecate_positional)
JOIN_STYLEBaseGeometry)Point
LineStringc                       \ rS rSrSr/ rSS jr\S 5       rSS jr	\S 5       r
\" / SQ\S	9S
\R                  S4S j5       rSS
\R                  S4S jrSrg)r      aa  A geometry type composed of one or more line segments.

A LineString is a one-dimensional feature and has a non-zero length but
zero area. It may approximate a curve and need not be straight. A LineString may
be closed.

Parameters
----------
coordinates : sequence
    A sequence of (x, y, [,z]) numeric coordinate pairs or triples, or
    an array-like with shape (N, 2) or (N, 3).
    Also can be a sequence of Point objects, or combination of both.

Examples
--------
Create a LineString with two segments

>>> from shapely import LineString
>>> a = LineString([[0, 0], [1, 0], [1, 1]])
>>> a.length
2.0

Nc                    Uc  [         R                  " S5      $ [        U[        5      (       a!  [	        U5      [        L a  U$ UR
                  nO[        US5      (       a  [        R                  " U5      n[        U[        R                  5      (       a5  [        R                  " UR                  [        R                  5      (       a  OS nU Vs/ s H
  o2" U5      PM     nn[        U5      S:X  a  [         R                  " S5      $ [         R                  " U5      n[        U[        5      (       d  [        S5      eU$ s  snf )z!Create a new LineString geometry.zLINESTRING EMPTY	__array__c                     [        U [        5      (       a  U R                  S   $ U  Vs/ s H  n[        U5      PM     sn$ s  snf )Nr   )
isinstancer   coordsfloat)ocs     ^/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/shapely/geometry/linestring.py_coords#LineString.__new__.<locals>._coords?   s9    !!U++ xx{*234!Qa!444s   Ar   z/Invalid values passed to LineString constructor)shapelyfrom_wktr   r   typer   hasattrnpasarrayndarray
issubdtypedtypenumberlenlinestrings
ValueError)selfcoordinatesr   r   geoms        r   __new__LineString.__new__(   s    ##$677Z00K J."" *00{K00 jj5+rzz22r}}!!2998 8 5 4??;awqz;?{q  ##$677"";/$
++NOO @s   Ec                 2    S[        U R                  5      S.$ )z9Return a GeoJSON-like mapping of the LineString geometry.r   )r   r#   )tupler   r"   s    r   __geo_interface__LineString.__geo_interface__Q   s     %U4;;5GHH    c           	          U R                   (       a  gUc  U R                  (       a  SOSnUc  SnSR                  U R                   Vs/ s H  nSR                  " U6 PM     sn5      nSU SS	U-   S
U SU S3	$ s  snf )a  Return SVG polyline element for the LineString geometry.

Parameters
----------
scale_factor : float
    Multiplication factor for the SVG stroke-width.  Default is 1.
stroke_color : str, optional
    Hex string for stroke color. Default is to use "#66cc99" if
    geometry is valid, and "#ff3333" if invalid.
opacity : float
    Float number between 0 and 1 for color opacity. Default value is 0.8

z<g />z#66cc99z#ff3333g? z{},{}z<polyline fill="none" stroke="z" stroke-width="g       @z
" points="z" opacity="z" />)is_emptyis_validjoinr   format)r"   scale_factorstroke_coloropacityr   
pnt_formats         r   svgLineString.svgV   s     ==(,99L?GXX4;;G;aw~~q1;GH
,\N ; </0 1!l+gYd<	
 Hs   	A;c                 .    U R                   R                  $ )zSeparate arrays of X and Y coordinate values.

Examples
--------
>>> from shapely import LineString
>>> x, y = LineString([(0, 0), (1, 1)]).xy
>>> list(x)
[0.0, 1.0]
>>> list(y)
[0.0, 1.0]

)r   xyr)   s    r   r:   LineString.xyq   s     {{~~r,   	quad_segs
join_stylemitre_limit)category   g      @c                     US:X  a  [        S5      e[        R                  " U5      (       d  [        S5      e[        R                  " U UUUUS9$ )a  Return a (Multi)LineString at a distance from the object.

The side, left or right, is determined by the sign of the `distance`
parameter (negative for right side offset, positive for left side
offset). The resolution of the buffer around each vertex of the object
increases by increasing the `quad_segs` keyword parameter.

The join style is for outside corners between line segments. Accepted
values are JOIN_STYLE.round (1), JOIN_STYLE.mitre (2), and
JOIN_STYLE.bevel (3).

The mitre ratio limit is used for very sharp corners. It is the ratio
of the distance from the corner to the end of the mitred offset corner.
When two line segments meet at a sharp angle, a miter join will extend
far beyond the original geometry. To prevent unreasonable geometry, the
mitre limit allows controlling the maximum length of the join corner.
Corners with a ratio which exceed the limit will be beveled.

Note: the behaviour regarding orientation of the resulting line
depends on the GEOS version. With GEOS < 3.11, the line retains the
same direction for a left offset (positive distance) or has reverse
direction for a right offset (negative distance), and this behaviour
was documented as such in previous Shapely versions. Starting with
GEOS 3.11, the function tries to preserve the orientation of the
original line.
g        z3Cannot compute offset from zero-length line segmentz$offset_curve distance must be finiter<   )r!   r   isfiniter   offset_curve)r"   distancer=   r>   r?   s        r   rD   LineString.offset_curve   sV    H #RSSX&&CDD##!#
 	
r,   rightc                 <    US:X  a  US-  nU R                  UUUUS9$ )ab  Alternative method to :meth:`offset_curve` method.

Older alternative method to the :meth:`offset_curve` method, but uses
``resolution`` instead of ``quad_segs`` and a ``side`` keyword
('left' or 'right') instead of sign of the distance. This method is
kept for backwards compatibility for now, but is is recommended to
use :meth:`offset_curve` instead.
rG   r<   )rD   )r"   rE   side
resolutionr>   r?   s         r   parallel_offsetLineString.parallel_offset   s8      7?NH   !#	 ! 
 	
r,    )N)g      ?NN)__name__
__module____qualname____firstlineno____doc__	__slots__r%   propertyr*   r7   r:   r   DeprecationWarningr   roundrD   rL   __static_attributes__rN   r,   r   r   r      s    0 I'R I I
6  . 2=O ##+
+
` ##
r,      )rS   numpyr   r   shapely.decoratorsr   shapely.geometry.baser   r   shapely.geometry.pointr   __all__r   libregistryrN   r,   r   <module>ra      sC    )   3 : (.C
 C
L %  Q r,   