
    Oge                     ~    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<   y)zPoints and related utilities
    N)DimensionError)BaseGeometryPointc                   r    e Zd ZdZg Zd Zed        Zed        Zed        Z	ed        Z
d
dZed	        Zy)r   aq  
    A geometry type that represents a single coordinate with
    x,y and possibly z 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 : float
        Coordinate values

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

    >>> 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kD  rt        dt        |       d      t        |      dk(  rR|d   }t	        |t
              r|S t        |d      st        |      }t        j                  |      j                         }n#t        j                  |      j                         }|j                  dkD  rt        d|       t        j                  |j                  t        j                         s|D cg c]  }t#        |       }}t        j$                  |      }t	        |t
              st        d	      |S c c}w )
Nr   zPOINT EMPTY   z#Point() takes at most 3 arguments (z given)   __getitem__z:Point() takes only scalar or 1-size vector arguments, got z*Invalid values passed to Point constructor)lenshapelyfrom_wkt	TypeError
isinstancer   hasattrlistnpasarraysqueezearrayndim
ValueError
issubdtypedtypenumberfloatpoints)selfargscoordscgeoms        [/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/shapely/geometry/point.py__new__zPoint.__new__4   s*   t9> ##M22Y]A#d)GTUUY!^!WF&%( 6=1fZZ'//1F XXd^++-F;;?LTFS  }}V\\2995(./1eAh/F/~~f%$&IJJ	 0s   E"c                 >    t        t        j                  |             S )zReturn x coordinate.)r   r   get_xr   s    r"   xzPoint.xU        W]]4())    c                 >    t        t        j                  |             S )zReturn y coordinate.)r   r   get_yr&   s    r"   yzPoint.yZ   r(   r)   c                 f    t        j                  |       st        d      | j                  d   d   S )zReturn z coordinate.zThis point has no z coordinate.r      )r   has_zr   r   r&   s    r"   zzPoint.z_   s/     }}T" !BCC{{1~a  r)   c                 &    d| j                   d   dS )Nr   r   )typecoordinates)r   r&   s    r"   __geo_interface__zPoint.__geo_interface__g   s    A??r)   Nc                 ~    | j                   ry|| j                  rdnd}|d}dj                  | d|z  d|z  ||      S )a  Returns 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 />z#66cc99z#ff3333g333333?ze<circle cx="{0.x}" cy="{0.y}" r="{1}" stroke="#555555" stroke-width="{2}" fill="{3}" opacity="{4}" />g      @      ?)is_emptyis_validformat)r   scale_factor
fill_coloropacitys       r"   svgz	Point.svgk   sS     ==&*mmJ?GN
&s\)3+=z7
S	Tr)   c                 .    | j                   j                  S )zSeparate arrays of X and Y coordinate values

        Example:
          >>> x, y = Point(0, 0).xy
          >>> list(x)
          [0.0]
          >>> list(y)
          [0.0]
        )r   xyr&   s    r"   r?   zPoint.xy   s     {{~~r)   )r6   NN)__name__
__module____qualname____doc__	__slots__r#   propertyr'   r,   r0   r4   r=   r?    r)   r"   r   r      s    #J IB * * * * ! ! @ @T0 
 
r)   )rC   numpyr   r   shapely.errorsr   shapely.geometry.baser   __all__r   libregistryrF   r)   r"   <module>rM      sB      ) .)BL BJ    Q r)   