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 }||	}|rt |trd}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&   b/var/www/html/optinet_system/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    