o »ŽÒ_Žã@s*dZddlmZddlmZddd„ZdS) 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é cCs`t|tƒr t|ƒ}n t|tƒrntdƒ‚t|ƒD]•\}}td|jƒtd|ƒtdt|jj j ƒtdt |ƒƒtd|j ƒ|j j}td|dd …|d d …fƒtd |ƒttt |jƒŽ}d |}t|d |…ƒD];\}}td|ƒ|jD]-} || j} || | f} | | ¡} | r£t| tƒršd} nd} | | | 7} n| d7} t| ƒq~qqqd 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.zdata 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/usr/lib/python3/dist-packages/django/contrib/gis/utils/ogrinfo.pyÚogrinfo s@             ôþôr(N)r)Ú__doc__Údjango.contrib.gis.gdalrÚ"django.contrib.gis.gdal.geometriesrr(r&r&r&r'Ús