ó
    µRjç1  ã                   óª   • S r SSKJrJrJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJrJr   " S	 S
\5      r " S S\5      r " S S\5      rg)a6  
The Spatial Reference class, represents OGR Spatial Reference objects.

Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print(srs)
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]
>>> print(srs.proj)
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
>>> print(srs.ellipsoid)
(6378137.0, 6356752.3142451793, 298.25722356300003)
>>> print(srs.projected, srs.geographic)
False True
>>> srs.import_epsg(32140)
>>> print(srs.name)
NAD83 / Texas South Central
é    )ÚbyrefÚc_char_pÚc_int)ÚIntEnum)ÚGDALBase)ÚSRSException)ÚGDAL_VERSION)Úsrs)Úforce_bytesÚ	force_strc                   ó   • \ rS rSrSrSrSrg)Ú	AxisOrderé'   r   é   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚTRADITIONALÚ	AUTHORITYÚ__static_attributes__r   ó    ÚGD:\diplom_project\venv\Lib\site-packages\django/contrib/gis/gdal/srs.pyr   r   '   s   † Ø€KØƒIr   r   c                   óÐ  • \ rS rSrSr\R                  rS(S jrS r	S r
S)S jrS rS	 rS
 rS rS rS rS r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r \S 5       r!S r"S r#S r$S  r%S! r&\S" 5       r'\S)S# j5       r(\S$ 5       r)\S% 5       r*\S*S& j5       r+S'r,g)+ÚSpatialReferenceé,   zÙ
