File: //lib/python3/dist-packages/django/contrib/gis/geos/__pycache__/libgeos.cpython-310.pyc
o
�a� � @ s8 d Z ddlZddlZddlmZmZmZmZmZ ddl m
Z
ddlmZ ddl
mZmZ ddlmZ e�d�Zd d
� Zedee�Zdd� Zee�Zedee�Zd
d� Zee�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zee�Zee�Zee�Zee�Z ee�Z!G dd� d�Z"dd� Z#dd� Z$dS )a
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
� N)�CDLL� CFUNCTYPE�POINTER� Structure�c_char_p)�find_library)�ImproperlyConfigured)�SimpleLazyObject�cached_property)�get_version_tuplezdjango.contrib.gisc C s� zddl m} | j}W n ttttfy d }Y nw |r d }ntjdkr*ddg}ntjdkr4ddg}ntdtj ��|rL|D ]}t |�}|d urK nq?|d u rYtd d
�
|� ��t|�}t|j
_tg|j_t|j_|S )Nr )�settings�nt�geos_czlibgeos_c-1�posix�GEOSzUnsupported OS "%s"z]Could not find the GEOS library (tried "%s"). Try setting GEOS_LIBRARY_PATH in your settings.z", ")�django.confr �GEOS_LIBRARY_PATH�AttributeError�ImportErrorr �OSError�os�namer �joinr �CONTEXT_PTR�
initGEOS_r�restype�finishGEOS_r�argtypesr �GEOSversion)r �lib_path� lib_names�lib_name�_lgeos� r# �A/usr/lib/python3/dist-packages/django/contrib/gis/geos/libgeos.py� load_geos s<