o
    Jfe                     @   sR   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 deZ	e	ej
jd< dS )zPoints and related utilities
    N)DimensionError)BaseGeometryPointc                   @   sb   e Zd ZdZg Zdd Zedd Zedd Zedd	 Z	ed
d Z
dddZedd ZdS )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                 G   s   t |dkrtdS t |dkrtdt | dt |dkr=|d }t|tr,|S t|ds5t|}t	|
 }nt|
 }|jdkrPtd| t|jtjs_d	d
 |D }t|}t|tsmtd|S )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 c                 S   s   g | ]}t |qS  )float).0cr   r   b/home/deployuser/azure_apps/autowriter/venv/lib/python3.10/site-packages/shapely/geometry/point.py
<listcomp>M   s    z!Point.__new__.<locals>.<listcomp>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geomr   r   r   __new__4   s,   





zPoint.__new__c                 C      t t| S )zReturn x coordinate.)r	   r   get_xr   r   r   r   xU      zPoint.xc                 C   r$   )zReturn y coordinate.)r	   r   get_yr&   r   r   r   yZ   r(   zPoint.yc                 C   s    t | s	td| jd d S )zReturn z coordinate.zThis point has no z coordinate.r      )r   has_zr   r!   r&   r   r   r   z_   s   
zPoint.zc                 C   s   d| j d dS )Nr   r   )typecoordinates)r!   r&   r   r   r   __geo_interface__g   s   zPoint.__geo_interface__      ?Nc                 C   sF   | j rdS |du r| jrdnd}|du rd}d| d| d| ||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 />Nz#66cc99z#ff3333g333333?ze<circle cx="{0.x}" cy="{0.y}" r="{1}" stroke="#555555" stroke-width="{2}" fill="{3}" opacity="{4}" />g      @r1   )is_emptyis_validformat)r   scale_factor
fill_coloropacityr   r   r   svgk   s   z	Point.svgc                 C   s   | 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&   r   r   r   r9      s   zPoint.xy)r1   NN)__name__
__module____qualname____doc__	__slots__r#   propertyr'   r*   r-   r0   r8   r9   r   r   r   r   r      s    %!




)r=   numpyr   r   shapely.errorsr   shapely.geometry.baser   __all__r   libregistryr   r   r   r   <module>   s     