A wrapper for the OGRSpatialReference object. According to the GDAL web site,
the SpatialReference object "provide[s] services to represent coordinate
systems (projections and datums) and to transform between them."
Nc                 óB  • [        U[        S5      [        45      (       d  [        S5      eU=(       d    [        R                  U l        US:X  aÊ  [        R                  " [        S5      5      U l	        U R                  U5        U R
                  [        R                  :X  a6  [        S:¼  a,  [        R                  " U R                  U R
                  5        gU R
                  [        R                  :w  a"  [        S:  a  [        SU R
                  -  5      eg[        U[        5      (       a   [        U5      nSU-  nOE[        U[        5      (       a  SnO-[        XR                  5      (       a  UnS	nO[!        S
U-  5      eUS	:X  a  UnO![        S5      n[        R                  " U5      nU(       d  [#        SU-  5      eXPl	        U R
                  [        R                  :X  a6  [        S:¼  a,  [        R                  " U R                  U R
                  5        O@U R
                  [        R                  :w  a"  [        S:  a  [        SU R
                  -  5      eUS:X  a  U R%                  U5        gUS:X  a  U R'                  U5        gg! [         a     GNf = f)zü
Create a GDAL OSR Spatial Reference object from the given input.
The input may be string of OGC Well Known Text (WKT), an integer
EPSG code, a PROJ string, and/or a projection "well known" shorthand
string (one of 'WGS84', 'WGS72', 'NAD27', 'NAD83').
Nz:SpatialReference.axis_order must be an AxisOrder instance.Úwktr   )é   r   z"%s is not supported in GDAL < 3.0.zEPSG:%dÚepsgÚogrzInvalid SRS type "%s"z+Could not create spatial reference from: %sÚuser)Ú
isinstanceÚtyper   Ú
ValueErrorr   Ú
axis_orderÚcapiÚnew_srsr   ÚptrÚ
import_wktr	   Úset_axis_strategyÚstrÚintÚptr_typeÚ	TypeErrorr   Úimport_user_inputÚimport_epsg)ÚselfÚ	srs_inputÚsrs_typer'   Úsridr
   Úbufs          r   Ú__init__ÚSpatialReference.__init__5   s   € ô ˜*¤t¨D£z´9Ð&=×>Ñ>ÜØLóð ð %×=¬	×(=Ñ(=ˆŒØ�uÓÜ—|’|¤H¨S£MÓ2ˆDŒHØ�O‰O˜IÔ&Ø�‰¤)×"7Ñ"7Ó7¼LÈFÓ<RÜ×&Ò& t§x¡x°·±ÔAð ð —‘¤I×$9Ñ$9Ó9¼lÈVÓ>SÜ Ð!EÈÏÉÑ!WÓXÐXØÜ˜	¤3×'Ñ'ðô ˜9“~�Ø%¨Ñ,‘	ô ˜	¤3×'Ñ'à‰HÜ˜	§=¡=×1Ñ1ØˆCØ‰HäÐ3°hÑ>Ó?Ð?à�uÓà‰Cô ˜3“-ˆCÜ—,’,˜sÓ#ˆCö ÜØ=À	ÑIóð ð ŒHà�?‰?œi×3Ñ3Ó3¼ÈÓ8NÜ×"Ò" 4§8¡8¨T¯_©_Õ=Ø�_‰_¤	× 5Ñ 5Ó5¼,ÈÓ:OÜÐAÀDÇOÁOÑSÓTÐTà�vÓØ×"Ñ" 9Õ-Ø˜ÓØ×Ñ˜YÕ'ð  øôE ó Úðús   Ä0J Ê
JÊJc                 ól   • [        U[        5      (       a  U R                  " U6 $ U R                  U5      $ )aë  
Return the value of the given string attribute node, None if the node
doesn't exist.  Can also take a tuple as a parameter, (target, child),
where child is the index of the attribute in the WKT.  For example:

>>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]'
>>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326
>>> print(srs['GEOGCS'])
WGS 84
>>> print(srs['DATUM'])
WGS_1984
>>> print(srs['AUTHORITY'])
EPSG
>>> print(srs['AUTHORITY', 1]) # The authority value
4326
>>> print(srs['TOWGS84', 4]) # the fourth value in this wkt
0
>>> # For the units authority, have to use the pipe symbole.
>>> print(srs['UNIT|AUTHORITY'])
EPSG
>>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the units
9122
)r$   ÚtupleÚ
attr_value©r3   Útargets     r   Ú__getitem__ÚSpatialReference.__getitem__t   s/   € ô0 �fœe×$Ñ$Ø—?’? FÐ+Ð+à—?‘? 6Ó*Ð*r   c                 ó   • U R                   $ )zUse 'pretty' WKT.)Ú
pretty_wkt©r3   s    r   Ú__str__ÚSpatialReference.__str__‘   s   € à�‰Ðr   c                 ó¸   • [        U[        5      (       a  [        U[        5      (       d  [        e[        R
                  " U R                  [        U5      U5      $ )z‚
The attribute value for the given target node (e.g. 'PROJCS'). The index
keyword specifies an index of the child node to return.
)r$   r-   r.   r0   r(   Úget_attr_valuer*   r   )r3   r>   Úindexs      r   r<   ÚSpatialReference.attr_value–   s@   € ô
 ˜&¤#×&Ñ&¬j¸Ä×.DÑ.DÜˆOÜ×"Ò" 4§8¡8¬[¸Ó-@À%ÓHÐHr   c                 óh   • [         R                  " U R                  Uc  U5      $ [        U5      5      $ )z;Return the authority name for the given string target node.)r(   Úget_auth_namer*   r   r=   s     r   Ú	auth_nameÚSpatialReference.auth_nameŸ   ó4   € ä×!Ò!Ø�H‰H ¡�fó
ð 	
Ü4?ÀÓ4Gó
ð 	
r   c                 óh   • [         R                  " U R                  Uc  U5      $ [        U5      5      $ )z;Return the authority code for the given string target node.)r(   Úget_auth_coder*   r   r=   s     r   Ú	auth_codeÚSpatialReference.auth_code¥   rN   r   c                 óf   • [        [        R                  " U R                  5      U R                  S9$ )z/Return a clone of this SpatialReference object.)r'   )r   r(   Ú	clone_srsr*   r'   rC   s    r   ÚcloneÚSpatialReference.clone«   s    € ä¤§¢¨t¯x©xÓ 8ÀTÇ_Á_ÑUÐUr   c                 óD   • [         R                  " U R                  5        g)z7Morph this SpatialReference from ESRI's format to EPSG.N)r(   Úmorph_from_esrir*   rC   s    r   Ú	from_esriÚSpatialReference.from_esri¯   s   € ä×Ò˜TŸX™XÕ&r   c                 óD   • [         R                  " U R                  5        g)z‚
This method inspects the WKT of this SpatialReference, and will
add EPSG authority nodes where an EPSG identifier is applicable.
N)r(   Úidentify_epsgr*   rC   s    r   r\   ÚSpatialReference.identify_epsg³   s   € ô
 	×Ò˜4Ÿ8™8Õ$r   c                 óD   • [         R                  " U R                  5        g)z-Morph this SpatialReference to ESRI's format.N)r(   Úmorph_to_esrir*   rC   s    r   Úto_esriÚSpatialReference.to_esriº   s   € ä×Ò˜4Ÿ8™8Õ$r   c                 óD   • [         R                  " U R                  5        g)z5Check to see if the given spatial reference is valid.N)r(   Úsrs_validater*   rC   s    r   ÚvalidateÚSpatialReference.validate¾   s   € ä×Ò˜$Ÿ(™(Õ#r   c                 óÐ   • U R                   (       a  U R                  S5      $ U R                  (       a  U R                  S5      $ U R                  (       a  U R                  S5      $ g)z*Return the name of this Spatial Reference.ÚPROJCSÚGEOGCSÚLOCAL_CSN)Ú	projectedr<   Ú
geographicÚlocalrC   s    r   ÚnameÚSpatialReference.nameÃ   sI   € ð �>�>Ø—?‘? 8Ó,Ð,Ø�_�_Ø—?‘? 8Ó,Ð,Ø�Z�ZØ—?‘? :Ó.Ð.àr   c                 ó`   •  [        U R                  SS95      $ ! [        [        4 a     gf = f)z=Return the SRID of top-level authority, or None if undefined.N)r>   )r.   rQ   r0   r&   rC   s    r   r6   ÚSpatialReference.sridÏ   s4   € ð	Ü�t—~‘~¨T�~Ð2Ó3Ð3øÜœ:Ð&ó 	Ùð	ús   ‚ š-¬-c                 ón   • [         R                  " U R                  [        [	        5       5      5      u  pU$ )z$Return the name of the linear units.©r(   Úlinear_unitsr*   r   r   ©r3   Úunitsrm   s      r   Úlinear_nameÚSpatialReference.linear_nameØ   s(   € ô ×'Ò'¨¯©´%¼»
Ó2CÓD‰ˆØˆr   c                 ón   • [         R                  " U R                  [        [	        5       5      5      u  pU$ )z%Return the value of the linear units.rr   rt   s      r   rs   ÚSpatialReference.linear_unitsÞ   s(   € ô ×'Ò'¨¯©´%¼»
Ó2CÓD‰ˆØˆr   c                 ón   • [         R                  " U R                  [        [	        5       5      5      u  pU$ )z%Return the name of the angular units.©r(   Úangular_unitsr*   r   r   rt   s      r   Úangular_nameÚSpatialReference.angular_nameä   s(   € ô ×(Ò(¨¯©´5¼»Ó3DÓE‰ˆØˆr   c                 ón   • [         R                  " U R                  [        [	        5       5      5      u  pU$ )z&Return the value of the angular units.r{   rt   s      r   r|   ÚSpatialReference.angular_unitsê   s(   € ô ×(Ò(¨¯©´5¼»Ó3DÓE‰ˆØˆr   c                 ód  • Su  pU R                   (       d  U R                  (       a5  [        R                  " U R                  [        [        5       5      5      u  pOEU R                  (       a4  [        R                  " U R                  [        [        5       5      5      u  pUb  [        U5      nX4$ )z€
Return a 2-tuple of the units value and the units name. Automatically
determine whether to return the linear or angular units.
)NN)
rj   rl   r(   rs   r*   r   r   rk   r|   r   rt   s      r   ru   ÚSpatialReference.unitsð   sv   € ð !‰ˆØ�>�>˜TŸZŸZÜ×+Ò+¨D¯H©H´e¼H»JÓ6GÓH‰KˆE�4Ø�_�_Ü×,Ò,¨T¯X©X´u¼X»ZÓ7HÓI‰KˆEØÑÜ˜T“?ˆDØˆ}Ðr   c                 óH   • U R                   U R                  U R                  4$ )zg
Return a tuple of the ellipsoid parameters:
 (semimajor axis, semiminor axis, and inverse flattening)
)Ú
semi_majorÚ
semi_minorÚinverse_flatteningrC   s    r   Ú	ellipsoidÚSpatialReference.ellipsoid   s   € ð —‘ §¡°$×2IÑ2IÐJÐJr   c                 óf   • [         R                  " U R                  [        [	        5       5      5      $ )z6Return the Semi Major Axis for this Spatial Reference.)r(   r„   r*   r   r   rC   s    r   r„   ÚSpatialReference.semi_major  ó   € ô �Š˜tŸx™x¬¬u«w«Ó8Ð8r   c                 óf   • [         R                  " U R                  [        [	        5       5      5      $ )z6Return the Semi Minor Axis for this Spatial Reference.)r(   r…   r*   r   r   rC   s    r   r…   ÚSpatialReference.semi_minor  r‹   r   c                 óf   • [         R                  " U R                  [        [	        5       5      5      $ )z9Return the Inverse Flattening for this Spatial Reference.)r(   Úinvflatteningr*   r   r   rC   s    r   r†   Ú#SpatialReference.inverse_flattening  s!   € ô ×!Ò! $§(¡(¬E´%³'«NÓ;Ð;r   c                 óT   • [        [        R                  " U R                  5      5      $ )zL
Return True if this SpatialReference is geographic
 (root node is GEOGCS).
)Úboolr(   Úisgeographicr*   rC   s    r   rk   ÚSpatialReference.geographic  s   € ô ”D×%Ò% d§h¡hÓ/Ó0Ð0r   c                 óT   • [        [        R                  " U R                  5      5      $ )zFReturn True if this SpatialReference is local (root node is LOCAL_CS).)r’   r(   Úislocalr*   rC   s    r   rl   ÚSpatialReference.local   s   € ô ”D—L’L §¡Ó*Ó+Ð+r   c                 óT   • [        [        R                  " U R                  5      5      $ )z_
Return True if this SpatialReference is a projected coordinate system
 (root node is PROJCS).
)r’   r(   Úisprojectedr*   rC   s    r   rj   ÚSpatialReference.projected%  s   € ô ”D×$Ò$ T§X¡XÓ.Ó/Ð/r   c                 óF   • [         R                  " U R                  U5        g)z=Import the Spatial Reference from the EPSG code (an integer).N)r(   Ú	from_epsgr*   )r3   r!   s     r   r2   ÚSpatialReference.import_epsg.  ó   € ä�Š�t—x‘x Õ&r   c                 óF   • [         R                  " U R                  U5        g)z0Import the Spatial Reference from a PROJ string.N)r(   Ú	from_projr*   )r3   Úprojs     r   Úimport_projÚSpatialReference.import_proj2  rž   r   c                 óX   • [         R                  " U R                  [        U5      5        g)z>Import the Spatial Reference from the given user input string.N)r(   Úfrom_user_inputr*   r   )r3   Ú
user_inputs     r   r1   Ú"SpatialReference.import_user_input6  s   € ä×Ò˜TŸX™X¤{°:Ó'>Õ?r   c           
      ó|   • [         R                  " U R                  [        [	        [        U5      5      5      5        g)z2Import the Spatial Reference from OGC WKT (string)N)r(   Úfrom_wktr*   r   r   r   )r3   r   s     r   r+   ÚSpatialReference.import_wkt:  s#   € ä�Š�d—h‘h¤¤h¬{¸3Ó/?Ó&@Ó AÕBr   c                 óF   • [         R                  " U R                  U5        g)z0Import the Spatial Reference from an XML string.N)r(   Úfrom_xmlr*   )r3   Úxmls     r   Ú
import_xmlÚSpatialReference.import_xml>  s   € ä�Š�d—h‘h Õ$r   c                 óf   • [         R                  " U R                  [        [	        5       5      5      $ )z8Return the WKT representation of this Spatial Reference.)r(   Úto_wktr*   r   r   rC   s    r   r   ÚSpatialReference.wktC  s    € ô �{Š{˜4Ÿ8™8¤U¬8«:Ó%6Ó7Ð7r   c                 óh   • [         R                  " U R                  [        [	        5       5      U5      $ )z.Return the 'pretty' representation of the WKT.)r(   Úto_pretty_wktr*   r   r   )r3   Úsimplifys     r   rB   ÚSpatialReference.pretty_wktH  s$   € ô ×!Ò! $§(¡(¬E´(³*Ó,=¸xÓHÐHr   c                 óf   • [         R                  " U R                  [        [	        5       5      5      $ )z:Return the PROJ representation for this Spatial Reference.)r(   Úto_projr*   r   r   rC   s    r   r¡   ÚSpatialReference.projM  s    € ô �|Š|˜DŸH™H¤e¬H«JÓ&7Ó8Ð8r   c                 ó   • U R                   $ )zAlias for proj().)r¡   rC   s    r   Úproj4ÚSpatialReference.proj4R  s   € ð �y‰yÐr   c                 óz   • [         R                  " U R                  [        [	        5       5      [        U5      5      $ )z8Return the XML representation of this Spatial Reference.)r(   Úto_xmlr*   r   r   r   )r3   Údialects     r   r­   ÚSpatialReference.xmlW  s'   € ô �{Š{˜4Ÿ8™8¤U¬8«:Ó%6¼ÀGÓ8LÓMÐMr   )r'   r*   )Ú r#   N)r   )rÁ   )-r   r   r   r   Ú__doc__r(   Úrelease_srsÚ
destructorr8   r?   rD   r<   rL   rQ   rU   rY   r\   r`   rd   Úpropertyrm   r6   rv   rs   r}   r|   ru   r‡   r„   r…   r†   rk   rl   rj   r2   r¢   r1   r+   r®   r   rB   r¡   r»   r­   r   r   r   r   r   r   ,   së  † ñð ×!Ñ!€Jô=(ò~+ò:ô
Iò
ò
òVò'ò%ò%ò$ð
 ñ	ó ð	ð ñó ðð ñó ðð
 ñó ðð
 ñó ðð
 ñó ðð
 ñó ðð ñKó ðKð ñ9ó ð9ð ñ9ó ð9ð ñ<ó ð<ð
 ñ1ó ð1ð ñ,ó ð,ð ñ0ó ð0ò'ò'ò@òCò%ð
 ñ8ó ð8ð óIó ðIð ñ9ó ð9ð ñó ðð óNó óNr   r   c                   ó<   • \ rS rSrSr\R                  rS rS r	Sr
g)ÚCoordTransformi]  z,The coordinate system transformation object.c                 ó  • [        U[        5      (       a  [        U[        5      (       d  [        S5      e[        R                  " UR
                  UR
                  5      U l        UR                  U l        UR                  U l	        g)z;Initialize on a source and target SpatialReference objects.z2source and target must be of type SpatialReferenceN)
r$   r   r0   r(   Únew_ctÚ_ptrr*   rm   Ú
_srs1_nameÚ
_srs2_name)r3   Úsourcer>   s      r   r8   ÚCoordTransform.__init__a  s`   € ä˜&Ô"2×3Ñ3¼:ØÔ$÷<
ñ <
ô ÐPÓQÐQÜ—;’;˜vŸ{™{¨F¯K©KÓ8ˆŒØ Ÿ+™+ˆŒØ Ÿ+™+ˆ�r   c                 ó@   • SU R                   < SU R                  < S3$ )NzTransform from "z" to "Ú")rË   rÌ   rC   s    r   rD   ÚCoordTransform.__str__k  s   � Ø04·´ÀÇÄÐQÐQr   )rË   rÌ   r*   N)r   r   r   r   rÂ   r(   Ú
destroy_ctrÄ   r8   rD   r   r   r   r   rÇ   rÇ   ]  s   † Ù2Ø—‘€Jò&õRr   rÇ   N)rÂ   Úctypesr   r   r   Úenumr   Údjango.contrib.gis.gdal.baser   Údjango.contrib.gis.gdal.errorr   Údjango.contrib.gis.gdal.libgdalr	   Ú"django.contrib.gis.gdal.prototypesr
   r(   Údjango.utils.encodingr   r   r   r   rÇ   r   r   r   Ú<module>rÚ      sO   ðñ÷8 *Ñ )Ý å 1Ý 6Ý 8Ý :ß 8ô�ô ô
nN�xô nNôb	R�Xõ Rr   