o
    ÷Ç[h¤  ã                   @   s*   d Z ddlmZ ddlmZ ddd„ZdS )	z°
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
é    )Ú
DataSource)ÚGEO_CLASSESé
   c                 C   s`  t | tƒr
t| ƒ} n
t | tƒrntdƒ‚t| ƒD ]•\}}td| j ƒ td| ƒ tdt|jj	 j
 ƒ tdt|ƒ ƒ td|j ƒ |jj}td|dd	… |d	d
… f ƒ td| ƒ ttt|jƒŽ }d| }t|d|… ƒD ];\}}td| ƒ |jD ]-}	||	 j}
||	|
f }| |	¡}|r£t |tƒršd}nd}||| 7 }n|d7 }t|ƒ q~qqqdS )zƒ
    Walk the available layers in the supplied `data_source`, displaying
    the fields for the first `num_features` features.
    z>Data source parameter must be a string or a DataSource object.zdata source : %sz==== layer %sz  shape type: %sz  # features: %sz         srs: %sz      extent: %s - %sr   é   é   z%Displaying the first %s features ====z %%%ss: %%sNz=== Feature %sz ("%s")z (%s)z (None))Ú
isinstanceÚstrr   Ú	ExceptionÚ	enumerateÚprintÚnamer   Z	geom_typeÚnumÚ__name__ÚlenZsrsZextentÚtupleÚmaxÚmapÚfieldsÚ	type_nameÚget)Zdata_sourceZnum_featuresÚiÚlayerZ
extent_tupÚwidthÚfmtÚjÚfeatureZfld_namer   ÚoutputÚvalZval_fmt© r   ú‡/home/ubuntu/experiments/live_experiments/Pythonexperiments/Otree/venv/lib/python3.10/site-packages/django/contrib/gis/utils/ogrinfo.pyÚogrinfo   sD   


ÿ 




ôþôr    N)r   )Ú__doc__Zdjango.contrib.gis.gdalr   Z"django.contrib.gis.gdal.geometriesr   r    r   r   r   r   Ú<module>   s    