ó
    ˆ*£h¡p ã                  óÔ  • 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rS SKJ	r	J
r
  S SKJrJrJr  SSKJr  SSKJr  S rSrSrS rSrSrS rSrSr\R8                  R;                  5       rS	 \R?                  S
5      RA                  S5       5       u  r!r"r#\!\"\#4S:  a  \$" S5      e/ SQr%S r&S r' " S S5      r(\(r) " S S5      r* " S S\$5      r+ " S S5      r, " S S\,5      r- " S S\-5      r.  " S S\-5      r/ " S S \,5      r1 " S! S"5      r2\Rf                  r4 " S# S$\Rj                  5      r6 " S% S&5      r7 " S' S(\75      r8 " S) S*\75      r9 " S+ S,\)5      r:g! \0 a     Njf = f)-é    )ÚannotationsN)ÚIteratorÚSequence)ÚAnyÚLiteralÚoverloadé   )Úcore)Ú
RTreeErroré   c              #  ó8   #   • U  H  n[        U5      v •  M     g 7f©N)Úint)Ú.0Úts     ÚH/home/mande/repo/quber/.venv/lib/python3.13/site-packages/rtree/index.pyÚ	<genexpr>r      s   é € ð /Ú@ˆq„Cˆ‡F€FÒ@ùs   ‚úutf-8Ú.)r	   é   é   z/Rtree requires libspatialindex 1.8.5 or greater)ÚRtreeÚIndexÚPropertyc                óò  • [         R                  " [         R                  " 5       5      n[         R                  " [         R                  " 5       5      n[         R                  " S5      nU" U [         R                  " U5      [         R                  " U5      [         R                  " U5      5        UR
                  S:X  a  g [         R                  " U[         R                  " [         R                  UR
                  -  5      5      n[         R                  " U[         R                  " [         R                  UR
                  -  5      5      n[        UR
                  5       Vs/ s H  o†R                  U   PM     n	nU	[        UR
                  5       Vs/ s H  o‡R                  U   PM     sn-  n	[         R                  " U[         R                  " [         R                  5      5      n
[         R                  " U[         R                  " [         R                  5      5      n[        R                  R                  [         R                  " U
[         R                  " [         R                  5      5      5        [        R                  R                  [         R                  " U[         R                  " [         R                  5      5      5        U(       a  U	$ [        R                  U	5      $ s  snf s  snf ©Nr   )ÚctypesÚpointerÚc_doubleÚc_uint32ÚbyrefÚvalueÚcastÚPOINTERÚrangeÚcontentsr
   ÚrtÚ
Index_FreeÚc_void_pr   Údeinterleave)ÚhandleÚ	bounds_fnÚinterleavedÚpp_minsÚpp_maxsÚ	dimensionÚminsÚmaxsÚiÚresultsÚp_minsÚp_maxss               r   Ú_get_boundsr7   '   sÄ  € Ü�nŠnœVŸ_š_Ó.Ó/€GÜ�nŠnœVŸ_š_Ó.Ó/€GÜ—’ Ó"€IáØ”—’˜WÓ%¤v§|¢|°GÓ'<¼f¿lºlÈ9Ó>Uôð ‡�˜!ÓØä�;Š;�w¤§¢¬v¯©ÀÇÁÑ/PÓ QÓR€DÜ�;Š;�w¤§¢¬v¯©ÀÇÁÑ/PÓ QÓR€Dä).¨y¯©Ô)?Ó@Ò)? A�}‰}˜QÔÑ)?€GÐ@Ø¬%°	·±Ô*@ÓAÒ*@ Q—‘˜aÔ Ñ*@ÑAÑA€Gä�[Š[˜œvŸ~š~¬f¯o©oÓ>Ó?€FÜ�[Š[˜œvŸ~š~¬f¯o©oÓ>Ó?€FÜ‡G�G×Ñ”v—{’{ 6¬6¯>ª>¼&¿/¹/Ó+JÓKÔLÜ‡G�G×Ñ”v—{’{ 6¬6¯>ª>¼&¿/¹/Ó+JÓKÔLÞØˆÜ×Ñ˜gÓ&Ð&ùò AùÚAs   Å$K/ÆK4c                óh  • [         R                  " S5      n[         R                  " [         R                  " S5      5      n[        R
                  R                  U [         R                  " U5      [         R                  " U5      5        [         R                  " U[         R                  " [         R                  5      5      nUR                  S:X  a   [        R
                  R                  U5        g [         R                  " X!R                  5      n[        R
                  R                  U5        U$ r   )r   Úc_uint64r   Úc_uint8r
   r'   ÚIndexItem_GetDatar!   r#   r$   r)   r"   r(   Ú	string_at)r+   ÚlengthÚdÚcÚss        r   Ú	_get_datarA   A   s·   € Ü�_Š_˜QÓ€FÜ�Š”v—~’~ aÓ(Ó)€AÜ‡G�G×Ñ˜f¤f§l¢l°1£o´v·|²|ÀFÓ7KÔLÜ�Š�A”v—~’~¤f§o¡oÓ6Ó7€AØ‡|�|�qÓÜ�‰×Ñ˜1ÔØÜ×Ò˜ŸL™LÓ)€AÜ‡G�G×Ñ�qÔØ€Hó    c                  ó²  • \ rS rSrSrS?S jrS@S jrS@S jrSAS jrSBS jr	SCS jr
SDS	 jrSES
 jrSFS jrSFS jr    SGS jr\S 5       rS rS rS r\" \\5      rS rS r\" \\5      rSHSIS jjr\r SH           SJS jjrSKS jr        SLS jr\SMS j5       r \ SN     SOS jj5       r \      SPS j5       r  SN     SQS jjr SRS jr!SRS jr"\      SMS  j5       r#\ SN     SSS! jj5       r#\      SPS" j5       r# SN     STS# jjr#SNS$ jr$S% r%SUS& jr&S' r'S( r(S) r)\        SVS* j5       r*\ SN       SWS+ jj5       r*\        SXS, j5       r*  SY       SZS. jjr*S/ r+S-SSSS0.S1 jr,S2 r-SYS3 jr.SHS4 jr/\" \/5      r0S[S5 jr1          S\S6 jr2S]S7 jr3S8 r4\5S^S9 j5       r6\5S_S: j5       r7S; r8S< r9S= r:S>r;g)`r   éN   z0An R-Tree, MVR-Tree, or TPR-Tree indexing objectc                ó.
  • UR                  S[        5       5      U l        U R                  R                  [        :X  a*  [        [        R                  S5      (       d  [        S5      e[        UR                  SS5      5      U l
        SnSnSnSnU(       a½  [        US   [        5      (       d  [        US   [        5      (       a8  US   n[        U5      S:”  a#  [        US   [        5      (       a  US   nO[US   nOU[        US   [         5      (       a  US   n[        U5      S:”  a  US   nO#[        US   [        5      (       a  US   nOUS   nU(       GaD  ["        U R                  l        XPR                  l        [        U5      S	-   U R                  R(                  -   n[*        R,                  R/                  U5      n[*        R,                  R1                  U5      (       a\  [        UR                  S
S5      5      U R                  l        U R                  R2                  (       d   U R                  R4                    [*        R,                  R9                  U5      n	[*        R:                  " U	[*        R<                  5      (       d  SU S3n
[?        U
5      eOÑU(       aµ  [@        U R                  l        URB                  (       am  [        UR                  S
S5      5      U R                  l        U R                  R2                  (       d   U R                  R4                    OURE                  5         X`l#        URI                  U R                  5        O[J        U R                  l        UR                  SS5      nU(       a  [M        U5      U R                  l'        U(       aY  U R                  R                  [P        :X  a;  SU l)        U RU                  U5      U l+        U RR                  (       a  U RR                  egU(       aX  U R                  R                  [P        :X  a:  SU l)         U RX                  " U6 U l+        U RR                  (       a  U RR                  eg[_        U R                  RV                  5      U l+        U(       a  U H  nU R`                  " U6   M     gU(       a  []        S5      eg! [6         a    SU R                  l         GN“f = f! [6         a    SU R                  l         GNÀf = f! [Z         a    []        S5      ef = f)až  Creates a new index

:param filename:
    The first argument in the constructor is assumed to be a filename
    determining that a file-based storage for the index should be used.
    If the first argument is not of type basestring, it is then assumed
    to be an instance of ICustomStorage or derived class.
    If the first argument is neither of type basestring nor an instance
    of ICustomStorage, it is then assumed to be an input index item
    stream.

:param stream:
    If the first argument in the constructor is not of type basestring,
    it is assumed to be an iterable stream of data that will raise a
    StopIteration.  It must be in the form defined by the
    :attr:`interleaved` attribute of the index. The following example
    would assume :attr:`interleaved` is False::

        (id,
         (minx, maxx, miny, maxy, minz, maxz, ..., ..., mink, maxk),
         object)

    The object can be None, but you must put a place holder of
    ``None`` there.

    For a TPR-Tree, this would be in the form::

        (id,
         ((minx, maxx, miny, maxy, ..., ..., mink, maxk),
          (minvx, maxvx, minvy, maxvy, ..., ..., minvk, maxvk),
          time),
         object)

:param storage:
    If the first argument in the constructor is an instance of
    ICustomStorage then the given custom storage is used.

:param interleaved: True or False, defaults to True.
    This parameter determines the coordinate order for all methods that
    take in coordinates.

:param properties: An :class:`index.Property` object.
    This object sets both the creation and instantiation properties
    for the object and they are passed down into libspatialindex.
    A few properties are curried from instantiation parameters
    for you like ``pagesize`` and ``overwrite``
    to ensure compatibility with previous versions of the library.  All
    other properties must be set on the object.

.. warning::
    The coordinate ordering for all functions are sensitive the
    index's :attr:`interleaved` data member.  If :attr:`interleaved`
    is False, the coordinates must be in the form
    [xmin, xmax, ymin, ymax, ..., ..., kmin, kmax]. If
    :attr:`interleaved` is True, the coordinates must be in the form
    [xmin, ymin, ..., kmin, xmax, ymax, ..., kmax]. This also applies
    to velocities when using a TPR-Tree.

A basic example
::

    >>> from rtree import index
    >>> p = index.Property()

    >>> idx = index.Index(properties=p)
    >>> idx  # doctest: +NORMALIZE_WHITESPACE
    rtree.index.Index(bounds=[1.7976931348623157e+308,
                            1.7976931348623157e+308,
                            -1.7976931348623157e+308,
                            -1.7976931348623157e+308],
                            size=0)

Insert an item into the index::

    >>> idx.insert(4321,
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...            obj=42)

Query::

    >>> hits = idx.intersection((0, 0, 60, 60), objects=True)
    >>> for i in hits:
    ...     if i.id == 4321:
    ...         i.object
    ...         i.bbox
    ... # doctest: +ELLIPSIS
    42
    [34.37768294..., 26.73758537..., 49.37768294..., 41.73758537...]


Using custom serializers::

    >>> class JSONIndex(index.Index):
    ...     def dumps(self, obj):
    ...         # This import is nested so that the doctest doesn't
    ...         # require simplejson.
    ...         import simplejson
    ...         return simplejson.dumps(obj).encode('ascii')
    ...
    ...     def loads(self, string):
    ...         import simplejson
    ...         return simplejson.loads(string.decode('ascii'))

    >>> stored_obj = {"nums": [23, 45], "letters": "abcd"}
    >>> json_idx = JSONIndex()
    >>> try:
    ...     json_idx.insert(1, (0, 1, 0, 1), stored_obj)
    ...     list(json_idx.nearest((0, 0), 1,
    ...                           objects="raw")) == [stored_obj]
    ... except ImportError:
    ...     True
    True

Ú
propertiesÚIndex_InsertTPDataz;TPR-Tree type not supported with version of libspatialindexr-   TNr   r	   r   Ú	overwriteFzUnable to open file 'z' for index storageÚpagesizez-libspatialindex >= 2.1 needed for bulk insertz%Bulk insert only supported for RTrees)1Úgetr   rF   ÚtypeÚ
RT_TPRTreeÚhasattrr
   r'   ÚRuntimeErrorÚboolr-   Ú
isinstanceÚstrÚbytesÚlenÚtupleÚICustomStorageÚRT_DiskÚstorageÚfilenameÚidx_extensionÚosÚpathÚabspathÚexistsrH   Úindex_idr   ÚdirnameÚaccessÚW_OKÚOSErrorÚ	RT_CustomÚhasDataÚclearÚcustomstorageÚregisterCallbacksÚ	RT_Memoryr   rI   ÚRT_RTreeÚ
_exceptionÚ_create_idx_from_streamr+   Ú_create_idx_from_arrayÚ	NameErrorÚNotImplementedErrorÚIndexHandleÚinsert)ÚselfÚargsÚkwargsÚstreamÚarraysÚbasenamerW   ÚfÚpr>   ÚmessageÚpsÚitems                r   Ú__init__ÚIndex.__init__Q   sä  € ðh !Ÿ*™* \´8³:Ó>ˆŒà�?‰?×Ñ¤:Ó-´gÜ�G‰GÐ)÷7
ñ 7
ô ØMóð ô
   §
¡
¨=¸$Ó ?Ó@ˆÔàˆØˆØˆØˆÞÜ˜$˜q™'¤3×'Ñ'¬:°d¸1±g¼u×+EÑ+Eà ™7�ä�t“9˜q“=Ü! $ q¡'¬5×1Ñ1Ø!% a¡™à!% a¡˜øÜ˜D ™G¤^×4Ñ4Ø˜q™'�ä�t“9˜q“=Ø! !™W�FøÜ˜D ™G¤U×+Ñ+Ø˜a™‘à˜a™�çÜ&-ˆD�O‰OÔ#Ø'/�O‰OÔ$ô �H“ Ñ# d§o¡o×&CÑ&CÑCˆAÜ—‘—‘ Ó"ˆAô �w‰w�~‰~˜a× Ñ Ü,0°·±¸KÈÓ1OÓ,P�—‘Ô)ð —‘×0×0ð5ØŸ™×0Ò0ô —‘—‘ Ó"ˆAÜ—9’9˜Q¤§¡×(Ñ(Ø1°!°Ð4GÐH�Ü˜gÓ&Ð&ð )ö Ü&/ˆD�O‰OÔ#Ø��Ü,0°·±¸KÈÓ1OÓ,P�—‘Ô)Ø—‘×0×0ð5ØŸ™×0Ó0ð —M‘M”OØ!(ÔØ×%Ñ% d§o¡oÕ6ä&/ˆD�O‰OÔ#à�Z‰Z˜
 DÓ)ˆÞÜ'*¨2£wˆD�O‰OÔ$æ�d—o‘o×*Ñ*¬hÓ6Ø"ˆDŒOØ×6Ñ6°vÓ>ˆDŒKØ��Ø—o‘oÐ%ð æ˜Ÿ™×,Ñ,´Ó8Ø"ˆDŒOðØ"×9Ò9¸6ÐB�”ð ��Ø—o‘oÐ%ð ô & d§o¡o×&<Ñ&<Ó=ˆDŒKÞÛ"�DØ—K’K Ó&ò #æÜ)Ð*QÓRÐRð øôc &ó 5Ø34˜Ÿ™×0ð5ûô &ó 5Ø34˜Ÿ™×0ð5ûô. ó Ü)ØCóð ðús0   È/R: ÌS Ð1S> Ò:SÓSÓS;Ó:S;Ó>Tc                óN   • [         R                  " S[        5        [        U 5      $ )Nz6index.get_size() is deprecated, use len(index) instead)ÚwarningsÚwarnÚDeprecationWarningrS   ©rq   s    r   Úget_sizeÚIndex.get_size/  s    € Ü�ŠØDÔFXô	
ô �4‹yÐrB   c                óZ   •  U R                  U R                  5      $ ! [         a     gf = f)z@The number of entries in the index.

:return: number of entries
r   ©ÚcountÚboundsr   r‚   s    r   Ú__len__ÚIndex.__len__5  s,   € ð
	Ø—:‘:˜dŸk™kÓ*Ð*øÜó 	Ùð	úó   ‚ �
*©*c                ó:   • SU R                    S[        U 5       S3$ )Nzrtree.index.Index(bounds=z, size=Ú))rˆ   rS   r‚   s    r   Ú__repr__ÚIndex.__repr__?  s   € Ø*¨4¯;©;¨-°w¼sÀ4»y¸kÈÐKÐKrB   c                ó@   • U R                   R                  5       nUS	 U$ )Nr+   )Ú__dict__Úcopy©rq   Ústates     r   Ú__getstate__ÚIndex.__getstate__B  s    € Ø—‘×"Ñ"Ó$ˆØ�(ˆOØˆrB   c                ó‚   • U R                   R                  U5        [        U R                  R                  5      U l        g r   )r‘   Úupdatero   rF   r+   r“   s     r   Ú__setstate__ÚIndex.__setstate__G  s*   € Ø�‰×Ñ˜UÔ#Ü! $§/¡/×"8Ñ"8Ó9ˆ�rB   c                ó.   • [         R                  " U5      $ r   )ÚpickleÚdumps©rq   Úobjs     r   r�   ÚIndex.dumpsK  s   € Ü�|Š|˜CÓ Ð rB   c                ó.   • [         R                  " U5      $ r   )rœ   Úloads)rq   Ústrings     r   r¢   ÚIndex.loadsN  s   € Ü�|Š|˜FÓ#Ð#rB   c                ó~   • U R                   (       a"  U R                   R                  5         SU l         g[        S5      e)zBForce a flush of the index to storage. Renders index
inaccessible.NzUnclosable index)r+   Údestroyrb   r‚   s    r   ÚcloseÚIndex.closeQ  s.   € ð �;�;Ø�K‰K×ÑÔ!ØˆD�KäÐ,Ó-Ð-rB   c                ó\   • U R                   (       a  U R                   R                  5         gg)z&Force a flush of the index to storage.N)r+   Úflushr‚   s    r   rª   ÚIndex.flushZ  s   € à�;�;Ø�K‰K×ÑÕð rB   c                óB  • U R                   R                  n[        U5      n[        R                  U-  nU" 5       n[        U5      U:X  a	  XS S & UnXE4$ U" 5       nU R                  (       a
  US U nXS  nOUS S S2   nUSS S2   nXdS S & XuS S & Xg::  d  [        S5      eXE4$ )Nr   r	   z5Coordinates must not have minimums more than maximums)rF   r0   Úlistr   r   rS   r-   r   )rq   Úcoordinatesr0   Úarrr1   r2   rx   Úqs           r   Úget_coordinate_pointersÚIndex.get_coordinate_pointers_  sÎ   € ð —O‘O×-Ñ-ˆ	Ü˜;Ó'ˆä�o‰o 	Ñ)ˆÙ‹uˆô ˆ{Ó˜yÓ(Ø!‘ˆGØˆDð, ˆzÐñ' “5ˆDð ××Ø 
 Ð+�Ø 
Ð+‘ð  ¡ ! Ñ$�Ø   1 Ñ%�à‘ˆGØ‘ˆGà“6Ü ØKóð ð ˆzÐrB   c                óš   • U S   U S   :”  a  [        S5      e[        R                  " U S   5      n[        R                  " U S   5      nX4$ )Nr   r	   z%Start time must be less than end time)r   r   r   )ÚtimesÚt_startÚt_ends      r   Ú_get_time_doublesÚIndex._get_time_doublesƒ  sJ   € à�‰8�e˜A‘hÓÜÐDÓEÐEÜ—/’/ %¨¡(Ó+ˆÜ—’  a¡Ó)ˆØˆ~ÐrB   c                ó
  • U R                  U5      n[        U5      n[        R                  " U5      n[        R                  " U5      nU[        R
                  " U[        R                  " [        R                  5      5      U4$ r   )r�   rS   r   Úcreate_string_bufferr   r#   r$   r:   )rq   rŸ   Ú
serializedÚsizer>   rx   s         r   Ú
_serializeÚIndex._serialize‹  s]   € Ø—Z‘Z “_ˆ
Ü�:‹ˆä×'Ò'¨
Ó3ˆä�NŠN˜1Óˆð ”V—[’[ ¤F§N¢N´6·>±>Ó$BÓCÀZÐOÐOrB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndex_SetResultSetOffsetr+   ©rq   r"   s     r   Úset_result_limitÚIndex.set_result_limit–  ó   € Ü�w‰w×/Ñ/°·±¸UÓCÐCrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndex_GetResultSetOffsetr+   r‚   s    r   Úget_result_limitÚIndex.get_result_limit™  ó   € Ü�w‰w×/Ñ/°·±Ó<Ð<rB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndex_SetResultSetLimitr+   rÁ   s     r   Úset_result_offsetÚIndex.set_result_offsetž  s   € Ü�w‰w×.Ñ.¨t¯{©{¸EÓBÐBrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndex_GetResultSetLimitr+   r‚   s    r   Úget_result_offsetÚIndex.get_result_offset¡  s   € Ü�w‰w×.Ñ.¨t¯{©{Ó;Ð;rB   Nc           	     ót  • U R                   R                  [        :X  a  U R                  " U/UQ7SU06$ U R	                  U5      u  pE[
        R                  " S5      nSnSnUb  U R                  U5      u  pvn[        R                  R                  U R                  XXPR                   R                  Xg5        g)aÌ  Inserts an item into the index with the given coordinates.

:param id: A long integer that is the identifier for this index entry.  IDs
    need not be unique to be inserted into the index, and it is up
    to the user to ensure they are unique if this is a requirement.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time value as a float.

:param obj: a pickleable object.  If not None, this object will be
    stored in the index with the :attr:`id`.

The following example inserts an entry into the index with id `4321`,
and the object it stores with that id is the number `42`.  The
coordinate ordering in this instance is the default (interleaved=True)
ordering::

    >>> from rtree import index
    >>> idx = index.Index()
    >>> idx.insert(4321,
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...            obj=42)

This example is inserting the same object for a TPR-Tree, additionally
including a set of velocities at time `3`::

    >>> p = index.Property(type=index.RT_TPRTree)  # doctest: +SKIP
    >>> idx = index.Index(properties=p)  # doctest: +SKIP
    >>> idx.insert(4321,
    ...            ((34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...             (0.5, 2, 1.5, 2.5),
    ...            3.0),
    ...            obj=42)  # doctest: +SKIP

rŸ   r   N)rF   rK   rL   Ú	_insertTPr±   r   Úc_ubyter½   r
   r'   ÚIndex_InsertDatar+   r0   )	rq   Úidr®   rŸ   r5   r6   Údatar¼   Úpyserializeds	            r   rp   ÚIndex.insert¦  s›   € ðV �?‰?×Ñ¤:Ó-à—>’> "Ð< {Ò<¸Ñ<Ð<à×5Ñ5°kÓB‰ˆÜ�~Š~˜aÓ ˆØˆØˆØ‰?Ø'+§¡°sÓ';Ñ$ˆD˜Ü�‰× Ñ Ø�K‰K˜ V¯_©_×-FÑ-FÈõ	
rB   c                ój  • U R                  U5      u  pgU R                  U5      u  p‰U R                  XDS-   45      u  p«[        R                  " S5      nSnUb  U R	                  U5      u  pÜn[
        R                  R                  U R                  UUUUU	U
UU R                  R                  UU5        g )Nr	   r   )r±   r·   r   rÔ   r½   r
   r'   rG   r+   rF   r0   )rq   rÖ   r®   Ú
velocitiesÚtimerŸ   r5   r6   Úpv_minsÚpv_maxsrµ   r¶   r×   r¼   Ú_s                  r   rÓ   ÚIndex._insertTPá  s­   € ð ×5Ñ5°kÓB‰ˆØ×7Ñ7¸
ÓCÑˆà×/Ñ/°¸a±xÐ0@ÓA‰ˆÜ�~Š~˜aÓ ˆØˆØ‰?Ø ŸO™O¨CÓ0‰MˆD˜Ü�‰×"Ñ"Ø�K‰KØØØØØØØØ�O‰O×%Ñ%ØØõ	
rB   c           	     óp  • U R                   R                  [        :X  a  U R                  " U6 $ U R	                  U5      u  p#[
        R                  " S5      n[        R                  R                  U R                  UUU R                   R                  [
        R                  " U5      5        UR                  $ )a¤  Return number of objects that intersect the given coordinates.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time pair for the
    time range as a float.

The following example queries the index for any objects any objects
that were stored in the index intersect the bounds given in the
coordinates::

    >>> from rtree import index
    >>> idx = index.Index()
    >>> idx.insert(4321,
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...            obj=42)

    >>> print(idx.count((0, 0, 60, 60)))
    1

This example is similar for a TPR-Tree::

    >>> p = index.Property(type=index.RT_TPRTree)  # doctest: +SKIP
    >>> idx = index.Index(properties=p)  # doctest: +SKIP
    >>> idx.insert(4321,
    ...            ((34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...             (0.5, 2, 1.5, 2.5),
    ...             3.0),
    ...            obj=42)  # doctest: +SKIP

    >>> print(idx.count(((0, 0, 60, 60), (0, 0, 0, 0), (3, 5))))
    ... # doctest: +SKIP
    1

r   )rF   rK   rL   Ú_countTPr±   r   r9   r
   r'   ÚIndex_Intersects_countr+   r0   r!   r"   )rq   r®   r5   r6   Úp_num_resultss        r   r‡   ÚIndex.countÿ  sŒ   € ðT �?‰?×Ñ¤:Ó-Ø—=’= +Ð.Ð.Ø×5Ñ5°kÓB‰ˆäŸš¨Ó*ˆä�‰×&Ñ&Ø�K‰KØØØ�O‰O×%Ñ%Ü�LŠL˜Ó'ô	
ð ×"Ñ"Ð"rB   c                ój  • U R                  U5      u  pEU R                  U5      u  pgU R                  U5      u  p‰[        R                  " S5      n
[        R
                  R                  U R                  UUUUUU	U R                  R                  [        R                  " U
5      5	        U
R                  $ r   )r±   r·   r   r9   r
   r'   ÚIndex_TPIntersects_countr+   rF   r0   r!   r"   )rq   r®   rÛ   r´   r5   r6   rÝ   rÞ   rµ   r¶   rä   s              r   râ   ÚIndex._countTP9  s›   € ð ×5Ñ5°kÓB‰ˆØ×7Ñ7¸
ÓCÑˆØ×/Ñ/°Ó6‰ˆäŸš¨Ó*ˆä�‰×(Ñ(Ø�K‰KØØØØØØØ�O‰O×%Ñ%Ü�LŠL˜Ó'ô
	
ð ×"Ñ"Ð"rB   c                ó   • g r   © ©rq   r®   Úobjectss      r   ÚcontainsÚIndex.containsP  s   € ØTWrB   Fc                ó   • g r   rê   rë   s      r   rí   rî   S  s   € ð  #rB   c                ó   • g r   rê   rë   s      r   rí   rî   X  ó   € ð rB   c           
     ó6  • U(       a  U R                  X5      $ U R                  U5      u  p4[        R                  " S5      n[        R                  " [        R
                  " 5       5      n [        R                  R                    [        R                  R                  U R                  UUU R                  R                  [        R                  " U5      [        R                  " U5      5        U R                  XeR                  5      $ ! [         a     gf = f)a
  Return ids or objects in the index that contains within the given
coordinates.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.

:param objects: If True, the intersection method will return index objects that
    were pickled when they were stored with each index entry, as well
    as the id and bounds of the index entries. If 'raw', the objects
    will be returned without the :class:`rtree.index.Item` wrapper.

The following example queries the index for any objects any objects
that were stored in the index intersect the bounds given in the
coordinates::

    >>> from rtree import index
    >>> idx = index.Index()
    >>> idx.insert(4321,
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...            obj=42)

    >>> hits = list(idx.contains((0, 0, 60, 60), objects=True))
    ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS +SKIP
    >>> [(item.object, item.bbox) for item in hits if item.id == 4321]
    ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS +SKIP
    [(42, [34.37768294..., 26.73758537..., 49.37768294...,
           41.73758537...])]

If the :class:`rtree.index.Item` wrapper is not used, it is faster to
request the 'raw' objects::

    >>> list(idx.contains((0, 0, 60, 60), objects="raw"))
    ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS +SKIP
    [42]

r   N)Ú_contains_objr±   r   r9   r   Úc_int64r
   r'   ÚIndex_Contains_idÚAttributeErrorr+   rF   r0   r!   Ú_get_idsr"   ©rq   r®   rì   r5   r6   rä   Úits          r   rí   rî   ]  sÑ   € öV Ø×%Ñ% kÓ;Ð;à×5Ñ5°kÓB‰ˆäŸš¨Ó*ˆä�^Š^œFŸNšNÓ,Ó-ˆð	Ü�G‰G×%Ò%ô 	�‰×!Ñ!Ø�K‰KØØØ�O‰O×%Ñ%Ü�LŠL˜ÓÜ�LŠL˜Ó'ô	
ð �}‰}˜R×!4Ñ!4Ó5Ð5øô ó 	Ùð	ús   Á,D Ä
DÄDc           
     ó  • U R                   UR                   :X  d   eU R                  R                  UR                  R                  :X  d   eSn[        U R                   U R                  S9nU R	                  U R
                  SS9 GH   nU R                   (       Ga   UR	                  UR                  SS9 Hß  n/ n[        [        UR                  5      5       H‹  nU[        UR                  5      S-  :  a7  UR                  [        UR                  U   UR                  U   5      5        MV  UR                  [        UR                  U   UR                  U   5      5        M�     UR                  X&UR                  UR                  45        US-  nMá     GM  UR	                  UR
                  SS9 HÌ  n/ n[        [        UR
                  5      5       Hx  nUS-  S:X  a7  UR                  [        UR
                  U   UR
                  U   5      5        MC  UR                  [        UR
                  U   UR
                  U   5      5        Mz     UR                  X(UR                  UR                  45        US-  nMÎ     GM     U$ )z¯Take the intersection of two Index objects.

:param other: another index
:return: a new index
:raises AssertionError: if self and other have different interleave or dimension
r   ©r-   rF   T©rì   r   r	   )r-   rF   r0   r   Úintersectionrˆ   Úbboxr%   rS   ÚappendÚmaxÚminrp   Úobject)	rq   Úotherr3   Únew_idxÚitem1Úitem2rþ   Újrˆ   s	            r   Ú__and__ÚIndex.__and__   s  € ð ×Ñ 5×#4Ñ#4Ó4Ð4Ð4Ø�‰×(Ñ(¨E×,<Ñ,<×,FÑ,FÓFÐFÐFàˆÜ D×$4Ñ$4ÀÇÁÑQˆð ×&Ñ& t§{¡{¸DÐ&ÔAˆEØ××Ðà"×/Ñ/°·
±
ÀDÐ/ÓI�Eà�DÜ"¤3 u§z¡z£?Ö3˜Øœs 5§:¡:›°!Ñ3Ó3Ø ŸK™K¬¨E¯J©J°q©M¸5¿:¹:Àa¹=Ó(IÖJà ŸK™K¬¨E¯J©J°q©M¸5¿:¹:Àa¹=Ó(IÖJñ	 4ð —N‘N 1¨U¯\©\¸5¿<¹<Ð,HÔIØ˜‘F’Aô Jð #×/Ñ/°·±ÀdÐ/ÓK�Eà�FÜ"¤3 u§|¡|Ó#4Ö5˜Ø˜q™5 A›:Ø"ŸM™M¬#¨e¯l©l¸1©o¸u¿|¹|ÈA¹Ó*OÖPà"ŸM™M¬#¨e¯l©l¸1©o¸u¿|¹|ÈA¹Ó*OÖPñ	 6ð —N‘N 1¨u¯|©|¸U¿\¹\Ð.JÔKØ˜‘F’Aô Lñ# Bð: ˆrB   c                ó  • U R                   UR                   :X  d   eU R                  R                  UR                  R                  :X  d   e[        U R                   U R                  S9nX4 H™  nUR	                  UR
                  SS9 Hx  nU R                   (       a3  UR                  UR                  UR                  UR                  5        MG  UR                  UR                  UR
                  UR                  5        Mz     M›     U$ )z¨Take the union of two Index objects.

:param other: another index
:return: a new index
:raises AssertionError: if self and other have different interleave or dimension
rû   Trü   )
r-   rF   r0   r   rý   rˆ   rp   rÖ   rþ   r  )rq   r  r  Úold_idxr{   s        r   Ú__or__ÚIndex.__or__Í  sÍ   € ð ×Ñ 5×#4Ñ#4Ó4Ð4Ð4Ø�‰×(Ñ(¨E×,<Ñ,<×,FÑ,FÓFÐFÐFä D×$4Ñ$4ÀÇÁÑQˆð “}ˆGà×,Ñ,¨W¯^©^ÀTÐ,ÓJ�Ø×#×#Ø—N‘N 4§7¡7¨D¯I©I°t·{±{ÖCà—N‘N 4§7¡7¨D¯K©K¸¿¹ÖEó	 Kñ %ð ˆrB   c                ó   • g r   rê   rë   s      r   rý   ÚIndex.intersectionä  ó   € ð rB   c                ó   • g r   rê   rë   s      r   rý   r  é  ó   € ð rB   c                ó   • g r   rê   rë   s      r   rý   r  î  rñ   rB   c           
     ó@  • U R                   R                  [        :X  a  U R                  " USU06$ U(       a  U R	                  X5      $ U R                  U5      u  p4[        R                  " S5      n[        R                  " [        R                  " 5       5      n[        R                  R                  U R                  UUU R                   R                  [        R                  " U5      [        R                  " U5      5        U R!                  XeR"                  5      $ )a-	  Return ids or objects in the index that intersect the given
coordinates.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time pair for the
    time range as a float.

:param objects: If True, the intersection method will return index objects that
    were pickled when they were stored with each index entry, as well
    as the id and bounds of the index entries. If 'raw', the objects
    will be returned without the :class:`rtree.index.Item` wrapper.

The following example queries the index for any objects any objects
that were stored in the index intersect the bounds given in the
coordinates::

    >>> from rtree import index
    >>> idx = index.Index()
    >>> idx.insert(4321,
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...            obj=42)

    >>> hits = list(idx.intersection((0, 0, 60, 60), objects=True))
    >>> [(item.object, item.bbox) for item in hits if item.id == 4321]
    ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
    [(42, [34.37768294..., 26.73758537..., 49.37768294...,
           41.73758537...])]

If the :class:`rtree.index.Item` wrapper is not used, it is faster to
request the 'raw' objects::

    >>> list(idx.intersection((0, 0, 60, 60), objects="raw"))
    [42]

Similar for the TPR-Tree::

    >>> p = index.Property(type=index.RT_TPRTree)  # doctest: +SKIP
    >>> idx = index.Index(properties=p)  # doctest: +SKIP
    >>> idx.insert(4321,
    ...            ((34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...             (0.5, 2, 1.5, 2.5),
    ...             3.0),
    ...            obj=42)  # doctest: +SKIP

    >>> hits = list(idx.intersection(
    ...     ((0, 0, 60, 60), (0, 0, 0, 0), (3, 5)), objects=True))
    ...  # doctest: +SKIP
    >>> [(item.object, item.bbox) for item in hits if item.id == 4321]
    ... # doctest: +SKIP
    [(42, [34.37768294..., 26.73758537..., 49.37768294...,
           41.73758537...])]

rì   r   )rF   rK   rL   Ú_intersectionTPÚ_intersection_objr±   r   r9   r   rô   r
   r'   ÚIndex_Intersects_idr+   r0   r!   r÷   r"   rø   s          r   rý   r  ó  sÛ   € ð~ �?‰?×Ñ¤:Ó-à×'Ò'ØðØ&-ñð ö Ø×)Ñ)¨+Ó?Ð?à×5Ñ5°kÓB‰ˆäŸš¨Ó*ˆä�^Š^œFŸNšNÓ,Ó-ˆä�‰×#Ñ#Ø�K‰KØØØ�O‰O×%Ñ%Ü�LŠL˜ÓÜ�LŠL˜Ó'ô	
ð �}‰}˜R×!4Ñ!4Ó5Ð5rB   c                óæ  • U R                  U5      u  pVU R                  U5      u  pxU R                  U5      u  pš[        R                  " S5      nU(       aD  [        R
                  R                  n[        R                  " [        R                  " 5       5      nOC[        R
                  R                  n[        R                  " [        R                  " 5       5      nU" U R                  UUUUU	U
U R                  R                  [        R                  " U5      [        R                  " U5      5
        U(       a  U R                  XÛR                   U5      $ U R#                  XÛR                   5      $ r   )r±   r·   r   r9   r
   r'   ÚIndex_TPIntersects_objr   r)   ÚIndex_TPIntersects_idrô   r+   rF   r0   r!   Ú_get_objectsr"   r÷   )rq   r®   rÛ   r´   rì   r5   r6   rÝ   rÞ   rµ   r¶   rä   Úcallrù   s                 r   r  ÚIndex._intersectionTPJ  s  € Ø×5Ñ5°kÓB‰ˆØ×7Ñ7¸
ÓCÑˆØ×/Ñ/°Ó6‰ˆäŸš¨Ó*ˆæÜ—7‘7×1Ñ1ˆDÜ—’¤§¢Ó 1Ó2‰Bä—7‘7×0Ñ0ˆDÜ—’¤§¢Ó 0Ó1ˆBáØ�K‰KØØØØØØØ�O‰O×%Ñ%Ü�LŠL˜ÓÜ�LŠL˜Ó'ô	
ö Ø×$Ñ$ R×)<Ñ)<¸gÓFÐFà—=‘= ×%8Ñ%8Ó9Ð9rB   c           
     ó²  • U R                  U5      u  p4[        R                  " S5      n[        R                  " [        R                  " 5       5      n[
        R                  R                  U R                  UUU R                  R                  [        R                  " U5      [        R                  " U5      5        U R                  XeR                  U5      $ r   )r±   r   r9   r   r)   r
   r'   ÚIndex_Intersects_objr+   rF   r0   r!   r  r"   rø   s          r   r  ÚIndex._intersection_objj  s–   € Ø×5Ñ5°kÓB‰ˆäŸš¨Ó*ˆä�^Š^œFŸOšOÓ-Ó.ˆä�‰×$Ñ$Ø�K‰KØØØ�O‰O×%Ñ%Ü�LŠL˜ÓÜ�LŠL˜Ó'ô	
ð × Ñ  ×%8Ñ%8¸'ÓBÐBrB   c           
     ó  • U R                  U5      u  p4[        R                  " S5      n[        R                  " [        R                  " 5       5      n [
        R                  R                    [
        R                  R                  U R                  UUU R                  R                  [        R                  " U5      [        R                  " U5      5        U R                  XeR                  U5      $ ! [         a     g f = fr   )r±   r   r9   r   r)   r
   r'   ÚIndex_Contains_objrö   r+   rF   r0   r!   r  r"   rø   s          r   ró   ÚIndex._contains_obj{  s¾   € Ø×5Ñ5°kÓB‰ˆäŸš¨Ó*ˆä�^Š^œFŸOšOÓ-Ó.ˆð	Ü�G‰G×&Ò&ô 	�‰×"Ñ"Ø�K‰KØØØ�O‰O×%Ñ%Ü�LŠL˜ÓÜ�LŠL˜Ó'ô	
ð × Ñ  ×%8Ñ%8¸'ÓBÐBøô ó 	Ùð	ús   ÁC4 Ã4
DÄ Dc           	   #  óª  #   • [         R                  " U[         R                  " [         R                  " [         R                  U-  5      5      5      n[         R                  " U[         R                  " [         R                  " [         R                  5      5      5      n US:w  a-  [	        U5       H  n[        U R                  XF   5      v •  M     O;[	        U5       H,  n[        XF   5      nUc  Uv •  M  U R                  U5      v •  M.     [        R                  R                  XR5        g ! [        R                  R                  XR5        f = f7f)NÚraw)r   r#   r$   r)   r%   ÚItemr¢   rA   r
   r'   ÚIndex_DestroyObjResults)rq   rù   Únum_resultsrì   ÚitemsÚitsr3   r×   s           r   r  ÚIndex._get_objects‘  sæ   é € ä—’Ø”—’œvŸ~š~¬f¯o©oÀÑ.KÓLÓMó
ˆô �kŠk˜%¤§¢´·²¼v¿¹Ó0OÓ!PÓQˆð	>Ø˜%ÓÜ˜{Ö+�AÜ˜tŸz™z¨5©8Ó4Ô4ò ,ô ˜{Ö+�AÜ$ U¡XÓ.�DØ‘|Ø"œ
à"Ÿj™j¨Ó.Ô.ñ ,ô �G‰G×+Ñ+¨CÕ=øŒD�G‰G×+Ñ+¨CÕ=üs   ‚BEÂ!A.D/ Ä EÄ/!EÅEc              #  óÄ  #   • [         R                  " U[         R                  " [         R                  U-  5      5      n[         R                  " U[         R                  " [         R                  5      5      n [        U5       H  nUR                  U   v •  M     [        R                  R                  U5        g ! [        R                  R                  U5        f = f7fr   )
r   r#   r$   rô   r)   r%   r&   r
   r'   r(   )rq   rù   r(  r)  r*  r3   s         r   r÷   ÚIndex._get_ids§  s�   é € ä—’˜B¤§¢¬v¯~©~ÀÑ/KÓ LÓMˆÜ�kŠk˜%¤§¢´·±Ó!@ÓAˆð	$Ü˜;Ö'�Ø—n‘n QÑ'Ô'ñ (ô �G‰G×Ñ˜sÕ#øŒD�G‰G×Ñ˜sÕ#üs   ‚A6C Á9#B< Â C Â<!CÃC c           	     óÆ  • U R                  U5      u  pE[        R                  " [        R                  " U5      5      n[        R                  " [        R                  " 5       5      n[
        R                  R                  U R                  UUU R                  R                  [        R                  " U5      U5        U R                  XvR                  R                  U5      $ r   )r±   r   r   r9   r)   r
   r'   ÚIndex_NearestNeighbors_objr+   rF   r0   r!   r  r&   r"   ©rq   r®   r(  rì   r5   r6   rä   rù   s           r   Ú_nearest_objÚIndex._nearest_obj³  sœ   € Ø×5Ñ5°kÓB‰ˆäŸš¤v§¢°{Ó'CÓDˆä�^Š^œFŸOšOÓ-Ó.ˆä�‰×*Ñ*Ø�K‰KØØØ�O‰O×%Ñ%Ü�LŠL˜ÓØô	
ð × Ñ  ×%;Ñ%;×%AÑ%AÀ7ÓKÐKrB   c                ó   • g r   rê   ©rq   r®   r(  rì   s       r   ÚnearestÚIndex.nearestÅ  r  rB   c                ó   • g r   rê   r4  s       r   r5  r6  Ê  r  rB   c                ó   • g r   rê   r4  s       r   r5  r6  Ï  rñ   rB   r	   c           	     óV  • U R                   R                  [        :X  a  U R                  " USU06$ U(       a  U R	                  XU5      $ U R                  U5      u  pE[        R                  " [        R                  " U5      5      n[        R                  " [        R                  " 5       5      n[        R                  R                  U R                  UUU R                   R                  [        R                  " U5      U5        U R!                  XvR"                  R$                  5      $ )ap  Returns the ``k``-nearest objects to the given coordinates.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time pair for the
    time range as a float.

:param num_results: The number of results to return nearest to the given
    coordinates. If two index entries are equidistant, *both* are returned.
    This property means that :attr:`num_results` may return more
    items than specified

:param objects: If True, the nearest method will return index objects that
    were pickled when they were stored with each index entry, as
    well as the id and bounds of the index entries.
    If 'raw', it will return the object as entered into the database
    without the :class:`rtree.index.Item` wrapper.

.. warning::
    This is currently not implemented for the TPR-Tree.

Example of finding the three items nearest to this one::

    >>> from rtree import index
    >>> idx = index.Index()
    >>> idx.insert(4321, (34.37, 26.73, 49.37, 41.73), obj=42)
    >>> hits = idx.nearest((0, 0, 10, 10), 3, objects=True)
rì   )rF   rK   rL   Ú
_nearestTPr1  r±   r   r   r9   rô   r
   r'   ÚIndex_NearestNeighbors_idr+   r0   r!   r÷   r&   r"   r0  s           r   r5  r6  Ô  sÙ   € ðL �?‰?×Ñ¤:Ó-à—?’? KÐA¸ÑAÐAæØ×$Ñ$ [¸wÓGÐGØ×5Ñ5°kÓB‰ˆô Ÿš¤v§¢°{Ó'CÓDˆä�^Š^œFŸNšNÓ,Ó-ˆä�‰×)Ñ)Ø�K‰KØØØ�O‰O×%Ñ%Ü�LŠL˜ÓØô	
ð �}‰}˜R×!7Ñ!7×!=Ñ!=Ó>Ð>rB   c                ó¬  • SSK nU R                  X5      u  pUR                  u  pEUR                  S   UR                  -  nUR                  S   UR                  -  nUR                  SU-  UR                  S9nUR                  XCR                  S9n	[        R                  " S5      n
Su  p¼ [        R                  R                  U R                  XK-
  U[        U5      U-
  UUXS R                  R                  X+S R                  R                  XŒS R                  R                  X›S R                  R                  [        R                   " U
5      5        U
R"                  XK-
  :X  a  USU	R%                  5        U	4$ XÉX»U
R"                  -    R%                  5       -  nXºR"                  -  nUR'                  S[        U5      -  X›   -   SS9  GM'  )	a   Bulk intersection query for obtaining the ids of entries
which intersect with the provided bounding boxes.  The return
value is a tuple consisting of two 1D NumPy arrays: one of
intersecting ids and another containing the counts for each
bounding box.

:param mins: A NumPy array of shape `(n, d)` containing the
    minima to query.

:param maxs: A NumPy array of shape `(n, d)` containing the
    maxima to query.
r   Nr	   r   ©Údtype©r   r   F©Úrefcheck)ÚnumpyÚ_prepare_v_arraysÚshapeÚstridesÚitemsizeÚemptyÚint64Úuint64r   rô   r
   r'   ÚIndex_Intersects_id_vr+   rS   r×   r!   r"   ÚsumÚresize)rq   r1   r2   ÚnpÚnr>   Úd_i_striÚd_j_striÚidsÚcountsÚnrÚoffnÚoffis                r   Úintersection_vÚIndex.intersection_v  sœ  € ó 	à×+Ñ+¨DÓ7‰
ˆð �z‰z‰ˆð —<‘< ‘? d§m¡mÑ3ˆØ—<‘< ‘? d§m¡mÑ3ˆà�h‰h�q˜1‘u B§H¡HˆhÐ-ˆØ—‘˜!§9¡9�Ð-ˆÜ�^Š^˜AÓˆØ‰
ˆàÜ�G‰G×)Ñ)Ø—‘Ø‘ØÜ�C“˜4‘ØØØ�U�×"Ñ"×'Ñ'Ø�U�×"Ñ"×'Ñ'Ø�E�
×!Ñ!×&Ñ&Ø�u�×$Ñ$×)Ñ)Ü—’˜RÓ ôð �x‰x˜1™8Ó#Ø˜>˜VŸZ™Z›\Ð*¨FÐ2Ð2ð ˜t¨R¯X©X¡oÐ6×:Ñ:Ó<Ñ<�ØŸ™Ñ �à—
‘
˜1œs 3›x™<¨&©,Ñ6À�
ÑGò/ rB   )r(  Ú	max_distsÚstrictÚreturn_max_distsc               ó8  • SSK nU R                  X5      u  pUR                  u  p‰UR                  S   UR                  -  n
UR                  S   UR                  -  nUR                  Xƒ-  UR                  S9nUR                  X‡R                  S9n[        R                  " S5      nSu  nnUbb  UR                  UR                  U5      UR                  S9nUR                  S:w  a  [        S5      e[        U5      U:w  a  [        SU 35      eOU(       a  UR!                  U5      nOSn ["        R$                  R'                  U R(                  U(       d  UOU* X�-
  U	[        U5      U-
  U
UXS R                  R*                  X/S R                  R*                  UUS R                  R*                  XßS R                  R*                  Ub  UUS R                  R*                  OS[        R,                  " U5      5        UR.                  X�-
  :X  a2  U(       a  USUR1                  5        UU4$ USUR1                  5        U4$ UXßXþR.                  -    R1                  5       -  nXþR.                  -  nUR3                  S[        U5      -  Xß   -   S	S
9  GMm  )a  Bulk ``k``-nearest query for the given bounding boxes.  The
return value is a tuple consisting of, by default, two 1D NumPy
arrays: one of intersecting ids and another containing the
counts for each bounding box.

:param mins: A NumPy array of shape `(n, d)` containing the
    minima to query.

:param maxs: A NumPy array of shape `(n, d)` containing the
    maxima to query.

:param num_results: The maximum number of neighbors to return
    for each bounding box.  If there are multiple equidistant
    furthest neighbors then, by default, they are *all*
    returned.  Hence, the actual number of results can be
    greater than requested.

:param max_dists: Optional; a NumPy array of shape `(n,)`
    containing the maximum distance to consider for each
    bounding box.

:param strict: If True then each point will never return more
    than `num_results` even in cases of equidistant furthest
    neighbors.

:param return_max_dists: If True, the distance of the furthest
    neighbor for each bounding box will also be returned.
r   Nr	   r=  r?  zmax_dists must have 1 dimensionzmax_dists must have length r   Fr@  )rB  rC  rD  rE  rF  rG  rH  rI  r   rô   ÚascontiguousarrayÚ
atleast_1dÚfloat64ÚndimÚ
ValueErrorrS   Úzerosr
   r'   ÚIndex_NearestNeighbors_id_vr+   r×   r!   r"   rK  rL  )rq   r1   r2   r(  rX  rY  rZ  rM  rN  r>   rO  rP  rQ  rR  rS  rT  rU  Údistss                     r   Ú	nearest_vÚIndex.nearest_vO  sX  € óL 	à×+Ñ+¨DÓ7‰
ˆð �z‰z‰ˆð —<‘< ‘? d§m¡mÑ3ˆØ—<‘< ‘? d§m¡mÑ3ˆà�h‰h�q‘¨b¯h©hˆhÐ7ˆØ—‘˜!§9¡9�Ð-ˆÜ�^Š^˜AÓˆØ‰
ˆˆdàÑ Ø×(Ñ(¨¯©°yÓ)AÈÏÉÐ(ÐTˆEØ�z‰z˜Q‹Ü Ð!BÓCÐCÜ�5‹z˜Q‹Ü Ð#>¸q¸cÐ!BÓCÐCð æØ—H‘H˜Q“K‰EàˆEàÜ�G‰G×/Ñ/Ø—‘Þ#)‘°¨|Ø‘ØÜ�C“˜4‘ØØØ�U�×"Ñ"×'Ñ'Ø�U�×"Ñ"×'Ñ'Ø�D�E�
×!Ñ!×&Ñ&Ø�u�×$Ñ$×)Ñ)Ø,1Ñ,=��d�e�×#Ñ#×(Ò(À4Ü—’˜RÓ ôð" �x‰x˜1™8Ó#Þ#Ø˜~ §¡£Ð.°¸Ð=Ð=à˜~ §¡£Ð.°Ð6Ð6ð ˜ d¯X©X¡oÐ6×:Ñ:Ó<Ñ<�ØŸ™Ñ �à—
‘
˜1œs 3›x™<¨&©,Ñ6À�
ÑGò9 rB   c                óÈ  ^• SS K nTUL a-  UR                  T5      R                  UR                  5      =mnOTUR                  T5      R                  UR                  5      mUR                  U5      R                  UR                  5      nTR                  S:w  d  UR                  S:w  a  [        S5      eTR                  UR                  :w  a  [        S5      eTR                  UR                  :w  a  [        S5      e[        U4S jTR                   5       5      (       a;  TUL a  TR                  5       =mnTU4$ TR                  5       mUR                  5       nTU4$ )Nr   r   z(mins/maxs must have 2 dimensions: (n, d)zmins and maxs shapes not equalzmins and maxs strides not equalc              3  ó@   >#   • U  H  oTR                   -  v •  M     g 7fr   )rF  )r   r@   r1   s     €r   r   Ú*Index._prepare_v_arrays.<locals>.<genexpr>À  s   øé € Ð7ª, Q�4—=‘=Ö ª,ùs   ƒ)
rB  Ú
atleast_2dÚastyper^  r_  r`  rD  rE  Úanyr’   )rq   r1   r2   rM  s    `  r   rC  ÚIndex._prepare_v_arrays®  s   ø€ Ûð �4Š<ØŸ-™-¨Ó-×4Ñ4°R·Z±ZÓ@Ð@ˆD‘4à—=‘= Ó&×-Ñ-¨b¯j©jÓ9ˆDØ—=‘= Ó&×-Ñ-¨b¯j©jÓ9ˆDà�9‰9˜‹>˜TŸY™Y¨!›^ÜÐGÓHÐHØ�:‰:˜Ÿ™Ó#ÜÐ=Ó>Ð>Ø�<‰<˜4Ÿ<™<Ó'ÜÐ>Ó?Ð?ô Ô7¨$¯,ª,Ó7×7Ñ7Ø�tŠ|Ø"Ÿi™i›kÐ)��tð
 �TˆzÐð —y‘y“{�Ø—y‘y“{�à�TˆzÐrB   c                ó  • U R                  U5      u  pgU R                  U5      u  p‰U R                  U5      u  p«[        R                  " [        R                  " U5      5      nU(       aD  [        R                  " [        R
                  " 5       5      n[        R                  R                  nOC[        R                  " [        R                  " 5       5      n[        R                  R                  nU" U R                  UUUU	U
UU R                  R                  [        R                  " U5      U5
        U(       a&  U R                  XÜR                   R"                  U5      $ U R%                  XÜR                   R"                  5      $ r   )r±   r·   r   r   r9   r)   r
   r'   ÚIndex_TPNearestNeighbors_objrô   ÚIndex_TPNearestNeighbors_idr+   rF   r0   r!   r  r&   r"   r÷   )rq   r®   rÛ   r´   r(  rì   r5   r6   rÝ   rÞ   rµ   r¶   rä   rù   r  s                  r   r:  ÚIndex._nearestTPÉ  s  € Ø×5Ñ5°kÓB‰ˆØ×7Ñ7¸
ÓCÑˆØ×/Ñ/°Ó6‰ˆäŸš¤v§¢°{Ó'CÓDˆæÜ—’¤§¢Ó 1Ó2ˆBÜ—7‘7×7Ñ7‰Dä—’¤§¢Ó 0Ó1ˆBÜ—7‘7×6Ñ6ˆDáØ�K‰KØØØØØØØ�O‰O×%Ñ%Ü�LŠL˜ÓØô	
ö Ø×$Ñ$ R×)?Ñ)?×)EÑ)EÀwÓOÐOà—=‘= ×%;Ñ%;×%AÑ%AÓBÐBrB   c                ó~   • Uc  U R                   n[        U R                  [        R                  R
                  U5      $ )ac  Returns the bounds of the index

:param coordinate_interleaved: If True, the coordinates are turned
    in the form [xmin, ymin, ..., kmin, xmax, ymax, ..., kmax],
    otherwise they are returned as
    [xmin, xmax, ymin, ymax, ..., ..., kmin, kmax].  If not specified,
    the :attr:`interleaved` member of the index is used, which
    defaults to True.
)r-   r7   r+   r
   r'   ÚIndex_GetBounds)rq   Úcoordinate_interleaveds     r   Ú
get_boundsÚIndex.get_boundsé  s4   € ð "Ñ)Ø%)×%5Ñ%5Ð"Ü˜4Ÿ;™;¬¯©×(?Ñ(?ÐAWÓXÐXrB   c                ó
  • U R                   R                  [        :X  a  U R                  " U/UQ76 $ U R	                  U5      u  p4[
        R                  R                  U R                  XX@R                   R                  5        g)a1  Deletes an item from the index with the given ``'id'`` and
   coordinates given by the ``coordinates`` sequence. As the index can
   contain multiple items with the same ID and coordinates, deletion
   is not guaranteed to delete all items in the index with the given ID
   and coordinates.

:param id: A long integer ID for the entry, which need not be unique. The
    index can contain multiple entries with identical IDs and
    coordinates. Uniqueness of items should be enforced at the
    application level by the user.

:param coordinates: Dimension * 2 coordinate pairs, representing the min
    and max coordinates in each dimension of the item to be
    deleted from the index. Their ordering will depend on the
    index's :attr:`interleaved` data member.
    These are not the coordinates of a space containing the
    item, but those of the item itself. Together with the
    id parameter, they determine which item will be deleted.
    This may be an object that satisfies the numpy array protocol.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time pair for the
    original time the object was inserted and the current time
    as a float.

Example::

    >>> from rtree import index
    >>> idx = index.Index()
    >>> idx.delete(4321,
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734))

For the TPR-Tree::

    >>> p = index.Property(type=index.RT_TPRTree)  # doctest: +SKIP
    >>> idx = index.Index(properties=p)  # doctest: +SKIP
    >>> idx.delete(4321,
    ...            ((34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...             (0.5, 2, 1.5, 2.5),
    ...             (3.0, 5.0)))  # doctest: +SKIP

N)
rF   rK   rL   Ú	_deleteTPr±   r
   r'   ÚIndex_DeleteDatar+   r0   )rq   rÖ   r®   r5   r6   s        r   ÚdeleteÚIndex.deleteù  sd   € ðZ �?‰?×Ñ¤:Ó-Ø—>’> "Ð3 {Ò3Ð3Ø×5Ñ5°kÓB‰ˆÜ�‰× Ñ Ø�K‰K˜ V¯_©_×-FÑ-Fõ	
rB   c                ó   • U R                  U5      u  pVU R                  U5      u  pxU R                  U5      u  pš[        R                  R	                  U R
                  UUUUUU	U
U R                  R                  5	        g r   )r±   r·   r
   r'   ÚIndex_DeleteTPDatar+   rF   r0   )rq   rÖ   r®   rÛ   r´   r5   r6   rÝ   rÞ   rµ   r¶   s              r   rw  ÚIndex._deleteTP-  sv   € ð ×5Ñ5°kÓB‰ˆØ×7Ñ7¸
ÓCÑˆØ×/Ñ/°Ó6‰ˆÜ�‰×"Ñ"Ø�K‰KØØØØØØØØ�O‰O×%Ñ%õ
	
rB   c                óf   • [        [        R                  R                  U R                  5      5      $ r   )rO   r
   r'   ÚIndex_IsValidr+   r‚   s    r   ÚvalidÚIndex.validC  s    € Ü”D—G‘G×)Ñ)¨$¯+©+Ó6Ó7Ð7rB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndex_ClearBufferr+   r‚   s    r   ÚclearBufferÚIndex.clearBufferF  s   € Ü�w‰w×(Ñ(¨¯©Ó5Ð5rB   c                ó°   • [        U5      S-  S:X  d   S5       e[        U5      S-  n/ n[        U5       H  nUR                  X   XU-      /5        M     U$ )z³
[xmin, ymin, xmax, ymax] => [xmin, xmax, ymin, ymax]

>>> Index.deinterleave([0, 10, 1, 11])
[0, 1, 10, 11]

>>> Index.deinterleave([0, 1, 2, 10, 11, 12])
[0, 10, 1, 11, 2, 12]

r   r   úmust be a pairwise list©rS   r%   Úextend)rq   r-   r0   Údir3   s        r   r*   ÚIndex.deinterleaveI  sd   € ô �;Ó !Ñ# qÓ(ÐCÐ*CÓCÐ(Ü˜Ó$¨Ñ)ˆ	ØˆÜ�yÖ!ˆAØ�I‰I�{‘~ {°y±=Ñ'AÐBÖCñ "àˆ	rB   c           	     óÞ   • [        U5      S-  S:X  d   S5       e/ n[        S5       H=  nUR                  [        S[        U5      S5       Vs/ s H	  oAX4-      PM     sn5        M?     U$ s  snf )a  
[xmin, xmax, ymin, ymax, zmin, zmax]
    => [xmin, ymin, zmin, xmax, ymax, zmax]

>>> Index.interleave([0, 1, 10, 11])
[0, 10, 1, 11]

>>> Index.interleave([0, 10, 1, 11, 2, 12])
[0, 1, 2, 10, 11, 12]

>>> Index.interleave((-1, 1, 58, 62, 22, 24))
[-1, 58, 22, 1, 62, 24]

r   r   r‡  rˆ  )rq   Údeinterleavedr-   r3   r  s        r   Ú
interleaveÚIndex.interleave\  sx   € ô  �=Ó! AÑ%¨Ó*ÐEÐ,EÓEÐ*àˆÜ�q–ˆAØ×ÑÜ/4°Q¼¸MÓ8JÈAÔ/NÓOÒ/N¨!˜q™uÔ%Ñ/NÑOöñ ð Ðùò Ps   ÁA*
c                óÖ  ^ ^^^^^• [        U5      mT R                  R                  m[        R                  T-  nU" 5       mU" 5       m[        R
                  " [        R                  " [        R                  " S5      5      [        R                  " [        R                  5      5      mUUUUU U4S jn[        R                  " U5      n[        T R                  R                  U5      $ )zPThis function is used to instantiate the index given an
iterable stream of data.r   c                óÌ  >•  [        T5      u  U S'   pgTR                  (       a  UST TSS& UTS TSS& OUSSS2   TSS& USSS2   TSS& TUS'   TUS'   TUS'   Uc  TUS'   SUS'   gTR                  U5      u  US'   pš[        R                  " U	[        R                  " [        R                  5      5      US'   g! [         a     g[         a  nUTl         SnAgSnAff = f)zýThis function must fill pointers to individual entries that will
be added to the index.  The C API will actually call this function
to fill out the pointers.  If this function returns anything other
than 0, it is assumed that the stream of data is done.r   éÿÿÿÿNr   r	   )
ÚnextÚStopIterationÚ	Exceptionrj   r-   r½   r   r#   r$   rÔ   )Úp_idr5   r6   Úp_dimensionÚp_dataÚp_lengthr®   rŸ   Úexcr×   rß   r0   r2   r1   Úno_datarq   Ústream_iters              €€€€€€r   Úpy_next_itemÚ3Index._create_idx_from_stream.<locals>.py_next_item‚  s	  ø€ ðÜ,0°Ó,=Ñ)��Q‘˜ð ××Ø% j yÐ1�‘Q�Ø% i jÐ1�‘Q‘à%¡c¨ cÑ*�‘Q�Ø% a d¨ dÑ+�‘Q�àˆF�1‰IØˆF�1‰Ið 'ˆK˜‰NØ‰{Ø#��q‘	Ø�˜‘ð
 ð (,§¡°sÓ';Ñ$�˜‘˜TÜ"ŸKšK¨¬f¯nªn¼V¿^¹^Ó.LÓM��q‘	àøô5 !ó áÜó Ø"%�”Üûðús   ƒB= Â=
C#Ã		C#ÃCÃC#)ÚiterrF   r0   r   r   r#   r   rÔ   r$   r
   ÚNEXTFUNCÚIndexStreamHandler+   )	rq   rt   Údarrayr�  r0   r2   r1   r›  rœ  s	   `   @@@@@r   rk   ÚIndex._create_idx_from_streamu  s�   ý€ ô ˜6“lˆØ—O‘O×-Ñ-ˆ	Ü—‘ 9Ñ,ˆÙ‹xˆÙ‹xˆÜ—+’+Ü�NŠNœ6Ÿ>š>¨!Ó,Ó-¬v¯~ª~¼f¿n¹nÓ/Mó
ˆ÷"	ò "	ôH —’˜|Ó,ˆÜ  §¡×!7Ñ!7¸Ó@Ð@rB   c                ó˜  • SS K nUR                  UR                  5      nU R                  X#5      u  p#[	        U5      [	        U5      :w  a  [        S5      eUR                  S   UR                  -  (       a  UR                  5       nUR                  u  pVUR                  S   UR                  -  nUR                  S   UR                  -  nUR                  S   UR                  -  n	[        U R                  R                  UUUUU	UR                  R                  UR                  R                  UR                  R                  5	      $ )Nr   z index and point counts differentr	   )rB  rj  rH  rC  rS   r`  rE  rF  r’   rD  ÚIndexArrayHandlerF   r+   r   r×   )
rq   ÚibufÚminbufÚmaxbufrM  rN  r>   Úi_strirO  rP  s
             r   rl   ÚIndex._create_idx_from_array©  s  € Ûð �{‰{˜2Ÿ8™8Ó$ˆØ×/Ñ/°Ó?‰ˆäˆt‹9œ˜F›Ó#ÜÐ?Ó@Ð@ð �<‰<˜‰?˜TŸ]™]×*Ø—9‘9“;ˆDð �|‰|‰ˆð —‘˜a‘ D§M¡MÑ1ˆØ—>‘> !Ñ$¨¯©Ñ7ˆØ—>‘> !Ñ$¨¯©Ñ7ˆäØ�O‰O×"Ñ"ØØØØØØ�K‰K×ÑØ�M‰M×ÑØ�M‰M×Ñó

ð 
	
rB   c                ó|  • [         R                  " 5       n[         R                  " [         R                  " 5       5      n[         R                  " [         R                  " 5       5      n[         R                  " [         R                  " [         R                  " 5       5      5      n[         R                  " [         R                  " [         R                  " 5       5      5      n[         R                  " [         R                  " [         R                  " 5       5      5      n[         R                  " S5      n[
        R                  R                  U R                  [         R                  " U5      [         R                  " U5      [         R                  " U5      [         R                  " U5      [         R                  " U5      [         R                  " U5      [         R                  " U5      5        / nUR                  n	[         R                  " U[         R                  " [         R                  U	-  5      5      n
[         R                  " U[         R                  " [         R                  U	-  5      5      n[         R                  " U[         R                  " [         R                  " [         R                  5      U	-  5      5      n[         R                  " U[         R                  " [         R                  " [         R                  5      U	-  5      5      n[         R                  " U[         R                  " [         R                  " [         R                  5      U	-  5      5      n[        U	5       GH;  nUR                  U   nUR                  U   nU
R                  U   n[         R                  " U[         R                  " [         R                  U-  5      5      n/ n[        U5       H!  nUR                  UR                  U   5        M#     [
        R                  R!                  [         R                  " U[         R                  " [         R"                  5      5      5        UR                  U   nUR                  U   n[         R                  " U[         R                  " [         R                  UR                  -  5      5      n[         R                  " U[         R                  " [         R                  UR                  -  5      5      n/ n[        UR                  5       Vs/ s H  nUR                  U   PM     nnU[        UR                  5       Vs/ s H  nUR                  U   PM     sn-  n[         R                  " U[         R                  " [         R                  5      5      n[         R                  " U[         R                  " [         R                  5      5      n[
        R                  R!                  [         R                  " U[         R                  " [         R"                  5      5      5        [
        R                  R!                  [         R                  " U[         R                  " [         R"                  5      5      5        UR                  UUU45        GM>     U$ s  snf s  snf r   )r   r    r   rô   r   r
   r'   ÚIndex_GetLeavesr+   r!   r"   r#   r$   r%   r&   rÿ   r(   r)   )rq   Úleaf_node_countÚp_leafsizesÚ	p_leafidsÚpp_childidsr.   r/   r0   Úoutputr‡   ÚsizesrQ  Úchildr1   r2   r3   Úp_child_idsrÖ   r¼   Úchild_ids_arrayÚ	child_idsr  r5   r6   rˆ   s                            r   ÚleavesÚIndex.leavesË  s/  € Ü Ÿ/š/Ó+ˆÜ—n’n¤V§_¢_Ó%6Ó7ˆÜ—N’N¤6§>¢>Ó#3Ó4ˆ	Ü—n’n¤V§^¢^´F·N²NÓ4DÓ%EÓFˆä—.’.¤§¢´·²Ó0AÓ!BÓCˆÜ—.’.¤§¢´·²Ó0AÓ!BÓCˆÜ—O’O AÓ&ˆ	ä�‰×ÑØ�K‰KÜ�LŠL˜Ó)Ü�LŠL˜Ó%Ü�LŠL˜Ó#Ü�LŠL˜Ó%Ü�LŠL˜Ó!Ü�LŠL˜Ó!Ü�LŠL˜Ó#ô		
ð ˆà×%Ñ%ˆÜ—’˜K¬¯ª¼¿¹È%Ñ8OÓ)PÓQˆÜ�kŠk˜)¤V§^¢^´F·N±NÀUÑ4JÓ%KÓLˆÜ—’ØœŸš¬¯ª´v·~±~Ó(FÈÑ(NÓOó
ˆô �{Š{Ø”V—^’^¤F§N¢N´6·?±?Ó$CÀeÑ$KÓLó
ˆô �{Š{Ø”V—^’^¤F§N¢N´6·?±?Ó$CÀeÑ$KÓLó
ˆô �u—ˆAØŸ.™.¨Ñ+ˆKà—‘˜a‘ˆBØ—>‘> !Ñ$ˆDÜ$ŸkškØœVŸ^š^¬F¯N©N¸TÑ,AÓBóˆOð ˆIÜ˜4–[�Ø× Ñ  ×!9Ñ!9¸!Ñ!<Ö=ñ !ô �G‰G×ÑÜ—’˜K¬¯ª¼¿¹Ó)HÓIôð —]‘] 1Ñ%ˆFØ—]‘] 1Ñ%ˆFä—[’[ØœŸš¤v§¡¸¿¹Ñ'HÓIóˆFô —[’[ØœŸš¤v§¡¸¿¹Ñ'HÓIóˆFð ˆFÜ27¸	¿¹Ô2HÓIÒ2H¨Q�f—o‘o aÔ(Ñ2HˆFÐIØ´5¸¿¹Ô3IÓJÒ3I¨a�v—‘ qÔ)Ñ3IÑJÑJˆFô —[’[ ¬¯ª¼¿¹Ó)HÓIˆFÜ—[’[ ¬¯ª¼¿¹Ó)HÓIˆFÜ�G‰G×ÑœvŸ{š{¨6´6·>²>Ä&Ç/Á/Ó3RÓSÔTÜ�G‰G×ÑœvŸ{š{¨6´6·>²>Ä&Ç/Á/Ó3RÓSÔTà�M‰M˜2˜y¨&Ð1×2ñM ðP ˆùò JùÚJs   Ô*Z4ÕZ9)rj   rf   r+   r-   rF   ©rr   r   rs   r   ÚreturnÚNone©rº  r   ©rº  rQ   ©rº  údict[str, Any]©r”   r¿  rº  r»  )rŸ   r  rº  rR   )r£   rR   rº  r  ©rº  r»  )r®   úSequence[float]rº  ztuple[float, float]r   )rÖ   r   r®   r   rŸ   r  rº  r»  )rÖ   r   r®   rÂ  rÛ   rÂ  rÜ   ÚfloatrŸ   r  rº  r»  )r®   r   rº  r   )r®   rÂ  rÛ   rÂ  r´   rÃ  rº  r   )r®   r   rì   úLiteral[True]rº  úIterator[Item]©F)r®   r   rì   úLiteral[False]rº  zIterator[int] | None)r®   r   rì   úLiteral['raw']rº  úIterator[object])r®   r   rì   úbool | Literal['raw']rº  z$Iterator[Item | int | object] | None)r  r   rº  r   )r®   r   rì   rÇ  rº  úIterator[int])r®   r   rì   rÊ  rº  úIterator[Item | int | object])r®   r   )r®   r   r(  r   rì   rÄ  rº  rÅ  )r®   r   r(  r   rì   rÇ  rº  rË  )r®   r   r(  r   rì   rÈ  rº  rÉ  ©r	   F)r®   r   r(  r   rì   rÊ  rº  rÌ  )rÖ   r   r®   r   rº  r»  )
rÖ   r   r®   rÂ  rÛ   rÂ  r´   rÃ  rº  r»  )rº  rO   )r-   zSequence[object]rº  zlist[object])r�  rÂ  rº  úlist[float])<Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r|   rƒ   r‰   rŽ   r•   r™   r�   r¢   r§   rª   r±   Ústaticmethodr·   r½   rÂ   rÇ   ÚpropertyÚresult_limitrÌ   rÐ   Úresult_offsetrp   ÚaddrÓ   r‡   râ   r   rí   r  r  rý   r  r  ró   r  r÷   r1  r5  rV  rd  rC  r:  rt  rˆ   ry  rw  r€  r„  Úclassmethodr*   rŽ  rk   rl   r·  Ú__static_attributes__rê   rB   r   r   r   N   s  † Ù:ô\Sô|ôôLôô
:ô!ô$ô.ô ð
"Ø*ð"à	ô"ðH ñó ðò	PòDò=ñ Ð,Ð.>Ó?€LòCò<ñ Ð.Ð0AÓB€Mö7
ðr €Cð ð
àð
ð %ð
ð $ð	
ð
 ð
ð ð
ð 
õ
ô<8#ðt#Ø*ð#Ø8Gð#ØPUð#à	ô#ð. ÛWó ØWàà:?ð#Øð#Ø)7ð#à	ô#ó ð#ð ðØðØ)7ðà	óó ðð
 BGðA6ØðA6Ø)>ðA6à	-õA6ôF+ôZð. ðØðØ)6ðà	óó ðð à:?ðØðØ)7ðà	ôó ðð ðØðØ)7ðà	óó ðð
 BGðU6ØðU6Ø)>ðU6à	&õU6ôn:ò@Cô"Cò,>ò,
$òLð$ ðØðØ-0ðØ;Hðà	óó ðð àLQðØðØ-0ðØ;Iðà	ôó ðð ðØðØ-0ðØ;Iðà	óó ðð Ø).ð	C?àðC?ð ðC?ð 'ð	C?ð
 
'õC?òJ4Hðv ØØØõ]Hò~ô6Cô@Yñ �jÓ!€Fô2
ðh
àð
ð %ð
ð $ð	
ð
 ð
ð 
ô
ô,8ò6ð óó ðð$ óó ðò02Aòh 
õDKrB   r   c                  óX   • \ rS rSrSrSrSSS jjrSS jrSS jr\	SS j5       r
S rS	rg
)r&  i  zA container for index entries)r+   ÚownedrÖ   r  rˆ   c                ó(  • U(       a  X l         X0l        [        R                  R	                  U R                   5      U l        SU l        U R                  U5      U l        [        U R                   [        R                  R                  S5      U l
        g)zçThere should be no reason to instantiate these yourself. Items are
created automatically when you call
:meth:`rtree.index.Index.intersection` (or other index querying
methods) with objects=True given the parameters of the function.NF)r+   rÜ  r
   r'   ÚIndexItem_GetIDrÖ   r  Ú
get_objectr7   ÚIndexItem_GetBoundsrˆ   )rq   r¢   r+   rÜ  s       r   r|   ÚItem.__init__"  s`   € ö Ø ŒKàŒ
ä—'‘'×)Ñ)¨$¯+©+Ó6ˆŒàˆŒØ—o‘o eÓ,ˆŒÜ! $§+¡+¬t¯w©w×/JÑ/JÈEÓRˆ�rB   c                ó4   • U R                   UR                   :  $ r   ©rÖ   ©rq   r  s     r   Ú__lt__ÚItem.__lt__3  ó   € Ø�w‰w˜Ÿ™Ñ!Ð!rB   c                ó4   • U R                   UR                   :„  $ r   rã  rä  s     r   Ú__gt__ÚItem.__gt__6  rç  rB   c                ó@   • [         R                  U R                  5      $ )z+Returns the bounding box of the index entry)r   rŽ  rˆ   r‚   s    r   rþ   Ú	Item.bbox9  s   € ô ×Ñ §¡Ó,Ð,rB   c                óv   • U R                   b  U R                   $ [        U R                  5      nUc  g U" U5      $ r   )r  rA   r+   )rq   r¢   r×   s      r   rß  ÚItem.get_object>  s6   € à�;‰;Ñ"Ø—;‘;ÐÜ˜Ÿ™Ó%ˆØ‰<ØÙ�T‹{ÐrB   )rˆ   r+   rÖ   r  rÜ  NrÆ  rÁ  )r  r&  rº  rO   )rº  rÎ  )rÏ  rÐ  rÑ  rÒ  rÓ  Ú	__slots__r|   rå  ré  rÕ  rþ   rß  rÚ  rê   rB   r   r&  r&    s3   † Ù'à=€IöSô""ô"ð ó-ó ð-õrB   r&  c                  ó   • \ rS rSrSrSrg)ÚInvalidHandleExceptioniH  z3Handle has been destroyed and can no longer be usedrê   N)rÏ  rÐ  rÑ  rÒ  rÓ  rÚ  rê   rB   r   rñ  rñ  H  s   † Ü=rB   rñ  c                  óR   • \ rS rSrS
S jrSS jrS rSS jr\S 5       r	SS jr
Srg	)ÚHandleiL  c                ó2   • U R                   " U0 UD6U l        g r   )Ú_createÚ_ptr©rq   rr   rs   s      r   r|   ÚHandle.__init__M  s   € Ø—L’L $Ð1¨&Ñ1ˆ�	rB   c                ó   • [         er   ©rn   r÷  s      r   rõ  ÚHandle._createP  ó   € Ü!Ð!rB   c                ó   • [         er   rú  )rq   Úptrs     r   Ú_destroyÚHandle._destroyS  rü  rB   c                ó†   •  U R                   b#  U R                  U R                   5        S U l         g g ! [         a     g f = fr   )rö  rÿ  rö   r‚   s    r   r¦   ÚHandle.destroyV  sA   € ð	Ø�y‰yÑ$Ø—‘˜dŸi™iÔ(Ø �•	ð %øô ó 	Ùð	ús   ‚/3 ³
A ¿A c                ó@   • U R                   c  [        eU R                   $ r   )rö  rñ  r‚   s    r   Ú_as_parameter_ÚHandle._as_parameter_^  s   € à�9‰9ÑÜ(Ð(Ø�y‰yÐrB   c                óF   •  U R                  5         g ! [         a     g f = fr   )r¦   rm   r‚   s    r   Ú__del__ÚHandle.__del__d  s$   € ð	Ø�L‰L�NøÜó 	ñ
 ð	ús   ‚ “
 Ÿ )rö  Nr¹  )rr   r   rs   r   rÁ  )rÏ  rÐ  rÑ  rÒ  r|   rõ  rÿ  r¦   rÕ  r  r  rÚ  rê   rB   r   ró  ró  L  s/   † ô2ô"ò"ôð ñó ð÷
rB   ró  c                  óv   • \ rS rSr\R
                  R                  r\R
                  R                  r	SS jr
Srg)ro   io  c                óÈ   •  [         R                  R                    U R                  b*  [         R                  R                  U R                  5        g g ! [         a     g f = fr   )r
   r'   ÚIndex_Flushrö  rö   r‚   s    r   rª   ÚIndexHandle.flushs  sK   € ð	Ü�G‰G×ÒØ�y‰yÑ$Ü—‘×#Ñ# D§I¡IÕ.ð %øäó 	Ùð	ús   ‚AA Á
A!Á A!rê   NrÁ  )rÏ  rÐ  rÑ  rÒ  r
   r'   ÚIndex_Createrõ  ÚIndex_Destroyrÿ  rª   rÚ  rê   rB   r   ro   ro   o  s%   † Ø�g‰g×"Ñ"€GØ�w‰w×$Ñ$€H÷rB   ro   c                  ó@   • \ rS rSr\R
                  R                  rSrg)r¡  i|  rê   N)	rÏ  rÐ  rÑ  rÒ  r
   r'   ÚIndex_CreateWithStreamrõ  rÚ  rê   rB   r   r¡  r¡  |  s   † Ø�g‰g×,Ñ,ƒGrB   r¡  c                  ó@   • \ rS rSr\R
                  R                  rSrg)r¥  i‚  rê   N)	rÏ  rÐ  rÑ  rÒ  r
   r'   ÚIndex_CreateWithArrayrõ  rÚ  rê   rB   r   r¥  r¥  ‚  s   † Ø—'‘'×/Ñ/‹rB   r¥  c                  ól   • \ rS rSr\R
                  R                  r\R
                  R                  r	Sr
g)ÚPropertyHandleiˆ  rê   N)rÏ  rÐ  rÑ  rÒ  r
   r'   ÚIndexProperty_Createrõ  ÚIndexProperty_Destroyrÿ  rÚ  rê   rB   r   r  r  ˆ  s    † Ø�g‰g×*Ñ*€GØ�w‰w×,Ñ,ƒHrB   r  c                  óø  • \ rS rSrSrSrS?S@S jjrSAS jrSBS jrS r	SCS	 jr
SDS
 jrSDS jrSES jrSFS jr\" \\5      r SES jrSFS jr\" \\5      r SES jrSFS jr\" \\5      r SES jrSFS jr\" \\5      r SES jrSFS jr\" \\5      r SES jrSFS jr\" \\5      r SES jr SFS jr!\" \ \!5      r" SES jr#SFS jr$\" \#\$5      r% SES jr&SFS jr'\" \&\'5      r( SES jr)SFS jr*\" \)\*5      r+ SES  jr,SFS! jr-\" \,\-5      r. S" r/S# r0\" \/\05      r1 S$ r2S% r3\" \2\35      r4 SES& jr5SFS' jr6\" \5\65      r7 S( r8S) r9\" \8\95      r: SES* jr;SFS+ jr<\" \;\<5      r= SES, jr>SFS- jr?\" \>\?5      r@ S. rAS/ rB\" \A\B5      rC S0 rDS1 rE\" \D\E5      rF S2 rGS3 rH\" \G\H5      rI S4 rJS5 rK\" \J\K5      rL S6 rMS7 rN\" \M\N5      rO SES8 jrPSFS9 jrQ\" \P\Q5      rR S: rSS; rT\" \S\T5      rU S< rVS= rW\" \V\W5      rXS>rYg)Gr   i�  z×An index property object is a container that contains a number of
settable index properties.  Many of these properties must be set at
index creation times, while others can be used to adjust performance
or behavior.)Úbuffering_capacityÚcustom_storage_callbacksÚcustom_storage_callbacks_sizeÚdat_extensionr0   rX   Úfill_factorrY   Úindex_capacityr^   Úleaf_capacityÚnear_minimum_overlap_factorrH   rI   Úpoint_pool_capacityÚregion_pool_capacityÚreinsert_factorÚsplit_distribution_factorrW   Ú	tight_mbrÚtpr_horizonrK   ÚvariantÚwritethroughNc                óL   • Uc
  [        5       nXl        U R                  U5        g r   ©r  r+   Úinitialize_from_dict)rq   r+   rÜ  rs   s       r   r|   ÚProperty.__init__®  s"   € Ø‰>Ü#Ó%ˆFØŒØ×!Ñ! &Õ)rB   c                óä   • UR                  5        H  u  p#Uc  M
  [        XU5        M     SU;  a@  U R                  n[        U R                  U R
                  5      nXE:¼  a  US-  S-   U l        g g g )Nr  é   r	   )r)  Úsetattrr  r  r  r  )rq   r”   ÚkÚvÚnmofÚilcs         r   r*  ÚProperty.initialize_from_dict´  so   € Ø—K‘K–M‰DˆAØ‹}Ü˜ Ö#ñ "ð
 )°Ó5Ø×3Ñ3ˆDÜ�d×)Ñ)¨4×+=Ñ+=Ó>ˆCØ‹{Ø36¸!±8¸a±<�Õ0ð ð 6rB   c                ó"   • U R                  5       $ r   )Úas_dictr‚   s    r   r•   ÚProperty.__getstate__À  s   € Ø�|‰|‹~ÐrB   c                óD   • [        5       U l        U R                  U5        g r   r)  r“   s     r   r™   ÚProperty.__setstate__Ã  s   € Ü$Ó&ˆŒØ×!Ñ! %Õ(rB   c                ót   • 0 nU R                    H  n [        X5      nX1U'   M     U$ ! [         a    S n Nf = fr   )ÚpkeysÚgetattrr   )rq   r>   r/  r0  s       r   r5  ÚProperty.as_dictÇ  sJ   € ØˆØ—”ˆAðÜ˜DÓ$�ð ˆa‹Dñ ð ˆøô ó Ø’ðús   “(¨7¶7c                ó4   • [        U R                  5       5      $ r   )Úreprr5  r‚   s    r   rŽ   ÚProperty.__repr__Ñ  s   € Ü�D—L‘L“NÓ#Ð#rB   c                óJ   • [         R                  " U R                  5       5      $ r   )ÚpprintÚpformatr5  r‚   s    r   Ú__str__ÚProperty.__str__Ô  s   € Ü�~Š~˜dŸl™l›nÓ-Ð-rB   c                óž   •  U R                   $ ! [         a4    [        R                  R	                  U R
                  5      nXl         Us $ f = fr   )Ú_typerö   r
   r'   ÚIndexProperty_GetIndexTyper+   )rq   rK   s     r   Úget_index_typeÚProperty.get_index_type×  sB   € ð	Ø—:‘:ÐøÜó 	Ü—7‘7×5Ñ5°d·k±kÓBˆDØ"ŒJØŠKð	úó   ‚ Ž;AÁAc                ób   • Xl         [        R                  R                  U R                  U5      $ r   )rF  r
   r'   ÚIndexProperty_SetIndexTyper+   rÁ   s     r   Úset_index_typeÚProperty.set_index_typeß  s"   € ØŒ
Ü�w‰w×1Ñ1°$·+±+¸uÓEÐErB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetIndexVariantr+   r‚   s    r   Úget_variantÚProperty.get_variantè  ó   € Ü�w‰w×4Ñ4°T·[±[ÓAÐArB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndexProperty_SetIndexVariantr+   rÁ   s     r   Úset_variantÚProperty.set_variantë  ó   € Ü�w‰w×4Ñ4°T·[±[À%ÓHÐHrB   c                óž   •  U R                   $ ! [         a4    [        R                  R	                  U R
                  5      nXl         Us $ f = fr   )Ú
_dimensionrö   r
   r'   ÚIndexProperty_GetDimensionr+   )rq   Údims     r   Úget_dimensionÚProperty.get_dimensionò  sB   € ð	Ø—?‘?Ð"øÜó 	Ü—'‘'×4Ñ4°T·[±[ÓAˆCØ#&ŒOØŠJð	úrJ  c                ó„   • US::  a  [        S5      eXl        [        R                  R	                  U R
                  U5      $ )Nr   z1Negative or 0 dimensional indexes are not allowed)r   rZ  r
   r'   ÚIndexProperty_SetDimensionr+   rÁ   s     r   Úset_dimensionÚProperty.set_dimensionú  s5   € Ø�A‹:ÜÐPÓQÐQØŒÜ�w‰w×1Ñ1°$·+±+¸uÓEÐErB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetIndexStorager+   r‚   s    r   Úget_storageÚProperty.get_storage  rS  rB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndexProperty_SetIndexStorager+   rÁ   s     r   Úset_storageÚProperty.set_storage  rX  rB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetPagesizer+   r‚   s    r   Úget_pagesizeÚProperty.get_pagesize  s   € Ü�w‰w×0Ñ0°·±Ó=Ð=rB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   zPagesize must be > 0)r   r
   r'   ÚIndexProperty_SetPagesizer+   rÁ   s     r   Úset_pagesizeÚProperty.set_pagesize  s0   € Ø�A‹:ÜÐ3Ó4Ð4Ü�w‰w×0Ñ0°·±¸eÓDÐDrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetIndexCapacityr+   r‚   s    r   Úget_index_capacityÚProperty.get_index_capacity   s   € Ü�w‰w×5Ñ5°d·k±kÓBÐBrB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   zindex_capacity must be > 0)r   r
   r'   ÚIndexProperty_SetIndexCapacityr+   rÁ   s     r   Úset_index_capacityÚProperty.set_index_capacity#  s0   € Ø�A‹:ÜÐ9Ó:Ð:Ü�w‰w×5Ñ5°d·k±kÀ5ÓIÐIrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetLeafCapacityr+   r‚   s    r   Úget_leaf_capacityÚProperty.get_leaf_capacity+  rS  rB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   zleaf_capacity must be > 0)r   r
   r'   ÚIndexProperty_SetLeafCapacityr+   rÁ   s     r   Úset_leaf_capacityÚProperty.set_leaf_capacity.  s0   € Ø�A‹:ÜÐ8Ó9Ð9Ü�w‰w×4Ñ4°T·[±[À%ÓHÐHrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú"IndexProperty_GetIndexPoolCapacityr+   r‚   s    r   Úget_index_pool_capacityÚ Property.get_index_pool_capacity6  ó   € Ü�w‰w×9Ñ9¸$¿+¹+ÓFÐFrB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   zindex_pool_capacity must be > 0)r   r
   r'   Ú"IndexProperty_SetIndexPoolCapacityr+   rÁ   s     r   Úset_index_pool_capacityÚ Property.set_index_pool_capacity9  ó0   € Ø�A‹:ÜÐ>Ó?Ð?Ü�w‰w×9Ñ9¸$¿+¹+ÀuÓMÐMrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú"IndexProperty_GetPointPoolCapacityr+   r‚   s    r   Úget_point_pool_capacityÚ Property.get_point_pool_capacityA  r‡  rB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   zpoint_pool_capacity must be > 0)r   r
   r'   Ú"IndexProperty_SetPointPoolCapacityr+   rÁ   s     r   Úset_point_pool_capacityÚ Property.set_point_pool_capacityD  rŒ  rB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú#IndexProperty_GetRegionPoolCapacityr+   r‚   s    r   Úget_region_pool_capacityÚ!Property.get_region_pool_capacityL  s   € Ü�w‰w×:Ñ:¸4¿;¹;ÓGÐGrB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   z region_pool_capacity must be > 0)r   r
   r'   Ú#IndexProperty_SetRegionPoolCapacityr+   rÁ   s     r   Úset_region_pool_capacityÚ!Property.set_region_pool_capacityO  s0   € Ø�A‹:ÜÐ?Ó@Ð@Ü�w‰w×:Ñ:¸4¿;¹;ÈÓNÐNrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú"IndexProperty_GetBufferingCapacityr+   r‚   s    r   Úget_buffering_capacityÚProperty.get_buffering_capacityW  r‡  rB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   zbuffering_capacity must be > 0)r   r
   r'   Ú"IndexProperty_SetBufferingCapacityr+   rÁ   s     r   Úset_buffering_capacityÚProperty.set_buffering_capacityZ  s0   € Ø�A‹:ÜÐ=Ó>Ð>Ü�w‰w×9Ñ9¸$¿+¹+ÀuÓMÐMrB   c                óf   • [        [        R                  R                  U R                  5      5      $ r   )rO   r
   r'   Ú IndexProperty_GetEnsureTightMBRsr+   r‚   s    r   Úget_tight_mbrÚProperty.get_tight_mbrb  s    € Ü”D—G‘G×<Ñ<¸T¿[¹[ÓIÓJÐJrB   c                ó~   • [        U5      n[        [        R                  R                  U R                  U5      5      $ r   )rO   r
   r'   Ú IndexProperty_SetEnsureTightMBRsr+   rÁ   s     r   Úset_tight_mbrÚProperty.set_tight_mbre  s+   € Ü�U“ˆÜ”D—G‘G×<Ñ<¸T¿[¹[È%ÓPÓQÐQrB   c                óf   • [        [        R                  R                  U R                  5      5      $ r   )rO   r
   r'   ÚIndexProperty_GetOverwriter+   r‚   s    r   Úget_overwriteÚProperty.get_overwritel  s    € Ü”D—G‘G×6Ñ6°t·{±{ÓCÓDÐDrB   c                ó~   • [        U5      n[        [        R                  R                  U R                  U5      5      $ r   )rO   r
   r'   ÚIndexProperty_SetOverwriter+   rÁ   s     r   Úset_overwriteÚProperty.set_overwriteo  s+   € Ü�U“ˆÜ”D—G‘G×6Ñ6°t·{±{ÀEÓJÓKÐKrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú)IndexProperty_GetNearMinimumOverlapFactorr+   r‚   s    r   Úget_near_minimum_overlap_factorÚ(Property.get_near_minimum_overlap_factorv  s   € Ü�w‰w×@Ñ@ÀÇÁÓMÐMrB   c                óx   • US::  a  [        S5      e[        R                  R                  U R                  U5      $ )Nr   z'near_minimum_overlap_factor must be > 0)r   r
   r'   Ú)IndexProperty_SetNearMinimumOverlapFactorr+   rÁ   s     r   Úset_near_minimum_overlap_factorÚ(Property.set_near_minimum_overlap_factory  s0   € Ø�A‹:ÜÐFÓGÐGÜ�w‰w×@Ñ@ÀÇÁÈeÓTÐTrB   c                óf   • [        [        R                  R                  U R                  5      5      $ r   )rO   r
   r'   ÚIndexProperty_GetWriteThroughr+   r‚   s    r   Úget_writethroughÚProperty.get_writethroughƒ  s    € Ü”D—G‘G×9Ñ9¸$¿+¹+ÓFÓGÐGrB   c                ó~   • [        U5      n[        [        R                  R                  U R                  U5      5      $ r   )rO   r
   r'   ÚIndexProperty_SetWriteThroughr+   rÁ   s     r   Úset_writethroughÚProperty.set_writethrough†  s+   € Ü�U“ˆÜ”D—G‘G×9Ñ9¸$¿+¹+ÀuÓMÓNÐNrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetFillFactorr+   r‚   s    r   Úget_fill_factorÚProperty.get_fill_factor�  ó   € Ü�w‰w×2Ñ2°4·;±;Ó?Ð?rB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndexProperty_SetFillFactorr+   rÁ   s     r   Úset_fill_factorÚProperty.set_fill_factor�  ó   € Ü�w‰w×2Ñ2°4·;±;ÀÓFÐFrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú(IndexProperty_GetSplitDistributionFactorr+   r‚   s    r   Úget_split_distribution_factorÚ&Property.get_split_distribution_factor–  s   € Ü�w‰w×?Ñ?ÀÇÁÓLÐLrB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   Ú(IndexProperty_SetSplitDistributionFactorr+   rÁ   s     r   Úset_split_distribution_factorÚ&Property.set_split_distribution_factor™  s   € Ü�w‰w×?Ñ?ÀÇÁÈUÓSÐSrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetTPRHorizonr+   r‚   s    r   Úget_tpr_horizonÚProperty.get_tpr_horizon¡  rÉ  rB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndexProperty_SetTPRHorizonr+   rÁ   s     r   Úset_tpr_horizonÚProperty.set_tpr_horizon¤  rÎ  rB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetReinsertFactorr+   r‚   s    r   Úget_reinsert_factorÚProperty.get_reinsert_factorª  s   € Ü�w‰w×6Ñ6°t·{±{ÓCÐCrB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndexProperty_SetReinsertFactorr+   rÁ   s     r   Úset_reinsert_factorÚProperty.set_reinsert_factor­  s   € Ü�w‰w×6Ñ6°t·{±{ÀEÓJÐJrB   c                óp   • [         R                  R                  U R                  5      R	                  5       $ r   )r
   r'   ÚIndexProperty_GetFileNamer+   Údecoder‚   s    r   Úget_filenameÚProperty.get_filename³  s$   € Ü�w‰w×0Ñ0°·±Ó=×DÑDÓFÐFrB   c                ó¢   • [        U[        5      (       a  UR                  S5      n[        R                  R                  U R                  U5      $ ©Nr   )rP   rQ   Úencoder
   r'   ÚIndexProperty_SetFileNamer+   rÁ   s     r   Úset_filenameÚProperty.set_filename¶  s8   € Ü�eœS×!Ñ!Ø—L‘L Ó)ˆEÜ�w‰w×0Ñ0°·±¸eÓDÐDrB   c                ót   • [         R                  R                  U R                  5      nUR	                  5       $ r   )r
   r'   Ú%IndexProperty_GetFileNameExtensionDatr+   ré  ©rq   Úexts     r   Úget_dat_extensionÚProperty.get_dat_extension¾  ó&   € Ü�g‰g×;Ñ;¸D¿K¹KÓHˆØ�z‰z‹|ÐrB   c                ó¢   • [        U[        5      (       a  UR                  S5      n[        R                  R                  U R                  U5      $ rí  )rP   rQ   rî  r
   r'   Ú%IndexProperty_SetFileNameExtensionDatr+   rÁ   s     r   Úset_dat_extensionÚProperty.set_dat_extensionÂ  ó8   € Ü�eœS×!Ñ!Ø—L‘L Ó)ˆEÜ�w‰w×<Ñ<¸T¿[¹[È%ÓPÐPrB   c                ót   • [         R                  R                  U R                  5      nUR	                  5       $ r   )r
   r'   Ú%IndexProperty_GetFileNameExtensionIdxr+   ré  rô  s     r   Úget_idx_extensionÚProperty.get_idx_extensionÊ  rø  rB   c                ó¢   • [        U[        5      (       a  UR                  S5      n[        R                  R                  U R                  U5      $ rí  )rP   rQ   rî  r
   r'   Ú%IndexProperty_SetFileNameExtensionIdxr+   rÁ   s     r   Úset_idx_extensionÚProperty.set_idx_extensionÎ  rý  rB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú+IndexProperty_GetCustomStorageCallbacksSizer+   r‚   s    r   Ú!get_custom_storage_callbacks_sizeÚ*Property.get_custom_storage_callbacks_sizeÖ  s   € Ü�w‰w×BÑBÀ4Ç;Á;ÓOÐOrB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   Ú+IndexProperty_SetCustomStorageCallbacksSizer+   rÁ   s     r   Ú!set_custom_storage_callbacks_sizeÚ*Property.set_custom_storage_callbacks_sizeÙ  s   € Ü�w‰w×BÑBÀ4Ç;Á;ÐPUÓVÐVrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   Ú'IndexProperty_GetCustomStorageCallbacksr+   r‚   s    r   Úget_custom_storage_callbacksÚ%Property.get_custom_storage_callbacksá  s   € Ü�w‰w×>Ñ>¸t¿{¹{ÓKÐKrB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   Ú'IndexProperty_SetCustomStorageCallbacksr+   rÁ   s     r   Úset_custom_storage_callbacksÚ%Property.set_custom_storage_callbacksä  s   € Ü�w‰w×>Ñ>¸t¿{¹{ÈEÓRÐRrB   c                óT   • [         R                  R                  U R                  5      $ r   )r
   r'   ÚIndexProperty_GetIndexIDr+   r‚   s    r   Úget_index_idÚProperty.get_index_idì  rÉ   rB   c                óV   • [         R                  R                  U R                  U5      $ r   )r
   r'   ÚIndexProperty_SetIndexIDr+   rÁ   s     r   Úset_index_idÚProperty.set_index_idï  rÄ   rB   )rZ  rF  r+   r  )NT)rÜ  rO   rs   r   rº  r»  rÀ  )rº  zdict[Any, Any]r¾  r½  r¼  )r"   r   rº  r»  )ZrÏ  rÐ  rÑ  rÒ  rÓ  r:  r|   r*  r•   r™   r5  rŽ   rC  rH  rM  rÕ  rK   rQ  rV  r&  r]  ra  r0   re  ri  rW   rm  rq  rI   ru  ry  r  r}  r�  r  r…  rŠ  Úindex_pool_capacityr�  r“  r   r—  r›  r!  rŸ  r£  r  r§  r«  r$  r¯  r³  rH   r·  r»  r  r¿  rÃ  r'  rÇ  rÌ  r  rÑ  rÕ  r#  rÙ  rÝ  r%  rá  rå  r"  rê  rð  rX   rö  rû  r  r   r  rY   r  r  r  r  r  r  r  r  r^   rÚ  rê   rB   r   r   r   �  sB  † ñð
€Eö6*ô
@ôò)ôô$ô.ôôFñ �N NÓ3€DðEôBôIñ �{ KÓ0€GðDôôFñ ˜¨Ó6€Ið ôBôIñ �{ KÓ0€Gðô>ôEñ
 ˜ lÓ3€HðDôCôJñ
 Ð0Ð2DÓE€NØôBôIñ
 Ð.Ð0AÓB€MØôGôNñ
 #Ð#:Ð<SÓTÐØôGôNñ
 #Ð#:Ð<SÓTÐØôHôOñ
 $Ð$<Ð>VÓWÐØôGôNñ
 "Ð"8Ð:PÓQÐØòKòRñ ˜¨Ó6€IØ(òEòLñ ˜¨Ó6€IØ(ôNôUñ
 #+Ø'Ð)Hó#Ðð &òHòOñ Ð,Ð.>Ó?€LØô@ôGñ ˜?¨OÓ<€KØ1ôMôTñ !)Ø%Ð'Dó!Ðð $ò@òGñ ˜?¨OÓ<€KØòDòKñ Ð2Ð4GÓH€OØòGòEñ
 ˜ lÓ3€HØ)òòQñ
 Ð.Ð0AÓB€MØ!òòQñ
 Ð.Ð0AÓB€MØ!ôPôWñ %-Ø)Ð+Ló%Ð!ð /òLòSñ  (Ø$Ð&Bó Ðð 'ò=òDñ ˜ lÓ3€HÚrB   r   c                  ó  • \ rS rSr\R
                  " S\R                  \R                  " \R                  5      5      r	\R
                  " S\R                  \R                  " \R                  5      5      r
\R
                  " S\R                  \R                  " \R                  5      5      r\R
                  " S\R                  \\R                  " \R                  5      \R                  " \R                  " \R                  5      5      \R                  " \R                  5      5      r\R
                  " S\R                  \R                  " \5      \R                  \R                  " \R                  5      \R                  " \R                  5      5      r\R
                  " S\R                  \\R                  " \R                  5      5      rS\R                  4S\	4S\
4S\4S\4S\4S	\4/r  SS
 jrSrg)ÚCustomStorageCallbacksiû  NÚcontextÚcreateCallbackÚdestroyCallbackÚflushCallbackÚloadCallbackÚstoreCallbackÚdeleteCallbackc                ó,  • [         R                  R                  U [         R                  " U5      U R	                  U5      U R                  U5      U R                  U5      U R                  U5      U R                  U5      U R                  U5      5        g r   )
r   Ú	Structurer|   r)   ÚcreateCallbackTypeÚdestroyCallbackTypeÚflushCallbackTypeÚloadCallbackTypeÚstoreCallbackTypeÚdeleteCallbackType)rq   r!  r"  r#  r$  r%  r&  r'  s           r   r|   ÚCustomStorageCallbacks.__init__%  s{   € ô 	×Ñ×!Ñ!ØÜ�OŠO˜GÓ$Ø×#Ñ# NÓ3Ø×$Ñ$ _Ó5Ø×"Ñ" =Ó1Ø×!Ñ! ,Ó/Ø×"Ñ" =Ó1Ø×#Ñ# NÓ3õ		
rB   rê   rÁ  )rÏ  rÐ  rÑ  rÒ  r   Ú	CFUNCTYPEr)   r$   Úc_intr*  r+  r,  Úid_typer    r:   r-  r.  r/  Ú_fields_r|   rÚ  rê   rB   r   r   r   û  s±  † à×)Ò)Øˆf�o‰o˜vŸ~š~¨f¯l©lÓ;óÐð !×*Ò*Øˆf�o‰o˜vŸ~š~¨f¯l©lÓ;óÐð ×(Ò(Øˆf�o‰o˜vŸ~š~¨f¯l©lÓ;óÐð ×'Ò'ØØ�‰ØØ�Š�v—‘Ó'Ø�Š�v—~’~ f§n¡nÓ5Ó6Ø�Š�v—|‘|Ó$óÐð ×(Ò(ØØ�‰Ø�Š�wÓØ�‰Ø�Š�v—~‘~Ó&Ø�Š�v—|‘|Ó$óÐð  ×)Ò)Øˆf�o‰o˜w¨¯ª°v·|±|Ó(DóÐð
 
�F—O‘OÐ$Ø	Ð-Ð.Ø	Ð/Ð0Ø	Ð+Ð,Ø	Ð)Ð*Ø	Ð+Ð,Ø	Ð-Ð.ð€Hð
ð 
÷
rB   r   c                  óL   • \ rS rSrSrSrSrSrSrS r	S r
S r\" S	 5      rS
rg)rU   i;  r   r	   r   r’  c                ó@   • [         R                  R                  U5      $ r   )r
   r'   ÚSIDX_NewBuffer)rq   r=   s     r   ÚallocateBufferÚICustomStorage.allocateBufferE  s   € Ü�w‰w×%Ñ% fÓ-Ð-rB   c                ó   • [        5       er   rú  )rq   rF   s     r   rg   Ú ICustomStorage.registerCallbacksH  ó   € Ü!Ó#Ð#rB   c                ó   • [        5       er   rú  r‚   s    r   re   ÚICustomStorage.clearK  r<  rB   c                ó   • g)NFrê   r‚   s    r   Ú<lambda>ÚICustomStorage.<lambda>N  s   €  ErB   rê   N)rÏ  rÐ  rÑ  rÒ  ÚNoErrorÚInvalidPageErrorÚIllegalStateErrorÚ	EmptyPageÚNewPager8  rg   re   rÕ  rd   rÚ  rê   rB   r   rU   rU   ;  s>   † à€GØÐØÐð €IØ€Gò.ò$ò$ñ Ñ)Ó*€GÚArB   rU   c                  óB   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
rg)ÚCustomStorageBaseiR  z[Derive from this class to create your own storage manager with access
to the raw C buffers.c           	     ó‚  • [        [        R                  " 5       U R                  U R                  U R
                  U R                  U R                  U R                  5      n[        R                  " U5      Ul
        X l        [        R                  " [        R                  " U5      [        R                  5      Ul        g r   )r   r   r)   Úcreater¦   rª   ÚloadByteArrayÚstoreByteArrayÚdeleteByteArrayÚsizeofr  Ú	callbacksr#   r   r  ©rq   rF   rO  s      r   rg   Ú#CustomStorageBase.registerCallbacksV  s�   € Ü*Ü�OŠOÓØ�K‰KØ�L‰LØ�J‰JØ×ÑØ×ÑØ× Ñ ó
ˆ	ô 4:·=²=ÀÓ3Kˆ
Ô0Ø"ŒÜ.4¯kªkÜ�NŠN˜9Ó%¤v§¡ó/
ˆ
Õ+rB   c                óN   • U R                   UR                  l        [        S5      e)NúYou must override this method.©rD  r&   r"   rn   ©rq   r!  ÚreturnErrors      r   rJ  ÚCustomStorageBase.createg  s"   € Ø%)×%;Ñ%;ˆ×ÑÔ"Ü!Ð"BÓCÐCrB   c                óN   • U R                   UR                  l        [        S5      e©zplease overriderS  rT  rU  s      r   r¦   ÚCustomStorageBase.destroyk  ó"   € à%)×%;Ñ%;ˆ×ÑÔ"Ü!Ð"BÓCÐCrB   c                óN   • U R                   UR                  l        [        S5      erY  rT  )rq   r!  ÚpageÚ	resultLenÚ
resultDatarV  s         r   rK  ÚCustomStorageBase.loadByteArrayp  r[  rB   c                óN   • U R                   UR                  l        [        S5      erY  rT  )rq   r!  r]  rS   r×   rV  s         r   rL  Ú CustomStorageBase.storeByteArrayu  r[  rB   c                óN   • U R                   UR                  l        [        S5      erY  rT  ©rq   r!  r]  rV  s       r   rM  Ú!CustomStorageBase.deleteByteArrayz  r[  rB   c                óN   • U R                   UR                  l        [        S5      erY  rT  rU  s      r   rª   ÚCustomStorageBase.flush  r[  rB   ©rO  N)rÏ  rÐ  rÑ  rÒ  rÓ  rg   rJ  r¦   rK  rL  rM  rª   rÚ  rê   rB   r   rH  rH  R  s0   † ñò
ò"DòDò
Dò
Dò
Dõ
DrB   rH  c                  óf   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rSrg)ÚCustomStoragei…  zÞProvides a useful default custom storage implementation which marshals
the buffers on the C side from/to python strings.
Derive from this class and override the necessary methods to provide
your own custom storage manager.c           	     ó\  • [        SU R                  U R                  U R                  U R                  U R
                  U R                  5      n[        R                  " U5      Ul	        X l
        [        R                  " [        R                  " U5      [        R                  5      Ul        g r   )r   rõ  rÿ  Ú_flushÚ_loadByteArrayÚ_storeByteArrayÚ_deleteByteArrayr   rN  r  rO  r#   r   r)   r  rP  s      r   rg   ÚCustomStorage.registerCallbacks‹  sz   € Ü*ØØ�L‰LØ�M‰MØ�K‰KØ×ÑØ× Ñ Ø×!Ñ!ó
ˆ	ô 4:·=²=ÀÓ3Kˆ
Ô0Ø"ŒÜ.4¯kªkÜ�NŠN˜9Ó%¤v§¡ó/
ˆ
Õ+rB   c                ó&   • U R                  U5        g r   )rJ  rU  s      r   rõ  ÚCustomStorage._create�  s   € Ø�‰�KÕ rB   c                ó&   • U R                  U5        g r   )r¦   rU  s      r   rÿ  ÚCustomStorage._destroy   s   € Ø�‰�[Õ!rB   c                ó&   • U R                  U5        g r   )rª   rU  s      r   rl  ÚCustomStorage._flush£  s   € Ø�
‰
�;ÕrB   c                ó˜  • U R                  X%5      nUR                  R                  U R                  :w  a  g [	        U5      nXsR                  l        U R                  U5      n[        R                  " U[        R                  " U5      U5        [        R                  " U[        R                  " [        R                  5      5      US'   g r   )rK  r&   r"   rB  rS   r8  r   ÚmemmoveÚc_char_pr#   r$   r:   )	rq   r!  r]  r^  r_  rV  ÚresultStringr‡   Úbuffers	            r   rm  ÚCustomStorage._loadByteArray¦  s�   € Ø×)Ñ)¨$Ó<ˆØ×Ñ×%Ñ%¨¯©Ó5Øô �LÓ!ˆØ#(×ÑÔ Ø×$Ñ$ UÓ+ˆÜ�Š�vœvŸš¨|Ó<¸eÔDÜŸš F¬F¯NªN¼6¿>¹>Ó,JÓKˆ
�1ŠrB   c                óœ   • [         R                  " XC5      nU R                  UR                  R                  Xe5      nXrR                  l        g r   )r   r<   rL  r&   r"   )rq   r!  r]  rS   r×   rV  rQ   Ú	newPageIds           r   rn  ÚCustomStorage._storeByteArray¶  s8   € Ü×Ò˜tÓ)ˆØ×'Ñ'¨¯©×(;Ñ(;¸SÓNˆ	Ø'�‰ÕrB   c                ó&   • U R                  X#5        g r   )rM  rd  s       r   ro  ÚCustomStorage._deleteByteArray»  s   € Ø×Ñ˜TÕ/rB   c                óN   • U R                   UR                  l        [        S5      e©z$Must be overridden. No return value.rS  rT  ©rq   rV  s     r   rJ  ÚCustomStorage.create¿  r[  rB   c                óN   • U R                   UR                  l        [        S5      erƒ  rT  r„  s     r   r¦   ÚCustomStorage.destroyÄ  r[  rB   c                óN   • U R                   UR                  l        [        S5      erƒ  rT  r„  s     r   rª   ÚCustomStorage.flushÉ  r[  rB   c                óN   • U R                   UR                  l        [        S5      e)z>Must be overridden. Must return a string with the loaded data.rS  rT  ©rq   r]  rV  s      r   rK  ÚCustomStorage.loadByteArrayÎ  r[  rB   c                óN   • U R                   UR                  l        [        S5      e)z…Must be overridden. Must return the new 64-bit page ID of the stored
data if a new page had to be created (i.e. page is not NewPage).rS  rT  )rq   r]  r×   rV  s       r   rL  ÚCustomStorage.storeByteArrayÔ  s$   € ð &*×%;Ñ%;ˆ×ÑÔ"Ü!Ð"BÓCÐCrB   c                óN   • U R                   UR                  l        [        S5      erY  rT  r‹  s      r   rM  ÚCustomStorage.deleteByteArrayÛ  r[  rB   rh  N)rÏ  rÐ  rÑ  rÒ  rÓ  rg   rõ  rÿ  rl  rm  rn  ro  rJ  r¦   rª   rK  rL  rM  rÚ  rê   rB   r   rj  rj  …  sM   † ñ(ò

ò$!ò"ò òLò (ò
0òDò
Dò
Dò
òõDrB   rj  c                  ó^  ^ • \ rS rSrSrSU 4S jjrSS jrSS jrSS jrSS jr	SS jr
SU 4S	 jjr\r\SS
 j5       r\ S     SS jj5       r S     SU 4S jjjr\ S       SS jj5       r\ S       S S jj5       r S       S!U 4S jjjrSU 4S jjrU 4S jrSrU =r$ )"ÚRtreeContaineriá  zEAn R-Tree, MVR-Tree, or TPR-Tree indexed container for python objectsc                ó   >• U(       a`  [        US   [        5      (       d0  [        US   [        5      (       d  [        US   [        5      (       a  [	        U R
                   S35      e0 U l        [        TU ]   " U0 UD6$ )a¤	  Creates a new index

:param stream:
    If the first argument in the constructor is not of type basestring,
    it is assumed to be an iterable stream of data that will raise a
    StopIteration.  It must be in the form defined by the
    :attr:`interleaved` attribute of the index. The following example
    would assume :attr:`interleaved` is False::

        (obj,
         (minx, maxx, miny, maxy, minz, maxz, ..., ..., mink, maxk))

    For a TPR-Tree, this would be in the form::

        (id,
         ((minx, maxx, miny, maxy, ..., ..., mink, maxk),
          (minvx, maxvx, minvy, maxvy, ..., ..., minvk, maxvk),
          time),
         object)

:param interleaved: True or False, defaults to True.
    This parameter determines the coordinate order for all methods that
    take in coordinates.

:param properties: This object sets both the creation and instantiation
    properties for the object and they are passed down into libspatialindex.
    A few properties are curried from instantiation parameters
    for you like ``pagesize`` to ensure compatibility with previous
    versions of the library.  All other properties must be set on the
    object.

.. warning::
    The coordinate ordering for all functions are sensitive the
    index's :attr:`interleaved` data member.  If :attr:`interleaved`
    is False, the coordinates must be in the form
    [xmin, xmax, ymin, ymax, ..., ..., kmin, kmax]. If
    :attr:`interleaved` is True, the coordinates must be in the form
    [xmin, ymin, ..., kmin, xmax, ymax, ..., kmax]. This also applies
    to velocities when using a TPR-Tree.

A basic example
::

    >>> from rtree import index
    >>> p = index.Property()

    >>> idx = index.RtreeContainer(properties=p)
    >>> idx  # doctest: +NORMALIZE_WHITESPACE
    rtree.index.RtreeContainer(bounds=[1.7976931348623157e+308,
                             1.7976931348623157e+308,
                             -1.7976931348623157e+308,
                             -1.7976931348623157e+308],
                             size=0)

Insert an item into the index::

    >>> idx.insert(object(),
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734))

Query::

    >>> hits = idx.intersection((0, 0, 60, 60), bbox=True)
    >>> for obj in hits:
    ...     obj.object
    ...     obj.bbox  # doctest: +ELLIPSIS
    <object object at 0x...>
    [34.37768294..., 26.73758537..., 49.37768294..., 41.73758537...]
r   z  supports only in-memory indexes)	rP   rQ   rR   rU   r`  Ú	__class__Ú_objectsÚsuperr|   )rq   rr   rs   r”  s      €r   r|   ÚRtreeContainer.__init__ä  sp   ø€ öL ä˜4 ™7¤C×(Ñ(Ü˜d 1™g¤u×-Ñ-Ü˜d 1™g¤~×6Ñ6ä  D§N¡NÐ#3Ð3SÐ!TÓUÐUØ79ˆŒÜ‰wÒ Ð0¨Ñ0Ð0rB   c                óZ   •  U R                  U R                  5      $ ! [         a     gf = fr   r†   r‚   s    r   rƒ   ÚRtreeContainer.get_size4	  s,   € ð	Ø—:‘:˜dŸk™kÓ*Ð*øÜó 	Ùð	úr‹   c                óZ   • SnUR                  U R                  U R                  5       5      $ )Nz.rtree.index.RtreeContainer(bounds={}, size={}))Úformatrˆ   rƒ   )rq   Úms     r   rŽ   ÚRtreeContainer.__repr__:	  s"   € Ø<ˆØ�x‰x˜Ÿ™ T§]¡]£_Ó5Ð5rB   c                ó2   • [        U5      U R                  ;   $ r   )rÖ   r•  rž   s     r   Ú__contains__ÚRtreeContainer.__contains__>	  s   € Ü�#‹w˜$Ÿ-™-Ñ'Ð'rB   c                óV   • [        S U R                  R                  5        5       5      $ )Nc              3  ó*   #   • U  H	  u  pUv •  M     g 7fr   rê   ©r   r‡   rŸ   s      r   r   Ú)RtreeContainer.__len__.<locals>.<genexpr>B	  s   é € ÐBÒ+A™Z˜U•5Ò+Aùó   ‚)rK  r•  Úvaluesr‚   s    r   r‰   ÚRtreeContainer.__len__A	  s    € ÜÑB¨4¯=©=×+?Ñ+?Ô+AÓBÓBÐBrB   c                óV   • [        S U R                  R                  5        5       5      $ )Nc              3  ó*   #   • U  H	  u  pUv •  M     g 7fr   rê   r£  s      r   r   Ú*RtreeContainer.__iter__.<locals>.<genexpr>E	  s   é € ÐAÒ*@™J˜E•CÒ*@ùr¥  )rŸ  r•  r¦  r‚   s    r   Ú__iter__ÚRtreeContainer.__iter__D	  s    € ÜÑA¨$¯-©-×*>Ñ*>Ô*@ÓAÓAÐArB   c                óÌ   >•  U R                   [        U5         S   S-   nX14U R                   [        U5      '   [        TU ]  [        U5      US5      $ ! [         a    Sn NAf = f)aé  Inserts an item into the index with the given coordinates.

:param obj: Any object.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time value as a float.

The following example inserts a simple object into the container.
The coordinate ordering in this instance is the default
(interleaved=True) ordering::

    >>> from rtree import index
    >>> idx = index.RtreeContainer()
    >>> idx.insert(object(),
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734))

Similar for TPR-Tree::

    >>> p = index.Property(type=index.RT_TPRTree)  # doctest: +SKIP
    >>> idx = index.RtreeContainer(properties=p)  # doctest: +SKIP
    >>> idx.insert(object(),
    ...            ((34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...             (0.5, 2, 1.5, 2.5),
    ...            3.0))  # doctest: +SKIP

r   r	   N)r•  rÖ   ÚKeyErrorr–  rp   ©rq   rŸ   r®   r‡   r”  s       €r   rp   ÚRtreeContainer.insertG	  sh   ø€ ðD	Ø—M‘M¤" S£'Ñ*¨1Ñ-°Ñ1ˆEð #( ˆ�‰”b˜“gÑÜ‰w‰~œb ›g {°DÓ9Ð9øô ó 	ØŠEð	ús   ƒA ÁA#Á"A#c                ó   • g r   rê   ©rq   r®   rþ   s      r   rý   ÚRtreeContainer.intersectionr	  s   € ØUXrB   c                ó   • g r   rê   r²  s      r   rý   r³  u	  rñ   rB   c              #  ó  >#   • USL a+  [         TU ]  X5       H  nU R                  U   S   v •  M     gUSL aC  [         TU ]  X5       H/  nU R                  UR                     S   Ul        SUl        Uv •  M1     g[        S5      e7f)a[  Return ids or objects in the index that intersect the given
coordinates.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time pair for the
    time range as a float.

:param bbox: If True, the intersection method will return the stored objects,
    as well as the bounds of the entry.

The following example queries the container for any stored objects that
intersect the bounds given in the coordinates::

    >>> from rtree import index
    >>> idx = index.RtreeContainer()
    >>> idx.insert(object(),
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734))

    >>> hits = list(idx.intersection((0, 0, 60, 60), bbox=True))
    >>> [(item.object, item.bbox) for item in hits]
    ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
    [(<object object at 0x...>, [34.3776829412, 26.7375853734,
    49.3776829412, 41.7375853734])]

If the :class:`rtree.index.Item` wrapper is not used, it is faster to
request only the stored objects::

    >>> list(idx.intersection((0, 0, 60, 60)))   # doctest: +ELLIPSIS
    [<object object at 0x...>]

Similar for the TPR-Tree::

    >>> p = index.Property(type=index.RT_TPRTree)  # doctest: +SKIP
    >>> idx = index.RtreeContainer(properties=p)  # doctest: +SKIP
    >>> idx.insert(object(),
    ...            ((34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...             (0.5, 2, 1.5, 2.5),
    ...             3.0))  # doctest: +SKIP

    >>> hits = list(idx.intersection(
    ...     ((0, 0, 60, 60), (0, 0, 0, 0), (3, 5)), bbox=True))
    ... # doctest: +SKIP
    >>> [(item.object, item.bbox) for item in hits]
    ... # doctest: +SKIP
    [(<object object at 0x...>, [34.3776829412, 26.7375853734,
    49.3776829412, 41.7375853734])]

Fr	   TNú5valid values for the bbox argument are True and False)r–  rý   r•  rÖ   r  r`  )rq   r®   rþ   rÖ   r"   r”  s        €r   rý   r³  z	  s‡   øé € ðt �5Š=Ü‘gÑ*¨;Ö=�Ø—m‘m BÑ'¨Ñ*Ô*ò >à�TŠ\Ü™Ñ-¨kÖ@�Ø#Ÿ}™}¨U¯X©XÑ6°qÑ9�”Ø�”Ø”ò Aô
 ÐTÓUÐUùs   ƒBBc                ó   • g r   rê   ©rq   r®   r(  rþ   s       r   r5  ÚRtreeContainer.nearest¿	  r  rB   c                ó   • g r   rê   r¸  s       r   r5  r¹  Ä	  rñ   rB   c              #  ó  >#   • USL a,  [         TU ]  XU5       H  nU R                  U   S   v •  M     gUSL aD  [         TU ]  XU5       H/  nU R                  UR                     S   Ul        SUl        Uv •  M1     g[        S5      e7f)aÃ  Returns the ``k``-nearest objects to the given coordinates
in increasing distance order.

:param coordinates: This may be an object that satisfies the numpy array
    protocol, providing the index's dimension * 2 coordinate
    pairs representing the `mink` and `maxk` coordinates in
    each dimension defining the bounds of the query window.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time pair for the
    time range as a float.

:param num_results: The number of results to return nearest to the given
    coordinates. If two entries are equidistant, *both* are returned.
    This property means that :attr:`num_results` may return more
    items than specified.

:param bbox: If True, the nearest method will return the stored objects, as
    well as the bounds of the entry.

.. warning::
    This is currently not implemented for the TPR-Tree.

Example of finding the three items nearest to this one::

    >>> from rtree import index
    >>> idx = index.RtreeContainer()
    >>> idx.insert(object(), (34.37, 26.73, 49.37, 41.73))
    >>> hits = idx.nearest((0, 0, 10, 10), 3, bbox=True)
Fr	   TNr¶  )r–  r5  r•  rÖ   r  r`  )rq   r®   r(  rþ   rÖ   r"   r”  s         €r   r5  r¹  É	  sŠ   øé € ðB �5Š=Ü‘g‘o kÀÖE�Ø—m‘m BÑ'¨Ñ*Ô*ò Fà�TŠ\Ü™™¨À4ÖH�Ø#Ÿ}™}¨U¯X©XÑ6°qÑ9�”Ø�”Ø”ò Iô
 ÐTÓUÐUùs   ƒBB	c                ó  >•  U R                   [        U5         S   S-
  nUS:X  a  U R                   [        U5      	 OX14U R                   [        U5      '   [        TU ]  [        U5      U5      $ ! [         a    [        S5      ef = f)aR  Deletes the item from the container within the specified
coordinates.

:param obj: Any object.

:param coordinates: Dimension * 2 coordinate pairs, representing the min
    and max coordinates in each dimension of the item to be
    deleted from the index. Their ordering will depend on the
    index's :attr:`interleaved` data member.
    These are not the coordinates of a space containing the
    item, but those of the item itself. Together with the
    id parameter, they determine which item will be deleted.
    This may be an object that satisfies the numpy array protocol.
    For a TPR-Tree, this must be a 3-element sequence including
    not only the positional coordinate pairs but also the
    velocity pairs `minvk` and `maxvk` and a time pair for the
    original time the object was inserted and the current time
    as a float.

Example::

    >>> from rtree import index
    >>> idx = index.RtreeContainer()
    >>> idx.delete(object(),
    ...            (34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734))
    Traceback (most recent call last):
     ...
    IndexError: object is not in the index

For the TPR-Tree::

    >>> p = index.Property(type=index.RT_TPRTree)  # doctest: +SKIP
    >>> idx = index.RtreeContainer(properties=p)  # doctest: +SKIP
    >>> idx.delete(object(),
    ...            ((34.3776829412, 26.7375853734, 49.3776829412,
    ...             41.7375853734),
    ...             (0.5, 2, 1.5, 2.5),
    ...             (3.0, 5.0)))  # doctest: +SKIP
    Traceback (most recent call last):
     ...
    IndexError: object is not in the index

r   r	   zobject is not in the index)r•  rÖ   r®  Ú
IndexErrorr–  ry  r¯  s       €r   ry  ÚRtreeContainer.deleteõ	  s„   ø€ ðZ	;Ø—M‘M¤" S£'Ñ*¨1Ñ-°Ñ1ˆEð �A‹:Ø—‘œb ›gÑ&à&+ \ˆD�M‰Mœ"˜S›'Ñ"Ü‰w‰~œb ›g {Ó3Ð3øô ó 	;ÜÐ9Ó:Ð:ð	;ús   ƒA0 Á0Bc                óÔ   >• [         TU ]  5        VVVVs/ s H;  u  pnU R                  U   S   U Vs/ s H  o@R                  U   S   PM     snU4PM=     snnnn$ s  snf s  snnnnf )Nr	   )r–  r·  r•  )rq   rÖ   r¶  rˆ   Úchild_idr”  s        €r   r·  ÚRtreeContainer.leaves,
  st   ø€ ô */©©Ô)9ö
ò *:Ñ%�˜vð	 —‘˜bÑ! !Ñ$Ù<EÓFºI°—‘˜xÑ(¨Ô+¹IÑFØóñ
 *:ô
ð 	
ùò Gùõ
s   •A"
³AÁ	A"
ÁA"
)r•  r¹  r¼  r½  )rŸ   r  rº  rO   )rº  rÉ  )rŸ   r  r®   r   rº  r»  )r®   r   rþ   rÄ  rº  rÅ  rÆ  )r®   r   rþ   rÇ  rº  rÉ  )r®   r   rþ   rO   rº  úIterator[Item | object])r	   T)r®   r   r(  r   rþ   rÄ  rº  rÅ  rÍ  )r®   r   r(  r   rþ   rÇ  rº  rÉ  )r®   r   r(  r   rþ   rO   rº  rÂ  )rÏ  rÐ  rÑ  rÒ  rÓ  r|   rƒ   rŽ   rŸ  r‰   r«  rp   rØ  r   rý   r5  ry  r·  rÚ  Ú__classcell__)r”  s   @r   r’  r’  á  sX  ø† ÙO÷N1ô`ô6ô(ôCôB÷':ðR €CàÛXó ØXàà7<ðØðØ&4ðà	ôó ðð
 .3ðCVØðCVØ&*ðCVà	 ÷CVð CVðJ àLPðØðØ-0ðØ<Iðà	ôó ðð àMRðØðØ-0ðØ<Jðà	ôó ðð
 DIð*VØð*VØ-0ð*VØ<@ð*Và	 ÷*Vð *V÷X54÷n
ó 
rB   r’  );Ú
__future__r   r   rZ   Úos.pathrœ   rA  r   Úcollections.abcr   r   Útypingr   r   r   Ú r
   Ú
exceptionsr   rh   rV   rc   Ú	RT_LinearÚRT_QuadraticÚRT_Starri   Ú
RT_MVRTreerL   r'   ÚSIDX_VersionÚ__c_api_version__ré  ÚsplitÚmajor_versionÚminor_versionÚpatch_versionr•  Ú__all__r7   rA   r   r   r&  rñ  ró  ro   r¡  r¥  rö   r  r   rô   r3  r)  r   rU   rH  rj  r’  rê   rB   r   Ú<module>rÕ     s¦  ðÝ "ã Û 	Û Û Û Û ß .ß )Ñ )å Ý "à€	Ø
€Ø€	à€	Ø€Ø
€à€Ø€
Ø€
à—G‘G×(Ñ(Ó*Ð ñ/Ø%×,Ñ,¨WÓ5×;Ñ;¸CÔ@ó/Ñ +€ˆ}˜mð �= -Ð0°9Ó<Ù
ÐEÓ
FÐFâ
(€ò'ò4
÷Hñ HðX. 	€÷(ñ (ôV>˜Yô >÷ ñ  ôF
�&ô 
ô-˜ô -ð	ô0˜;ô 0ô-�Vô -÷
fñ fðV �.‰.€ô=
˜V×-Ñ-ô =
÷@Bñ Bô.0D˜ô 0DôfYD�Nô YDôxS
�Uõ S
øð{ ó 	Ùð	ús   Ã1E ÅE'Å&E'