a
    1$e	                     @   s  d Z ddlZddlZddlZddlmZ ddlZddlZddlm	Z	 ddl
mZmZ eeZe ejdddejd	d
ejddeejdddddejdddddddejdddddejdddddejdddddejejed d! ZdS )"z
$ fio info    N)
indent_opt)DriverError)optionswith_context_envinputT)requiredz--layerz
INDEX|NAMEzPrint information about a specific layer.  The first layer is used by default.  Layers use zero-based numbering when accessed by index.)metavarcallbackhelpz--countmeta_membercountzPrint the count of features.)
flag_valuer
   z-fz--formatz--driverZdriverzPrint the format driver.z--crscrsz!Print the CRS as a PROJ.4 string.z--boundsboundsz:Print the boundary coordinates (left, bottom, right, top).z--namenamezPrint the datasource's name.c              	   C   s0  t j|fd|i|}|j}|j|jd z|j|jd W n( tyh   |jdd td Y n0 z|jt	|d W n( t
y   |jdd td Y n0 |j |d< |rt|| ttfrtd	tt||  nt||  nttj||d
 W d   n1 s"0    Y  dS )z
    Print information about a dataset.

    When working with a multi-layer dataset the first layer is used by default.
    Use the '--layer' option to select a different layer.

    layer)r   )r   NzBSetting 'bounds' to None - driver was not able to calculate bounds)r   z>Setting 'count' to None/null - layer does not support countingr    )indent)fionaopenmetaupdater   r   r   loggerdebuglen	TypeErrorr   	to_string
isinstancelisttupleclickechojoinmapstrjsondumps)ctxr   r   r   r   Zopen_optionssrcinfo r*   J/var/www/html/django/DPS/env/lib/python3.9/site-packages/fiona/fio/info.pyr)      s.     

r)   )__doc__loggingr%   r    Zcligjr   r   Z	fiona.crsZfiona.errorsr   Z	fiona.fior   r   	getLogger__name__r   commandargumentoptionZcb_layerZopen_optpass_contextr)   r*   r*   r*   r+   <module>   sD   




