OwlCyberSecurity - MANAGER
Edit File: geometry.cpython-39.pyc
a ���e2g � @ s d Z ddlZddlmZmZmZ ddlmZ ddlm Z m Z mZ ddlm Z ddlmZ ddlmZ dd lmZ dd lmZmZ ddlmZ ddlmZ dd lmZmZmZm Z m!Z! ddl"m#Z# ddl$m%Z%m&Z& G dd� de�Z'G dd� d�Z(e#G dd� de'e��Z)dS )zh This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. � N)� addressof�byref�c_double)�gdal)� hex_regex� json_regex� wkt_regex)� prototypes)�GEOSBase)�GEOSCoordSeq)� GEOSException)�GEOM_PTR�geos_version_tuple)� ListMixin��PreparedGeometry)�ewkb_w�wkb_r�wkb_w�wkt_r�wkt_w)�deconstructible)�force_bytes� force_strc @ s` e Zd ZdZeZejZdZ dd� Z dd� Zdd� Zd d � Z dd� Zd d� Zdd� Zdd� Zdd� Zdd� Zedd� �Zedd� �Zedd� �Zedd� �Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Ze d+d,� �Z!e d-d.� �Z"e d/d0� �Z#e d1d2� �Z$e d3d4� �Z%e d5d6� �Z&e d7d8� �Z'd�d9d:�Z(d;d<� Z)e d=d>� �Z*e d?d@� �Z+e dAdB� �Z,e dCdD� �Z-e dEdF� �Z.e dGdH� �Z/dIdJ� Z0dKdL� Z1dMdN� Z2dOdP� Z3dQdR� Z4d�dTdU�Z5dVdW� Z6dXdY� Z7dZd[� Z8d\d]� Z9d^d_� Z:e d`da� �Z;e;j<dbda� �Z;e dcdd� �Z=e dedf� �Z>e dgdh� �Z?e didj� �Z@e dkdl� �ZAeAZBe dmdn� �ZCe dodp� �ZDe dqdr� �ZEe dsdt� �ZFdudv� ZGe dwdx� �ZHe dydz� �ZIe d{d|� �ZJd�d}d~�ZKdd�� ZLe d�d�� �ZMd�d�d��ZNd�d�d��ZOe d�d�� �ZPe d�d�� �ZQd�d�� ZRe d�d�� �ZSd�d�� ZTe d�d�� �ZUd�d�� ZVd�d�d��ZWd�d�� ZXe d�d�� �ZYd�d�� ZZe d�d�� �Z[d�d�� Z\e d�d�� �Z]e d�d�� �Z^d�d�� Z_dS )��GEOSGeometryBaseNFc C s� || _ t| �ttfv r�|d u r�tjd u r�ddlm}m}m}m } ddl m}m} ddl m} ddlm} | ||| ||||d�t_tj| j }|| _| �� d S )N� )�GeometryCollection�MultiLineString� MultiPoint�MultiPolygon)� LinearRing� LineString��Point)�Polygon)r r � � � � � � )Z_ptr�typer �GEOSGeometry� _GEOS_CLASSES�collectionsr r r r Z linestringr r! �pointr# Zpolygonr$ �geom_typeid� __class__� _post_init)�self�ptr�clsr r r r r r! r# r$ � r6 �a/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/contrib/gis/geos/geometry.py�__init__ s( � zGEOSGeometryBase.__init__c C s$ | j rtt�| j�| j�nd| _dS )z"Perform post-initialization setup.N)�has_csr �capiZget_csr4 �hasz�_cs�r3 r6 r6 r7 r2 = s �zGEOSGeometryBase._post_initc C s | � � S )z� Return a clone because the copy of a GEOSGeometry may contain an invalid pointer location if the original is garbage collected. ��cloner= r6 r6 r7 �__copy__E s zGEOSGeometryBase.__copy__c C s | � � S )z� The `deepcopy` routine is used by the `Node` class of django.utils.tree; thus, the protocol routine needs to be implemented to return correct copies (clones) of these GEOS objects, which use C pointers. r>