403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/contrib/gis/gdal/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/contrib/gis/gdal/__pycache__/srs.cpython-311.pyc
�

�|�eC1���dZddlmZmZmZddlmZddlmZddl	m
Z
ddlmZddl
mZddlmZmZGd	�d
e��ZGd�de��ZGd
�de��ZdS)ah
  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��eZdZdZdZdS)�	AxisOrderr�N)�__name__�
__module__�__qualname__�TRADITIONAL�	AUTHORITY���=/usr/lib/python3/dist-packages/django/contrib/gis/gdal/srs.pyrr's�������K��I�I�Irrc�*�eZdZdZejZd)d�Zd�Zd�Z	d*d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%ed$���Z&ed*d%���Z'ed&���Z(ed'���Z)ed+d(���Z*dS),�SpatialReferencez�
    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."
    ��userNc���t|td��tf��std���|ptj|_|dkr�t
jtd����|_	|�
|��|jtjkr+tdkr t
j|j	|j��n7|jtjkr"tdkrtd|jz���dSt|t��r&	t|��}d|z}nT#t$rYnHwxYwt|t��rd}n,t||j��r|}d	}nt!d
|z���|d	kr|}n#td��}t
j|��}|st#d|z���||_	|jtjkr+tdkr t
j|j	|j��n7|jtjkr"tdkrtd|jz���|dkr|�|��dS|dkr|�|��dSdS)
a$
        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)�rz"%s is not supported in GDAL < 3.0.zEPSG:%d�epsg�ogrzInvalid SRS type "%s"z+Could not create spatial reference from: %sr)�
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__zSpatialReference.__init__4s����*�t�D�z�z�9�&=�>�>�	��L���
�%�=�	�(=����u����|�H�S�M�M�2�2�D�H��O�O�I�&�&�&���)�"7�7�7�L�F�<R�<R��&�t�x���A�A�A�A���I�$9�9�9�l�V�>S�>S� �!E���!W�X�X�X��F�
�	�3�
'�
'�	@�
��9�~�~��%��,�	�	���
�
�
���
����
�	�3�
'�
'�	@��H�H�
�	�4�=�
1�
1�	@��C��H�H��3�h�>�?�?�?��u����C�C��3�-�-�C��,�s�#�#�C��	��L�y�X�Y�Y�Y��D�H��?�i�3�3�3���8N�8N��"�4�8�T�_�=�=�=�=�
�_�	� 5�
5�
5�,��:O�:O��A�D�O�S�T�T�T��v����"�"�9�-�-�-�-�-�
��
�
����Y�'�'�'�'�'� �
s�D,�,
D9�8D9c�j�t|t��r
|j|�S|�|��S)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
        >>> print(srs['UNIT|AUTHORITY']) # For the units authority, have to use the pipe symbole.
        EPSG
        >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the units
        9122
        )r!�tuple�
attr_value�r0�targets  r�__getitem__zSpatialReference.__getitem__qs7��.�f�e�$�$�	+�"�4�?�F�+�+��?�?�6�*�*�*rc��|jS)zUse 'pretty' WKT.)�
pretty_wkt�r0s r�__str__zSpatialReference.__str__�s
����rrc��t|t��rt|t��st�t	j|jt|��|��S)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+r-r%�get_attr_valuer'r)r0r:�indexs   rr8zSpatialReference.attr_value�sK��
�&�#�&�&�	�j���.D�.D�	��O��"�4�8�[��-@�-@�%�H�H�Hrc�P�tj|jt|����S)z;Return the authority name for the given string target node.)r%�
get_auth_namer'rr9s  r�	auth_namezSpatialReference.auth_name�����!�$�(�K��,?�,?�@�@�@rc�P�tj|jt|����S)z;Return the authority code for the given string target node.)r%�
get_auth_coder'rr9s  r�	auth_codezSpatialReference.auth_code�rFrc�\�ttj|j��|j���S)z/Return a clone of this SpatialReference object.)r$)rr%�	clone_srsr'r$r>s r�clonezSpatialReference.clone�s#�����t�x� 8� 8�T�_�U�U�U�Urc�8�tj|j��dS)z7Morph this SpatialReference from ESRI's format to EPSG.N)r%�morph_from_esrir'r>s r�	from_esrizSpatialReference.from_esri�s����T�X�&�&�&�&�&rc�8�tj|j��dS)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'r>s rrQzSpatialReference.identify_epsg�s��
	
