a
    1$e{                     @   sL  d dl Z d dlmZ d dlZd dlZd dlZd dlZd dlZ	d dl
Z
d dlZ
ee	jedkZee	jedkZee	jedkZee	jedkZee
jedkZee
jedkZee
jed	kZe
jjd
kZdZdadadadZdZdZzfd dlZeejedkr:dZeejedkZeejedkZnejd eje!dd dZW n e"yp   dZY n0 d ddZ#e#  zd dl$m%Z& W n e"y   dZ&Y n0 e&durese j'dd Z(n8eejedkrese j'dd Z(ne j'dd Z(d!e)e)dddZ*dZ+dZ,zd dl-Z-dZ+W n e"yF   dZ+Y n0 dS )"    N)Versionz1.4.0rc0z1.5.0z2.0.0z2.1.0z1.8.2z
2.0.0.dev0z2.0a1)   	   r   zjTo use PyGEOS within GeoPandas, you need to install PyGEOS: 'conda install pygeos' or 'pip install pygeos'0.8Tz0.9z0.10zqThe installed version of PyGEOS is too old ({0} installed, 0.8 required), and thus GeoPandas will not use PyGEOS.   
stacklevelFc                 C   s  t dd}| durt| an*tdu rHtr0danta|durHtt|atrzddl}t|j	tdkstrdat
jddd ntd	|j	dd
lm} ddlm} ||st
jd||dd dandaW n ty   ttY n0 trt
jdtdd t otadS )aZ  
    Set the global configuration on whether to use PyGEOS or not.

    The default is use PyGEOS if it is installed. This can be overridden
    with an environment variable USE_PYGEOS (this is only checked at
    first import, cannot be changed during interactive session).

    Alternatively, pass a value here to force a True/False value.
    
USE_PYGEOSNFr   r   zkThe PyGEOS version is too old, and Shapely >= 2 is installed, thus using Shapely by default and not PyGEOS.r   r   z3PyGEOS >= 0.8 is required, version {0} is installed)geos_version_string)geos_capi_version_stringzThe Shapely GEOS version ({}) is incompatible with the GEOS version PyGEOS was compiled with ({}). Conversions between both will be slow.TzGeoPandas is set to use PyGEOS over Shapely. PyGEOS support is deprecatedand will be removed in GeoPandas 1.0, released in the Q1 of 2024. Please migrate to Shapely 2.0 (https://geopandas.org/en/stable/docs/user_guide/pygeos_to_shapely.html).   )osgetenvboolr	   SHAPELY_GE_20
HAS_PYGEOSintpygeosr   __version__warningswarnImportErrorformatshapely.geosr
   r   
startswithPYGEOS_SHAPELY_COMPATINSTALL_PYGEOS_ERRORDeprecationWarningUSE_SHAPELY_20)valZenv_use_pygeosr   Zshapely_geos_versionr    r    M/var/www/html/django/DPS/env/lib/python3.9/site-packages/geopandas/_compat.pyset_use_pygeosB   sX    
	
	r"   )ShapelyDeprecationWarningc                   c   s@   t  $ t ddt d V  W d    n1 s20    Y  d S )Nignorez%Iteration|The array interface|__len__)r   catch_warningsfilterwarningsshapely_warningr    r    r    r!   ignore_shapely2_warnings   s
    
r(   z1.21c                   c   s@   t  $ t ddt d V  W d    n1 s20    Y  d S )Nr$   z'An exception was ignored while fetching)r   r%   r&   r   r    r    r    r!   r(      s
    
c                   c   s
   d V  d S )Nr    r    r    r    r!   r(      s     nameextrac                 C   sX   dj | |d}t| ts(tdj | dzt| }W n tyR   t|dY n0 |S )ai  
    Import an optional dependency.

    Adapted from pandas.compat._optional::import_optional_dependency

    Raises a formatted ImportError if the module is not present.

    Parameters
    ----------
    name : str
        The module name.
    extra : str
        Additional text to include in the ImportError message.
    Returns
    -------
    module
    z]Missing optional dependency '{name}'. {extra}  "
        "Use pip or conda to install {name}.r*   z/Invalid module name: '{name}'; must be a string)r+   N)r   
isinstancestr
ValueError	importlibimport_moduler   )r+   r,   msgmoduler    r    r!   import_optional_dependency   s    

r4   )N)r)   ).
contextlibZpackaging.versionr   r0   r   r   numpynpZpandaspdZshapelyr   r   ZPANDAS_GE_14ZPANDAS_GE_15ZPANDAS_GE_20ZPANDAS_GE_21ZSHAPELY_GE_182r   ZSHAPELY_G_20a1ZgeosZgeos_versionZGEOS_GE_390r   r	   r   r   ZPYGEOS_GE_09ZPYGEOS_GE_010r   r   r   r   UserWarningr   r"   Zshapely.errorsr#   r'   contextmanagerr(   r.   r4   Z	HAS_RTREEZRTREE_GE_094Zrtreer    r    r    r!   <module>   sz   

V


)