| 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 : /usr/lib/python3/dist-packages/django/contrib/gis/geos/__pycache__/ |
Upload File : |
�
�|�e@ � �~ � d Z ddlmZmZmZmZ ddlmZ ddl m
Z
ddlmZ ddl
mZmZ ddlmZ G d� d e
� � Zd
S )z�
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
� )�byref�c_byte�c_double�c_uint)�
prototypes)�GEOSBase��
GEOSException)�CS_PTR�geos_version_tuple)�numpyc �T � e Zd ZdZeZd&d�Zd� Zd� Zd� Z d� Z
d� Zd � Zd
� Z
d� Zd� Zd
� Zd� Zd� Zd� Zed� � � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!ed� � � Z"ed� � � Z#ed � � � Z$d!� Z%ed"� � � Z&ed#� � � Z'ed$� � � Z(d%S )'�GEOSCoordSeqzGThe internal representation of a list of coordinates inside a Geometry.Fc �j � t |t � � st d� � �|| _ || _ dS )zInitialize from a GEOS pointer.z4Coordinate sequence should initialize with a CS_PTR.N)�
isinstancer � TypeError�_ptr�_z)�self�ptr�zs �B/usr/lib/python3/dist-packages/django/contrib/gis/geos/coordseq.py�__init__zGEOSCoordSeq.__init__ s6 � ��#�v�&�&� T��R�S�S�S��� ������ c # �L K � t | j � � D ]}| | V � �
dS )z3Iterate over each point in the coordinate sequence.N)�range�size)r �is r �__iter__zGEOSCoordSeq.__iter__ s8 � � � ��t�y�!�!� � �A��q�'�M�M�M�M� � r c � � | j S )z7Return the number of points in the coordinate sequence.)r �r s r �__len__zGEOSCoordSeq.__len__ s
� ��y�r c �* � t | j � � S )z<Return the string representation of the coordinate sequence.)�str�tupler! s r �__str__zGEOSCoordSeq.__str__$ s � ��4�:���r c �V � | � |� � | � |� � S )z8Return the coordinate sequence value at the given index.)�_checkindex�
_point_getter�r �indexs r �__getitem__zGEOSCoordSeq.__getitem__( s* � ���������!�!�%�(�(�(r c �r � t |t t f� � rn1t rt |t j � � rnt d� � �| j dk r| j r
d}| j }n d}| j }t |� � |k rt d� � �| � |� � |||� � dS )z5Set the coordinate sequence value at the given index.zBMust set coordinate with a sequence (list, tuple, or numpy array).� � z"Dimension of value does not match.N)r �listr% r
�ndarrayr �dimsr �
_set_point_3d�
_set_point_2d�lenr( )r r+ �value�n_args�point_setters r �__setitem__zGEOSCoordSeq.__setitem__- s� � � �e�d�E�]�+�+� b��
� b�z�%���7�7� b���`�a�a�a��9��>�>�d�g�>��F��-�L�L��F��-�L��u�:�:�����@�A�A�A����������U�E�"�"�"�"�"r c �R � d|cxk r| j k sn t d|z � � �dS )zCheck the given index.r zinvalid GEOS Geometry index: %sN)r �
IndexErrorr* s r r( zGEOSCoordSeq._checkindexC s? � ��U�&�&�&�&�T�Y�&�&�&�&��>��F�G�G�G� '�&r c �B � |dk s|dk rt d|z � � �dS )zCheck the given dimension.r r/ zinvalid ordinate dimension "%d"Nr )r �dims r � _checkdimzGEOSCoordSeq._checkdimH s. � ���7�7�c�A�g�g�� A�C� G�H�H�H� �gr c �j � t j | j |t t � � � � � � S �N)�capi�cs_getxr r r r* s r �_get_xzGEOSCoordSeq._get_xM �$ � ��|�D�H�e�U�8�:�:�->�->�?�?�?r c �j � t j | j |t t � � � � � � S r@ )rA �cs_getyr r r r* s r �_get_yzGEOSCoordSeq._get_yP rD r c �j � t j | j |t t � � � � � � S r@ )rA �cs_getzr r r r* s r �_get_zzGEOSCoordSeq._get_zS rD r c �<