ó
	GĎOc           @   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(    (    s9   ../Django//lib/python/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(    (    (    s9   ../Django//lib/python/django/contrib/gis/utils/ogrinfo.pyt   <module>   s   +