��4�8�$�$�$�$�$rc�8�tj|j��dS)z-Morph this SpatialReference to ESRI's format.N)r%�
morph_to_esrir'r>s r�to_esrizSpatialReference.to_esri�s����4�8�$�$�$�$�$rc�8�tj|j��dS)z5Check to see if the given spatial reference is valid.N)r%�srs_validater'r>s r�validatezSpatialReference.validate�s����$�(�#�#�#�#�#rc��|jr|�d��S|jr|�d��S|jr|�d��SdS)z*Return the name of this Spatial Reference.�PROJCS�GEOGCS�LOCAL_CSN)�	projectedr8�
geographic�localr>s r�namezSpatialReference.name�s]���>�	��?�?�8�,�,�,�
�_�	��?�?�8�,�,�,�
�Z�	��?�?�:�.�.�.��4rc�z�	t|�dd����S#ttf$rYdSwxYw)z=Return the SRID of top-level authority, or None if undefined.rrN)r+r8r-r#r>s rr3zSpatialReference.srid�sJ��	��t���{�A�6�6�7�7�7���:�&�	�	�	��4�4�	���s�"%�:�:c�r�tj|jtt	������\}}|S)z$Return the name of the linear units.�r%�linear_unitsr'rr�r0�unitsr_s   r�linear_namezSpatialReference.linear_name�s-���'���%��
�
�2C�2C�D�D���t��rc�r�tj|jtt	������\}}|S)z%Return the value of the linear units.rbrds   rrczSpatialReference.linear_units�s-���'���%��
�
�2C�2C�D�D���t��rc�r�tj|jtt	������\}}|S)z%Return the name of the angular units.�r%�
angular_unitsr'rrrds   r�angular_namezSpatialReference.angular_name�s-���(���5����3D�3D�E�E���t��rc�r�tj|jtt	������\}}|S)z&Return the value of the angular units.rirds   rrjzSpatialReference.angular_units�s-���(���5����3D�3D�E�E���t��rc�:�d\}}|js|jr7tj|jtt
������\}}n=|jr6tj|jtt
������\}}|�t|��}||fS)z�
        Return a 2-tuple of the units value and the units name. Automatically
        determine whether to return the linear or angular units.
        )NN)
r\r^r%rcr'rrr]rjrrds   rrezSpatialReference.units�s���!���t��>�	J�T�Z�	J��+�D�H�e�H�J�J�6G�6G�H�H�K�E�4�4�
�_�	J��,�T�X�u�X�Z�Z�7H�7H�I�I�K�E�4����T�?�?�D��t�}�rc�*�|j|j|jfS)z
        Return a tuple of the ellipsoid parameters:
         (semimajor axis, semiminor axis, and inverse flattening)
        )�
semi_major�
semi_minor�inverse_flatteningr>s r�	ellipsoidzSpatialReference.ellipsoid�s������$�2I�J�Jrc�h�tj|jtt	������S)z6Return the Semi Major Axis for this Spatial Reference.)r%ror'rrr>s rrozSpatialReference.semi_major�"����t�x��u�w�w���8�8�8rc�h�tj|jtt	������S)z6Return the Semi Minor Axis for this Spatial Reference.)r%rpr'rrr>s rrpzSpatialReference.semi_minorrtrc�h�tj|jtt	������S)z9Return the Inverse Flattening for this Spatial Reference.)r%�
invflatteningr'rrr>s rrqz#SpatialReference.inverse_flattening
s#���!�$�(�E�%�'�'�N�N�;�;�;rc�N�ttj|j����S)zd
        Return True if this SpatialReference is geographic
         (root node is GEOGCS).
        )�boolr%�isgeographicr'r>s rr]zSpatialReference.geographics���D�%�d�h�/�/�0�0�0rc�N�ttj|j����S)zFReturn True if this SpatialReference is local (root node is LOCAL_CS).)ryr%�islocalr'r>s rr^zSpatialReference.locals���D�L���*�*�+�+�+rc�N�ttj|j����S)zw
        Return True if this SpatialReference is a projected coordinate system
         (root node is PROJCS).
        )ryr%�isprojectedr'r>s rr\zSpatialReference.projecteds���D�$�T�X�.�.�/�/�/rc�:�tj|j|��dS)z=Import the Spatial Reference from the EPSG code (an integer).N)r%�	from_epsgr')r0rs  rr/zSpatialReference.import_epsg&�����t�x��&�&�&�&�&rc�:�tj|j|��dS)z0Import the Spatial Reference from a PROJ string.N)r%�	from_projr')r0�projs  r�import_projzSpatialReference.import_proj*r�rc�T�tj|jt|����dS)z>Import the Spatial Reference from the given user input string.N)r%�from_user_inputr'r)r0�
