+
    S<ÂjÅ#  ã                   óT   € R t ^ RIHt ^ RIHtHtHtHtHtH	t	H
t
 RR ltR tRR ltR# )	z 
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
)Ú
DataSource)ÚOFTDateÚOFTDateTimeÚ
OFTIntegerÚOFTInteger64ÚOFTRealÚ	OFTStringÚOFTTimec                óœ  € \        V \        4      '       d   \        V 4      p M"\        V \        4      '       d   M\        R4      h/ pW,          P                   F*  pVP                  4       pVRR R8X  d
   VR,          pWTV&   K,  	  W,          P                  pV'       d   VP                  4        \        V4      P                  4       WA&   V# )a²  
Given a DataSource, generate a dictionary that may be used
for invoking the LayerMapping utility.

Keyword Arguments:
 `geom_name` => The name of the geometry field to use for the model.

 `layer_key` => The key specifying which layer in the DataSource to use;
   defaults to 0 (the first layer). May be an integer index or a string
   identifier for the layer.

 `multi_geom` => Boolean (default: False) - specify as multigeometry.
ú>Data source parameter must be a string or a DataSource object.NÚ_Úfieldéÿÿÿÿ)	Ú
isinstanceÚstrr   Ú	TypeErrorÚfieldsÚlowerÚ	geom_typeÚto_multiÚupper)Údata_sourceÚ	geom_nameÚ	layer_keyÚ
multi_geomÚ_mappingr   ÚmfieldÚgtypes   &&&&    Úc/var/www/html/data_capital/venv/lib/python3.14/site-packages/django/contrib/gis/utils/ogrinspect.pyÚmappingr      s¹   € ô �+œs×#Ò#ä  Ó-‰Ü	�K¤×	,Ò	,ØäØLó
ð 	
ð
 €Hð Õ'×.Ô.ˆØ—‘“ˆØ�"�#ˆ;˜#ÔØ�gÕˆFØ �Óñ	 /ð
 Õ"×,Ñ,€EßØ�‰ÔÜ˜e›*×*Ñ*Ó,€HÑØ€Oó    c                 ó6   € RP                  \        V / VB 4      # )a½	  
Given a data source (either a string or a DataSource object) and a string
model name this function will generate a GeoDjango model.

Usage:

>>> from django.contrib.gis.utils import ogrinspect
>>> ogrinspect('/path/to/shapefile.shp','NewModel')

...will print model definition to stout

or put this in a Python script and use to redirect the output to a new
model like:

$ python generate_model.py > myapp/models.py

# generate_model.py
from django.contrib.gis.utils import ogrinspect
shp_file = 'data/mapping_hacks/world_borders.shp'
model_name = 'WorldBorders'

print(ogrinspect(shp_file, model_name, multi_geom=True, srid=4326,
                 geom_name='shapes', blank=True))

Required Arguments
 `datasource` => string or DataSource object to file pointer

 `model name` => string of name of new model class to create

Optional Keyword Arguments
 `geom_name` => For specifying the model name for the Geometry Field.
   Otherwise will default to `geom`

 `layer_key` => The key specifying which layer in the DataSource to use;
   defaults to 0 (the first layer). May be an integer index or a string
   identifier for the layer.

 `srid` => The SRID to use for the Geometry Field. If it can be determined,
   the SRID of the datasource is used.

 `multi_geom` => Boolean (default: False) - specify as multigeometry.

 `name_field` => String - specifies a field name to return for the
   __str__() method (which will be generated if specified).

 `imports` => Boolean (default: True) - set to False to omit the
   `from django.contrib.gis.db import models` code from the
   autogenerated models thus avoiding duplicated imports when building
   more than one model by batching ogrinspect()

 `decimal` => Boolean or sequence (default: False). When set to True
   all generated model fields corresponding to the `OFTReal` type will
   be `DecimalField` instead of `FloatField`. A sequence of specific
   field names to generate as `DecimalField` may also be used.

 `blank` => Boolean or sequence (default: False). When set to True all
   generated model fields will have `blank=True`. If the user wants to
   give specific fields to have blank, then a list/tuple of OGR field
   names may be used.

 `null` => Boolean (default: False) - When set to True all generated
   model fields will have `null=True`. If the user wants to specify
   give specific fields to have null, then a list/tuple of OGR field
   names may be used.

Note: Call the _ogrinspect() helper to do the heavy lifting.
Ú
)ÚjoinÚ_ogrinspect)ÚargsÚkwargss   *,r   Ú
ogrinspectr'   ;   s   € ðH �9‰9”[ $Ð1¨&Ñ1Ó2Ð2r    Nc              #  ó˜  aaa"  € \        V \        4      '       d   \        V 4      p M"\        V \        4      '       d   M\        R4      hW,          pVP                  oV3R lpV! V
4      oV! V	4      oV! V4      pVV3R lpV'       d   Rx € Rx € Rx € Rx € RV,          x € \        SVP                  VP                  VP                  4       EFH  w  ppppVP                  4       pVRR R	8X  d
   VR
