
    (&h{                     r    d Z ddlZddlZddlmZ ddlmZ dgZ G d de          Z	e	ej
        j        d<   dS )zPoints and related utilities.    N)DimensionError)BaseGeometryPointc                       e Zd ZdZg Zd Zed             Zed             Zed             Z	ed             Z
ed             Zdd
Zed             Zd	S )r   a  A geometry type that represents a single coordinate.

    Each coordinate has x, y and possibly z and/or m values.

    A point is a zero-dimensional feature and has zero length and zero area.

    Parameters
    ----------
    args : float, or sequence of floats
        The coordinates can either be passed as a single parameter, or as
        individual float values using multiple parameters:

        1) 1 parameter: a sequence or array-like of with 2 or 3 values.
        2) 2 or 3 parameters (float): x, y, and possibly z.

    Attributes
    ----------
    x, y, z, m : float
        Coordinate values

    Examples
    --------
    Constructing the Point using separate parameters for x and y:

    >>> from shapely import Point
    >>> p = Point(1.0, -1.0)

    Constructing the Point using a list of x, y coordinates:

    >>> p = Point([1.0, -1.0])
    >>> print(p)
    POINT (1 -1)
    >>> p.y
    -1.0
    >>> p.x
    1.0

    c                     t          |          dk    rt          j        d          S t          |          dk    r t          dt          |           d          t          |          dk    re|d         }t	          |t
                    r|S t          |d          st          |          }t          j	        |          
                                }n&t          j        |          
                                }|j        dk    rt          d|           t          j        |j        t          j                  sd	 |D             }t          j        |          }t	          |t
                    st          d
          |S )zCreate a new Point geometry.r   zPOINT EMPTY   z#Point() takes at most 3 arguments (z given)   __getitem__z:Point() takes only scalar or 1-size vector arguments, got c                 ,    g | ]}t          |          S  )float).0cs     Q/var/www/html/reinick/venv/lib/python3.11/site-packages/shapely/geometry/point.py
<listcomp>z!Point.__new__.<locals>.<listcomp>P   s    ///1eAhh///    z*Invalid values passed to Point constructor)lenshapelyfrom_wkt	TypeError
isinstancer   hasattrlistnpasarraysqueezearrayndim
ValueError
issubdtypedtypenumberpoints)selfargscoordsgeoms       r   __new__zPoint.__new__6   sd   t99>> #M222YY]]T#d))TTTUUUYY!^^!WF&%((  6=11 &fZ''//11FF Xd^^++--F;??STSS   }V\2955 	0/////F~f%%$&& 	KIJJJr   c                 D    t          t          j        |                     S )zReturn x coordinate.)r   r   get_xr$   s    r   xzPoint.xX        W]4(()))r   c                 D    t          t          j        |                     S )zReturn y coordinate.)r   r   get_yr+   s    r   yzPoint.y]   r-   r   c                     t          j        |           }t          j        |          r#t          j        |           st          d          t          |          S )zReturn z coordinate.zThis point has no z coordinate.)r   get_zr   isnanhas_zr   r   )r$   zs     r   r5   zPoint.zb   sP     M$8A;; 	Dw}T22 	D !BCCCQxxr   c                     t          j        |           st          d          t          t          j        |                     S )zmReturn m coordinate.

        .. versionadded:: 2.1.0
           Also requires GEOS 3.12.0 or later.
        zThis point has no m coordinate.)r   has_mr   r   get_mr+   s    r   mzPoint.mj   s>     }T"" 	D !BCCCW]4(()))r   c                 P    | j         }dt          |          dk    r|d         nddS )z4Return a GeoJSON-like mapping of the Point geometry.r   r   r   )typecoordinates)r&   r   )r$   r&   s     r   __geo_interface__zPoint.__geo_interface__u   s0     S[[1__q		RTUUUr         ?Nc                     | j         rdS || j        rdnd}|d}d| j         d| j         dd	|z   d
d|z   d| d| dS )a  Return SVG circle element for the Point geometry.

        Parameters
        ----------
        scale_factor : float
            Multiplication factor for the SVG circle diameter.  Default is 1.
        fill_color : str, optional
            Hex string for fill 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.6

        z<g />Nz#66cc99z#ff3333g333333?z<circle cx="z" cy="z" r="g      @z!" stroke="#555555" stroke-width="r>   z" fill="z" opacity="z" />)is_emptyis_validr,   r0   )r$   scale_factor
fill_coloropacitys       r   svgz	Point.svg{   s     = 	7&*mBJ?G&46 & & & &cL6H & &.1L.@& &JT& && & &	
r   c                     | j         j        S )zSeparate arrays of X and Y coordinate values.

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

        )r&   xyr+   s    r   rG   zPoint.xy   s     {~r   )r>   NN)__name__
__module____qualname____doc__	__slots__r(   propertyr,   r0   r5   r9   r=   rE   rG   r   r   r   r   r      s        % %N I  D * * X* * * X*   X * * X* V V XV

 
 
 
4   X  r   )rK   numpyr   r   shapely.errorsr   shapely.geometry.baser   __all__r   libregistryr   r   r   <module>rT      s    # #      ) ) ) ) ) ) . . . . . .)W W W W WL W W Wt   Q   r   