user_inputs  rr.z"SpatialReference.import_user_input.s%����T�X�{�:�'>�'>�?�?�?�?�?rc
��tj|jtt	t|��������dS)z2Import the Spatial Reference from OGC WKT (string)N)r%�from_wktr'rrr)r0rs  rr(zSpatialReference.import_wkt2s4���
�d�h��h�{�3�/?�/?�&@�&@� A� A�B�B�B�B�Brc�:�tj|j|��dS)z0Import the Spatial Reference from an XML string.N)r%�from_xmlr')r0�xmls  r�
import_xmlzSpatialReference.import_xml6s���
�d�h��$�$�$�$�$rc�h�tj|jtt	������S)z8Return the WKT representation of this Spatial Reference.)r%�to_wktr'rrr>s rrzSpatialReference.wkt;s$���{�4�8�U�8�:�:�%6�%6�7�7�7rc�j�tj|jtt	����|��S)z.Return the 'pretty' representation of the WKT.)r%�
to_pretty_wktr'rr)r0�simplifys  rr=zSpatialReference.pretty_wkt@s'���!�$�(�E�(�*�*�,=�,=�x�H�H�Hrc�h�tj|jtt	������S)z:Return the PROJ representation for this Spatial Reference.)r%�to_projr'rrr>s rr�zSpatialReference.projEs$���|�D�H�e�H�J�J�&7�&7�8�8�8rc��|jS)zAlias for proj().)r�r>s r�proj4zSpatialReference.proj4Js���y�rc��tj|jtt	����t|����S)z8Return the XML representation of this Spatial Reference.)r%�to_xmlr'rrr)r0�dialects  rr�zSpatialReference.xmlOs.���{�4�8�U�8�:�:�%6�%6��G�8L�8L�M�M�Mr)rrN)r)r)+rrr�__doc__r%�release_srs�
destructorr5r;r?r8rErIrLrOrQrTrW�propertyr_r3rfrcrkrjrerrrorprqr]r^r\r/r�r.r(r�rr=r�r�r�rrrrr,sN��������
�!�J�;(�;(�;(�;(�z+�+�+�8���
I�I�I�I�A�A�A�A�A�A�V�V�V�'�'�'�%�%�%�%�%�%�$�$�$�
�	�	��X�	�����X������X��
����X��
����X��
����X��
����X���K�K��X�K��9�9��X�9��9�9��X�9��<�<��X�<�
�1�1��X�1��,�,��X�,��0�0��X�0�'�'�'�'�'�'�@�@�@�C�C�C�%�%�%�
�8�8��X�8��I�I�I��X�I��9�9��X�9�����X���N�N�N��X�N�N�Nrrc�,�eZdZdZejZd�Zd�ZdS)�CoordTransformz,The coordinate system transformation object.c���t|t��rt|t��std���tj|j|j��|_|j|_|j|_	dS)z;Initialize on a source and target SpatialReference objects.z2source and target must be of type SpatialReferenceN)
r!rr-r%�new_ct�_ptrr'r_�
_srs1_name�
_srs2_name)r0�sourcer:s   rr5zCoordTransform.__init__Yse���&�"2�3�3�	R�:�f�N^�;_�;_�	R��P�Q�Q�Q��;�v�{�F�K�8�8��� �+��� �+����rc�(�d|j�d|j�d�S)NzTransform from "z" to "�")r�r�r>s rr?zCoordTransform.__str__as���04��������Q�QrN)	rrrr�r%�
destroy_ctr�r5r?rrrr�r�UsD������2�2���J�&�&�&�R�R�R�R�Rrr�N)r��ctypesrrr�enumr�django.contrib.gis.gdal.baser�django.contrib.gis.gdal.errorr�django.contrib.gis.gdal.libgdalr	�"django.contrib.gis.gdal.prototypesr
r%�django.utils.encodingrrrrr�rrr�<module>r�sD����8*�)�)�)�)�)�)�)�)�)�������1�1�1�1�1�1�6�6�6�6�6�6�8�8�8�8�8�8�:�:�:�:�:�:�8�8�8�8�8�8�8�8����������
fN�fN�fN�fN�fN�x�fN�fN�fN�R	
R�
R�
R�
R�
R�X�
R�
R�
R�
R�
Rr

Youez - 2016 - github.com/yon3zu
LinuXploit