
    Mi                    >   S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSK	J
r
  SSKJr  \" \5      R                  r\" \R                   5      r/ rS\R&                  ;   a$  \R)                  \" \R&                  S   5      5        \\S-  \\" S5      /-  rSS	 jrSS
 jrg)z;
Locate `libspatialindex` shared library and header files.
    )annotationsN)find_library)PathSPATIALINDEX_C_LIBRARYlib c                    [         R                  S:X  Gak  S[        R                  " 5       S   ;   a  Sn OSn SU  S3n[        S-  R                  5       (       d  S[        R                  ;   a  [        R                  [        S	-  S
-  5        [         R                  R                  SS5      R                  5       R                  S5      n[         H  nUR                  5       (       d  M  SR                  [        U5      U/5      [         R                  S'    [         R"                  R%                  [        X1-  5      5      nUb  UU[         R                  S'   s  $  U[         R                  S'   M     ['        SU 35      e[         R                  S:X  Ga]  [        R.                  " 5       S:X  a  SnOSn [0        R2                  R5                  S5      nUb  U H  nUR6                  R                  S:X  d  M  UR8                  R;                  S5      (       d  MA  SUR<                  ;   d  MS  [        R?                  S[A        URC                  5       5      5          O   [         H  nURG                  5       (       a  UnX-  n	O&URI                  5       (       a  UR6                  nUn	OME  U	R                  5       (       d  M\   [         R"                  R%                  [        U	5      5      nUb  Us  $ M      [K        S5      n
U
b  [         R"                  R%                  U
5      $  ['        S5      e! [&         a     GN[(         a'  n[+        SU< 3[        R,                  S9   SnAGN	SnAff = f! U[         R                  S'   f = f! [0        R2                  RD                   a     GNIf = f! [(         a+  n[+        SU	 SU< 3[        R,                  S9   SnAGMw  SnAff = f! [(         a     Nf = f)zLLoad the `libspatialindex` shared library.

:returns: Loaded shared library
nt64r   32zspatialindex_c-z.dllz
conda-metacondaLibrarybinPATHr   ;Nzrtree.finder unexpected error: )filezcould not find or load posixDarwinzlibspatialindex_c.dylibzlibspatialindex_c.sortreez
rtree.libslibspatialindexz.so   zrtree.finder (z) unexpected error: spatialindex_cz(Could not load libspatialindex_c library)&osnameplatformarchitecture_sys_prefixexistssysversion_candidatesappendenvirongetstriprstripjoinstrctypescdllLoadLibraryOSErrorBaseExceptionprintstderrsystem	importlibmetadatafilesparentstem
startswithsuffixesinsertr   locatePackageNotFoundErroris_diris_filer   )archlib_nameoldenvpathrterr	pkg_filesr   candtargetpths              f/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/rtree/finder.pyloadrH      sL   
 
ww$8((*1--DD$TF$/ ,&..00Gs{{4J{Y6>? +113::3?D;;== "%3t9f*=!>BJJv	,[[,,S-AB> &,

6" " &,

6"    /z:;;	G	 ??(0H .H%..44W=	( ) KK,,< $		 4 45F G G % 6'..q$t{{}2EF! !*  D{{}}{{==?? [[,,S[9>I ")  8+,?;;**3//  <
==M    R7w?cjjQQR &,

6"2 %%:: 2 ! $VH,@H   s   .L-M-5?N 8N N ,.N N  ,N*4,O" -
M*7M-:	M*M%M-%M**M--NN'&N'*
O4OO"
O/.O/c                 `    [         R                  R                  S5      n U bQ  U  HK  nUR                  S:X  d  M  [	        [        UR                  5       5      R                  R                  5      s  $    [        S5      n[        R                  S:X  a  [        S-  U-  nO	[        U-  nUR                  5       (       a  [	        UR                  R                  5      $ [        [        5       R                  5      R                  nUR                  U-  nUR                  5       (       a  [	        UR                  R                  5      $ [        S5      U-  nUR                  5       (       a  [	        UR                  R                  5      $ g! [         R                  R                   a     GN7f = f)zyReturn the directory that contains the spatialindex \*.h files.

:returns: Path to include directory or "" if not found.
r   zSpatialIndex.hz#include/spatialindex/SpatialIndex.hr
   r   z/usrr   )r1   r2   r3   r   r(   r   r9   r4   r:   r   r   r<   rH   _name)rC   r@   path_to_spatialindex_hr   libdirs        rG   get_includerM      sO   &&,,W5	 !99 00tDKKM299@@AA " ""GH 
ww$Y&)??33||~~4;;%%&& $&,,&&F==11D||~~4;;%%&& <00D||~~4;;%%&& 5 22 s   5F 7F 3F F-,F-)returnzctypes.CDLL)rN   r(   )__doc__
__future__r   r)   importlib.metadatar1   r   r   r   ctypes.utilr   pathlibr   __file__r4   _cwdprefixr   r!   r#   r"   rH   rM        rG   <module>rY      s    #   	  
 $ H~3:: rzz)tBJJ'?@AB udDH- -d>N&rX   