o
    ó<âg¤  ã                   @   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   Ú	geom_typeÚnumÚ__name__ÚlenÚsrsÚextentÚtupleÚmaxÚmapÚfieldsÚ	type_nameÚget)Údata_sourceÚnum_featuresÚiÚlayerÚ
extent_tupÚwidthÚfmtÚjÚfeatureÚfld_namer   ÚoutputÚvalÚval_fmt© r&   úS/var/www/html/venv/lib/python3.10/site-packages/django/contrib/gis/utils/ogrinfo.pyÚogrinfo   sD   


ÿ 




ôþôr(   N)r   )Ú__doc__Údjango.contrib.gis.gdalr   Ú"django.contrib.gis.gdal.geometriesr   r(   r&   r&   r&   r'   Ú<module>   s    