3
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   sv  t | trt| } nt | tr ntdxFt| D ]8\}}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| }xt|d| D ]\}}td|  xj|jD ]`}	||	 j}
||	|
f }|j|	}|rTt |trBd}nd}||| 7 }n|d7 }t| qW qW q4W 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iZlayerZ
extent_tupwidthfmtjfeatureZfld_namer   outputvalZval_fmt r   ^/var/www/tester-filtro-web/env/lib/python3.6/site-packages/django/contrib/gis/utils/ogrinfo.pyogrinfo   s:    


 

r   N)r   )__doc__Zdjango.contrib.gis.gdalr   Z"django.contrib.gis.gdal.geometriesr   r   r   r   r   r   <module>   s   