a
    ŠJ5d›  ã                   @   s2   d Z ddlZdd„ Zdd„ Zdd	d
„Zdd„ ZdS )znLoad/dump geometries using the well-known text (WKT) format

Also provides pickle-like convenience functions.
é    Nc                 C   s
   t  | ¡S )z¤
    Load a geometry from a WKT string.

    Parameters
    ----------
    data : str
        A WKT string

    Returns
    -------
    Shapely geometry object
    )ÚshapelyZfrom_wkt)Údata© r   úG/var/www/html/django/DPS/env/lib/python3.9/site-packages/shapely/wkt.pyÚloads	   s    r   c                 C   s   |   ¡ }t|ƒS )zÆ
    Load a geometry from an open file.

    Parameters
    ----------
    fp :
        A file-like object which implements a `read` method.

    Returns
    -------
    Shapely geometry object
    )Úreadr   )Úfpr   r   r   r   Úload   s    r	   Féÿÿÿÿc                 K   s   t j| f||dœ|¤ŽS )a  
    Dump a WKT representation of a geometry to a string.

    Parameters
    ----------
    ob :
        A geometry object of any type to be dumped to WKT.
    trim : bool, default False
        Remove excess decimals from the WKT.
    rounding_precision : int
        Round output to the specified number of digits.
        Default behavior returns full precision.
    output_dimension : int, default 3
        Force removal of dimensions above the one specified.

    Returns
    -------
    input geometry as WKT string
    )ÚtrimÚrounding_precision)r   Zto_wkt)Úobr   r   Úkwr   r   r   Údumps*   s    r   c                 K   s   |  t| fi |¤Ž¡ dS )a+  
    Dump a geometry to an open file.

    Parameters
    ----------
    ob :
        A geometry object of any type to be dumped to WKT.
    fp :
        A file-like object which implements a `write` method.
    trim : bool, default False
        Remove excess decimals from the WKT.
    rounding_precision : int
        Round output to the specified number of digits.
        Default behavior returns full precision.
    output_dimension : int, default 3
        Force removal of dimensions above the one specified.

    Returns
    -------
    None
    N)Úwriter   )r   r   Úsettingsr   r   r   ÚdumpA   s    r   )Fr
   )Ú__doc__r   r   r	   r   r   r   r   r   r   Ú<module>   s
   
