3
®?d]Þ  ã               @   s<   d Z ddlmZ ddd„Zddd„Zddd	„Zdd
d„ZdS )z>Load/dump geometries using the well-known binary (WKB) format
é    )ÚgeosFc             C   s(   t jt jƒ}|r|j| ƒS |j| ƒS dS )zWLoad a geometry from a WKB byte string, or hex-encoded string if
    ``hex=True``.
    N)r   Z	WKBReaderÚlgeosZread_hexÚread)ÚdataÚhexÚreader© r   ú./tmp/pip-build-op5p2y5_/shapely/shapely/wkb.pyÚloads   s    
r
   c             C   s   | j ƒ }t||d�S )z"Load a geometry from an open file.)r   )r   r
   )Úfpr   r   r   r   r	   Úload   s    r   c             K   s,   t jt jf|Ž}|r|j| ƒS |j| ƒS dS )z°Dump a WKB representation of a geometry to a byte string, or a
    hex-encoded string if ``hex=True``.

    See available keyword output settings in ``shapely.geos.WKBWriter``.N)r   Z	WKBWriterr   Z	write_hexÚwrite)Úobr   ÚkwÚwriterr   r   r	   Údumps   s    
r   c             K   s   |j t| fd|i|—Žƒ dS )z Dump a geometry to an open file.r   N)r   r   )r   r   r   r   r   r   r	   Údump#   s    r   N)F)F)F)F)Ú__doc__Zshapelyr   r
   r   r   r   r   r   r   r	   Ú<module>   s
   