,          pV! V4      pV\        J d=   VP                  4       V9   d   RVVVV3,          x € Kd  RV: RVR,          : R2x € Kz  V\        J d   RV: RVR,          : R2x € Kš  V\        J d   RV: RVR,          : R2x € Kº  V\        J d   RV: RV: V: R2x € KÖ  V\        J d   RV: RVR,          : R2x € Kö  V\        J d   RV: RVR,          : R2x € EK  V\         J d   RV: RVR,          : R2x € EK8  \        RV: RV: 24      h	  VP"                  pV'       d   VP%                  4        VP&                  pVfC   VP(                  f   RpM:VP(                  P*                  pVf   RpMVR8X  d   RpMRV,          pM	RV,          pRV: RV: RV: R2x € V'       d   Rx € RV,          x € R# R# 5i)zš
Helper routine for `ogrinspect` that generates GeoDjango models
corresponding to the given data source. See the `ogrinspect` docstring for
more details.
r   c                 óà   <€ \        V \        \        34      '       d    V  Uu. uF  qP                  4       NK  	  up# V '       d    S Uu. uF  qP                  4       NK  	  up# . # u upi u upi )N)r   ÚlistÚtupler   )ÚkwargÚsÚ
ogr_fieldss   & €r   Úprocess_kwargÚ"_ogrinspect.<locals>.process_kwarg¥   sV   ø€ Ü�eœd¤E˜]×+Ò+Ù',Ó-¡u !—G‘G–I¡uÑ-Ð-ßÙ'1Ó2¡z !—G‘G–I¡zÑ2Ð2àˆIùò	 .ùâ2s   ¢A&Á	A+c                 óä   <€ . pV P                  4       S9   d   VP                  R 4       V P                  4       S9   d   VP                  R4       V'       d   RRP                  V4      ,           # R# )z	null=Truez
blank=Truez, Ú )r   Úappendr#   )Ú
field_nameÚkwlistÚblank_fieldsÚnull_fieldss   & €€r   Úget_kwargs_strÚ#_ogrinspect.<locals>.get_kwargs_str²   s\   ø€ ØˆØ×ÑÓ Ô,Ø�M‰M˜+Ô&Ø×ÑÓ Ô-Ø�M‰M˜,Ô'ßØ˜$Ÿ)™) FÓ+Õ+Ð+ár    zF# This is an auto-generated Django model module created by ogrinspect.z(from django.contrib.gis.db import modelsr2   zclass %s(models.Model):Nr   r   z@    %s = models.DecimalField(max_digits=%d, decimal_places=%d%s)z    z = models.FloatField(:é   NNÚ)z = models.IntegerField(z = models.BigIntegerField(z = models.CharField(max_length=z = models.DateField(z = models.DateTimeField(z = models.TimeField(zUnknown field type z in zsrid=-1iæ  zsrid=%sz
 = models.Ú(z%    def __str__(self): return self.%sr   )r   r   r   r   r   ÚzipÚfield_widthsÚfield_precisionsÚfield_typesr   r   r   r   r   r   r   r	   r   r   ÚdjangoÚsrsÚsrid)r   Ú
model_namer   r   rC   r   Ú
name_fieldÚimportsÚdecimalÚblankÚnullÚlayerr/   Údecimal_fieldsr8   r4   ÚwidthÚ	precisionÚ
field_typer   Ú
kwargs_strr   Ú
geom_fieldÚsrid_strr6   r7   r.   s   &&&&&&&&&&&             @@@r   r$   r$   ‚   s›  úé € ô& �+œs×#Ò#Ü  Ó-‰Ü	�K¤×	,Ò	,ØäØLó
ð 	
ð Õ"€EØ—‘€Jõñ   Ó%€KÙ  Ó'€LÙ" 7Ó+€Nö	÷ ØVÒVØ8Ò8ØŠØŠà
# jÕ
0Ò0ä47Ø�E×&Ñ&¨×(>Ñ(>À×@QÑ@Q÷5Ñ0ˆ
�E˜9 jð ×!Ñ!Ó#ˆØ�"�#ˆ;˜#ÔØ�gÕˆFñ $ JÓ/ˆ
àœÓ ð ×ÑÓ! ^Ô3àVàØØØð	õô ð 4ó ;AÀ*ÈRÇ.À.ÐQÔQØœ:Ô%Û8>À
È2ÇÀÐOÔOØœ<Ô'Û;AÀ:ÈbÇ>À>ÐRÔRØœ9Ô$ãÚÛðô ð
 œ7Ô"Û5;¸ZÈ¿^¸^ÐLÔLØœ;Ô&Û9?ÀÈBÇÀÐPÕPØœ7Ô"Û5;¸ZÈ¿^¸^ÐLÕLå»ZÊÐPÓQÐQñW5ð\ �O‰O€EßØ�‰ÔØ—‘€Jð ‚|Ø�9‰9ÒØ ‰Hà—9‘9—>‘>ˆDØŠ|Ø$‘Ø˜”à‘à$ tÕ+‘à˜tÕ#ˆøã&/³»XÐ
FÒFçØŠØ5¸
ÕBÔBñ ùs   …H-K
È3BK
Ê7K
)Úgeomé    F)	rR   rS   NFNTFFF)Ú__doc__Údjango.contrib.gis.gdalr   Údjango.contrib.gis.gdal.fieldr   r   r   r   r   r   r	   r   r'   r$   © r    r   Ú<module>rX      s2   ðñõ /÷÷ ñ ô%òPD3öNKCr    