ó
i4Vdc           @   s<   d  Z  d d l m Z d d l m Z d d „ Z e Z d S(   s°   
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.
iÿÿÿÿ(   t
   DataSource(   t   GEO_CLASSESi
   c         C   s¥  t  |  t ƒ r t |  ƒ }  n t  |  t ƒ r0 n t d ƒ ‚ xbt |  ƒ D]T\ } } d |  j GHd | GHd t | j j j	 GHd t
 | ƒ GHd | j GH| j j } d | d d	 !| d	 d
 !f GHd | GHt t t
 | j ƒ Œ  } d | } x« t | |  ƒ D]™ \ } } d | GHx | j D]v }	 | |	 j }
 | |	 |
 f } | j |	 ƒ } | r†t  | t ƒ rod } n d } | | | 7} n
 | d 7} | GHqWq WqI Wd S(   s„   
    Walks the available layers in the supplied `data_source`, displaying
    the fields for the first `num_features` features.
    s>   Data source parameter must be a string or a DataSource object.s   data source : %ss   ==== layer %ss     shape type: %ss     # features: %ss            srs: %ss         extent: %s - %si    i   i   s%   Displaying the first %s features ====s    %%%ss: %%ss   === Feature %ss    ("%s")s    (%s)s    (None)N(   t
   isinstancet   strR    t	   Exceptiont	   enumeratet   nameR   t	   geom_typet   numt   __name__t   lent   srst   extentt   tuplet   maxt   mapt   fieldst	   type_namet   get(   t   data_sourcet   num_featurest   it   layert
   extent_tupt   widtht   fmtt   jt   featuret   fld_nameR   t   outputt   valt   val_fmt(    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/utils/ogrinfo.pyt   ogrinfo   s:    		
		
N(   t   __doc__t   django.contrib.gis.gdalR    t"   django.contrib.gis.gdal.geometriesR   R    t   sample(    (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/utils/ogrinfo.pyt   <module>   s   +