
    mBNj                       U d Z ddlmZ ddlmZ ddlmZ	 g dZ
i Zded<    e       Z G d	 d
eedf         Z	 	 	 	 	 	 	 	 ddZe	j$                  r G d de      Zn eddddd      Ze	j$                  r G d de      Zy eddddd      Zy)z1Spatial data types for interchange with the DBMS.    )annotations)Lock   )_typing)CartesianPointPoint
WGS84Pointz"dict[int, tuple[type[Point], int]]_srid_tablec                      e Zd ZU dZded<   ej                  redd       Zedd       Z	edd       Z
ddZddZdd	Zd
 Zy)r   a|  
    Base-class for spatial data.

    A point within a geometric space. This type is generally used via its
    subclasses and should not be instantiated directly unless there is no
    subclass defined for the required SRID.

    :param iterable:
        An iterable of coordinates.
        All items will be converted to :class:`float`.
    :type iterable: Iterable[float]
    z
int | Nonesridc                     y N selfs    g/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/neo4j/spatial/__init__.pyxzPoint.x=       !    c                     y r   r   r   s    r   yzPoint.y@   r   r   c                     y r   r   r   s    r   zzPoint.zC   r   r   c                J    t         j                  | t        t        |            S r   )tuple__new__mapfloat)clsiterables     r   r   zPoint.__new__F   s    }}S#eX"677r   c                t    | j                   j                   ddj                  t        t        |              dS )N(z, ))	__class____name__joinr   reprr   s    r   __repr__zPoint.__repr__I   s0    ..))*!DIIc$o,F+GqIIr   c                    	 t        |       t        |      u xr/ t        |       t        t        j                  t        |            k(  S # t
        t        f$ r	 t        cY S w xY wr   )typer   _tcastr   AttributeError	TypeErrorNotImplemented)r   others     r   __eq__zPoint.__eq__L   s^    	":e, tu%A 2  	* 	"!!	"s   AA	 	A! A!c                T    t        t        |             t        t        |             z  S r   )hashr*   r   r   s    r   __hash__zPoint.__hash__T   s    DJ$uT{"333r   Nreturnr   )r    z_t.Iterable[float]r6   r   )r6   str)r0   objectr6   bool)r%   
__module____qualname____doc____annotations__r+   TYPE_CHECKINGpropertyr   r   r   r   r(   r1   r4   r   r   r   r   r   (   sW      		! 
!	! 
!	! 
!8J"4r   r   .c                t   fd}dt        |      i}t        |      D ]%  \  }}||fd}|d|   fD ]  }t        |      ||<    ' t        j                  t        t
           t	        | t
        f|            }	t        5  j                         D ]  \  }
}|	|
ft        |<    	 ddd       |	S # 1 sw Y   |	S xY w)z$Dynamically create a Point subclass.c                @    	 t        |          S # t        $ r Y y w xY wr   )lenKeyError)r   srid_maps    r   r   z_point_type.<locals>.srid]   s)    	CI&& 		s    	r   c                @    	 | |   S # t         $ r t        |      d w xY wr   )
IndexErrorr-   )r   ifs      r   accessorz_point_type.<locals>.accessorg   s,    2Aw 2$Q'T12s    xyzN)	r?   	enumerater+   r,   r*   r   _srid_table_lockitemsr
   )namefieldsrD   r   
attributesindexsubclass_fieldrI   field_aliasr   dimsrid_s     `         r   _point_typerV   X   s    
 (4.)J!*6!2~"n 	2 +E%L9K&.x&8J{# : "3 ''$u+tD5(J?
@C	"..*JC"%sK + 
 J	 
 Js   >$B--B7c                      e Zd Zy)r   N)r%   r:   r;   r   r   r   r   r   |   s    r   r   )r   r   r   i#  i#  )r      c                  B    e Zd Zedd       Zedd       Zedd       Zy)r	   c                     y r   r   r   s    r   	longitudezWGS84Point.longitude   s    &)r   c                     y r   r   r   s    r   latitudezWGS84Point.latitude   s    %(r   c                     y r   r   r   s    r   heightzWGS84Point.height   s    #&r   Nr5   )r%   r:   r;   r?   r[   r]   r_   r   r   r   r	   r	      s,    	) 
)	( 
(	& 
&r   r	   )r[   r]   r_   i  is  N)rN   r7   rO   ztuple[str, str, str]rD   zdict[int, int]r6   ztype[Point])r<   
__future__r   _	threadingr   _Lock r   r+   __all__r
   r=   rL   r   r   r   rV   r>   r   r	   r   r   r   <module>rf      s   & 8 ' #  35/ 47 -4E%* -4`
+7ED $$ /t+=N 'U ' 9t;MJr   