o
    h                     @   s8   d Z ddlZdddZdddZddd	Zdd
dZdS )zqLoad/dump geometries using the well-known binary (WKB) format.

Also provides pickle-like convenience functions.
    NFc                 C   s
   t | S )zLoad a geometry from a WKB byte string.

    If ``hex=True``, the string will be hex-encoded.

    Raises
    ------
    GEOSException, UnicodeDecodeError
        If ``data`` contains an invalid geometry.

    )shapelyfrom_wkb)datahex r   F/var/www/html/scripts/venv/lib/python3.10/site-packages/shapely/wkb.pyloads	   s   
r   c                 C   s   |   }t||dS )zLoad a geometry from an open file.

    Raises
    ------
    GEOSException, UnicodeDecodeError
        If the given file contains an invalid geometry.

    )r   )readr   )fpr   r   r   r   r   load   s   	r   c                 K   s\   |durt | |} d|d< d|v r#|d}|rdnd}|j|d t j| fd|i|S )	aW  Dump a WKB representation of a geometry to a byte string.

    If ``hex=True``, the string will be hex-encoded.

    Parameters
    ----------
    ob : geometry
        The geometry to export to well-known binary (WKB) representation.
    hex : bool
        If true, export the WKB as a hexadecimal string. The default is to
        return a binary string/bytes object.
    srid : int
        Spatial reference system ID to include in the output. The default value
        means no SRID is included.
    **kw : kwargs, optional
        Keyword output options passed to :func:`~shapely.to_wkb`.

    NTinclude_srid
big_endianr      )
byte_orderr   )r   set_sridpopupdateto_wkb)obr   sridkwr   r   r   r   r   dumps$   s   
r   c                 K   s   | t| fd|i| dS )z Dump a geometry to an open file.r   N)writer   )r   r
   r   r   r   r   r   dumpD   s   r   )F)FN)__doc__r   r   r   r   r   r   r   r   r   <module>   s    


 