ó
    µRj2g  ã                   ó   • S r SSKrSSKJrJrJr  SSKJr  SSKJ	r	J
r
Jr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJrJr  SSKJr  SSKJr  SSKJrJrJrJ r J!r!  SSK"J#r#  SSK$J%r%J&r&   " S S\5      r' " S S5      r(\# " S S\'\5      5       r)g)zf
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
é    N)Ú	addressofÚbyrefÚc_double)Úgdal)Ú	hex_regexÚ
json_regexÚ	wkt_regex)Ú
prototypes)ÚGEOSBase)ÚGEOSCoordSeq)ÚGEOSException)ÚGEOM_PTRÚgeos_version_tuple)Ú	ListMixin©ÚPreparedGeometry)Úewkb_wÚwkb_rÚwkb_wÚwkt_rÚwkt_w)Údeconstructible)Úforce_bytesÚ	force_strc                   óæ  • \ rS rSrSr\r\R                  r	S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 5       r\S 5       r\S 5       rS rS rS rS rS rS r \!S 5       r"\!S 5       r#\!S 5       r$\!S 5       r%\!S 5       r&\!S 5       r'\!S 5       r(SWS jr)S  r*\!S! 5       r+\!S" 5       r,\!S# 5       r-\!S$ 5       r.\!S% 5       r/\!S& 5       r0S' r1S( r2S) r3S* r4S+ r5SXS, jr6S- r7S. r8S/ r9S0 r:S1 r;\!S2 5       r<\<Rz                  S3 5       r<\!S4 5       r>\!S5 5       r?\!S6 5       r@\!S7 5       rA\!S8 5       rB\BrC\!S9 5       rD\!S: 5       rE\!S; 5       rF\!S< 5       rGS= rH\!S> 5       rI\!S? 5       rJ\!S@ 5       rKSWSA jrLSB rM\!SC 5       rNSYSD jrO SZSE jrP\!SF 5       rQ\!SG 5       rRSH rS\!SI 5       rTSJ rU\!SK 5       rVSL rWS[SM jrXSN rY\!SO 5       rZSP r[\!SQ 5       r\SR r]\!SS 5       r^\!ST 5       r_SU r`SVrag)\ÚGEOSGeometryBaseé   NFc           	      ó8  • Xl         [        U 5      [        [        4;   ak  Ucb  [        R                  c4  SSKJnJnJnJ	n  SSK
JnJn  SSKJn	  SSKJn
  U	UUU
UUUUS.[        l        [        R                  U R"                     nX l        U R'                  5         g )Né   )ÚGeometryCollectionÚMultiLineStringÚ
MultiPointÚMultiPolygon)Ú
LinearRingÚ
LineString©ÚPoint)ÚPolygon)r   r   é   é   é   é   é   é   )Ú_ptrÚtyper   ÚGEOSGeometryÚ_GEOS_CLASSESÚcollectionsr    r!   r"   r#   Ú
linestringr$   r%   Úpointr'   Úpolygonr(   Úgeom_typeidÚ	__class__Ú
_post_init)ÚselfÚptrÚclsr    r!   r"   r#   r$   r%   r'   r(   s              ÚLD:\diplom_project\venv\Lib\site-packages\django/contrib/gis/geos/geometry.pyÚ__init__ÚGEOSGeometryBase.__init__   sŽ   € ØŒ	ô �‹:Ô*¬LÐ9Ó9Ø‰{Ü#×1Ñ1Ñ9÷ó ÷ CÝ,Ý0ð !Ø%Ø%Ø"Ø%Ø*Ø'Ø-ñ	6Ô$Ô2ô '×4Ñ4°T×5EÑ5EÑF�Ø ŒNØ�‰Õó    c                 ó¨   • U R                   (       a:  [        [        R                  " U R                  5      U R
                  5      U l        gSU l        g)z"Perform post-initialization setup.N)Úhas_csr   ÚcapiÚget_csr;   ÚhaszÚ_cs©r:   s    r=   r9   ÚGEOSGeometryBase._post_init=   s7   € ð
 ?C¿k¿kŒLœŸš T§X¡XÓ.°·	±	Ó:ð 	�ØOSð 	�r@   c                 ó"   • U R                  5       $ )z�
Return a clone because the copy of a GEOSGeometry may contain an
invalid pointer location if the original is garbage collected.
©ÚclonerG   s    r=   Ú__copy__ÚGEOSGeometryBase.__copy__E   s   € ð
 �z‰z‹|Ðr@   c                 ó"   • U R                  5       $ )zÌ
The `deepcopy` routine is used by the `Node` class of django.utils.tree;
thus, the protocol routine needs to be implemented to return correct
copies (clones) of these GEOS objects, which use C pointers.
rJ   )r:   Úmemodicts     r=   Ú__deepcopy__ÚGEOSGeometryBase.__deepcopy__L   s   € ð �z‰z‹|Ðr@   c                 ó   • U R                   $ )z+EWKT is used for the string representation.)ÚewktrG   s    r=   Ú__str__ÚGEOSGeometryBase.__str__T   s   € à�y‰yÐr@   c                 ód   • SU R                   < S[        [        U R                  5      5      < S3$ )z8Short-hand representation because WKT may be very large.Ú<z object at Ú>)Ú	geom_typeÚhexr   r;   rG   s    r=   Ú__repr__ÚGEOSGeometryBase.__repr__X   s   � à&*§n¤n´c¼)ÀDÇHÁHÓ:MÖ6NÐOÐOr@   c                 ó,   • [        U R                  5      $ ©N)ÚbytesÚwkbrG   s    r=   Ú_to_pickle_wkbÚGEOSGeometryBase._to_pickle_wkb]   s   € Ü�T—X‘X‹Ðr@   c                 óF   • [        5       R                  [        U5      5      $ r^   )r   ÚreadÚ
memoryview)r:   r`   s     r=   Ú_from_pickle_wkbÚ!GEOSGeometryBase._from_pickle_wkb`   s   € Ü‹w�|‰|œJ s›OÓ,Ð,r@   c                 ó:   • U R                  5       U R                  4$ r^   )ra   ÚsridrG   s    r=   Ú__getstate__ÚGEOSGeometryBase.__getstate__c   s   € ð ×"Ñ"Ó$ d§i¡iÐ/Ð/r@   c                 óŠ   • Uu  p#U R                  U5      nU(       d  [        S5      eX@l        U R                  5         X0l        g )Nz+Invalid Geometry loaded from pickled state.)rf   r   r;   r9   ri   )r:   Ústater`   ri   r;   s        r=   Ú__setstate__ÚGEOSGeometryBase.__setstate__h   s<   € à‰	ˆØ×#Ñ# CÓ(ˆÞÜÐ MÓNÐNØŒØ�‰ÔØ�	r@   c                 ó4   • [        5       R                  U5      $ r^   )r   rd   )r<   r`   s     r=   Ú	_from_wkbÚGEOSGeometryBase._from_wkbr   ó   € ä‹w�|‰|˜CÓ Ð r@   c                 ó8  • [        U 5      n S nU R                  SS5      n[        U5      S:X  a<  Uu  p4[        R                  " SU5      nU(       d  [        S5      e[        US   5      nOU nU(       d  [        S5      e[        [        R                  U5      US9$ )	Nó   ;r   r)   s   SRID=(?P<srid>\-?\d+)zEWKT has invalid SRID part.ri   z%Expected WKT but got an empty string.©ri   )	r   ÚsplitÚlenÚreÚmatchÚ
ValueErrorÚintr1   Ú	_from_wkt)rS   ri   ÚpartsÚ	srid_partÚwktrz   s         r=   Ú	from_ewktÚGEOSGeometryBase.from_ewktv   s�   € ä˜4Ó ˆØˆØ—
‘
˜4 Ó#ˆÜˆu‹:˜‹?Ø"‰NˆIÜ—H’HÐ6¸	ÓBˆEÞÜ Ð!>Ó?Ð?Ü�u˜V‘}Ó%‰DàˆCÞÜÐDÓEÐEÜœL×2Ñ2°3Ó7¸dÑCÐCr@   c                 ó4   • [        5       R                  U 5      $ r^   )r   rd   )r€   s    r=   r}   ÚGEOSGeometryBase._from_wkt‡   rs   r@   c                 óT   • [         R                  R                  U5      R                  $ r^   )r   ÚOGRGeometryÚfrom_gmlÚgeos)r<   Ú
gml_strings     r=   r‡   ÚGEOSGeometryBase.from_gml‹   s   € ä×Ñ×(Ñ(¨Ó4×9Ñ9Ð9r@   c                 ó  • [        U[        5      (       a   [        R                  U5      n[        U[        5      =(       a1    U R                  UR                  :H  =(       a    U R                  U5      $ ! [        [
        4 a     gf = f)zb
Equivalence testing, a Geometry may be compared with another Geometry
or an EWKT representation.
F)Ú
isinstanceÚstrr1   r�   r{   r   ri   Úequals_exact©r:   Úothers     r=   Ú__eq__ÚGEOSGeometryBase.__eq__�   sx   € ô
 �eœS×!Ñ!ðÜ$×.Ñ.¨uÓ5�ô �uœlÓ+÷ )Ø—	‘	˜UŸZ™ZÑ'÷)à×!Ñ! %Ó(ð	
øô ¤Ð.ó Ùðús   —A4 Á4BÂBc                 óD   • [        U R                  U R                  45      $ r^   )Úhashri   r€   rG   s    r=   Ú__hash__ÚGEOSGeometryBase.__hash__    s   € Ü�T—Y‘Y §¡Ð)Ó*Ð*r@   c                 ó$   • U R                  U5      $ )z0Return the union of this Geometry and the other.)Úunionr�   s     r=   Ú__or__ÚGEOSGeometryBase.__or__§   s   € à�z‰z˜%Ó Ð r@   c                 ó$   • U R                  U5      $ )z7Return the intersection of this Geometry and the other.)Úintersectionr�   s     r=   Ú__and__ÚGEOSGeometryBase.__and__¬   s   € à× Ñ  Ó'Ð'r@   c                 ó$   • U R                  U5      $ )z2Return the difference this Geometry and the other.)Ú
differencer�   s     r=   Ú__sub__ÚGEOSGeometryBase.__sub__±   s   € à�‰˜uÓ%Ð%r@   c                 ó$   • U R                  U5      $ )z?Return the symmetric difference of this Geometry and the other.)Úsym_differencer�   s     r=   Ú__xor__ÚGEOSGeometryBase.__xor__¶   s   € à×"Ñ" 5Ó)Ð)r@   c                 óZ   • U R                   (       a  U R                  R                  5       $ g)z<Return a clone of the coordinate sequence for this Geometry.N)rB   rF   rK   rG   s    r=   Ú	coord_seqÚGEOSGeometryBase.coord_seq»   s!   € ð �;�;Ø—8‘8—>‘>Ó#Ð#ð r@   c                 ó^   • [         R                  " U R                  5      R                  5       $ )z>Return a string representing the Geometry type, e.g. 'Polygon')rC   Ú	geos_typer;   ÚdecoderG   s    r=   rY   ÚGEOSGeometryBase.geom_typeÂ   s    € ô �~Š~˜dŸh™hÓ'×.Ñ.Ó0Ð0r@   c                 óB   • [         R                  " U R                  5      $ )z1Return an integer representing the Geometry type.)rC   Úgeos_typeidr;   rG   s    r=   r7   ÚGEOSGeometryBase.geom_typeidÇ   ó   € ô ×Ò §¡Ó)Ð)r@   c                 óB   • [         R                  " U R                  5      $ )z0Return the number of geometries in the Geometry.)rC   Úget_num_geomsr;   rG   s    r=   Únum_geomÚGEOSGeometryBase.num_geomÌ   ó   € ô ×!Ò! $§(¡(Ó+Ð+r@   c                 óB   • [         R                  " U R                  5      $ )z1Return the number of coordinates in the Geometry.)rC   Úget_num_coordsr;   rG   s    r=   Ú
num_coordsÚGEOSGeometryBase.num_coordsÑ   s   € ô ×"Ò" 4§8¡8Ó,Ð,r@   c                 ó   • U R                   $ )z:Return the number points, or coordinates, in the Geometry.)r¹   rG   s    r=   Ú
num_pointsÚGEOSGeometryBase.num_pointsÖ   s   € ð �‰Ðr@   c                 óB   • [         R                  " U R                  5      $ )zCReturn the dimension of this Geometry (0=point, 1=line, 2=surface).)rC   Úget_dimsr;   rG   s    r=   ÚdimsÚGEOSGeometryBase.dimsÛ   s   € ô �}Š}˜TŸX™XÓ&Ð&r@   c                 ó¶   • U(       a2  U R                  5       n[        R                  " UR                  5        U$ [        R                  " U R                  5        g)z¸
Convert this Geometry to normal form (or canonical form).
If the `clone` keyword is set, then the geometry is not modified and a
normalized clone of the geometry is returned instead.
N)rK   rC   Úgeos_normalizer;   )r:   rK   s     r=   Ú	normalizeÚGEOSGeometryBase.normalizeà   s;   € ö Ø—J‘J“LˆEÜ×Ò §	¡	Ô*ØˆLÜ×Ò˜DŸH™HÕ%r@   c                 ó˜   • [        5       S:  a  [        S5      e[        [        R                  " U R
                  5      U R                  S9$ )zp
Attempt to create a valid representation of a given invalid geometry
without losing any of the input vertices.
)r*   é   z1GEOSGeometry.make_valid() requires GEOS >= 3.8.0.rv   )r   r   r1   rC   Úgeos_makevalidr;   ri   rG   s    r=   Ú
make_validÚGEOSGeometryBase.make_validì   s;   € ô
 Ó &Ó(ÜÐ SÓTÐTÜœD×/Ò/°·±Ó9ÀÇ	Á	ÑJÐJr@   c                 óB   • [         R                  " U R                  5      $ )zS
Return a boolean indicating whether the set of points in this Geometry
are empty.
)rC   Úgeos_isemptyr;   rG   s    r=   ÚemptyÚGEOSGeometryBase.emptyö   s   € ô × Ò  §¡Ó*Ð*r@   c                 óB   • [         R                  " U R                  5      $ )z/Return whether the geometry has a 3D dimension.)rC   Ú	geos_haszr;   rG   s    r=   rE   ÚGEOSGeometryBase.haszþ   s   € ô �~Š~˜dŸh™hÓ'Ð'r@   c                 óB   • [         R                  " U R                  5      $ )z-Return whether or not the geometry is a ring.)rC   Úgeos_isringr;   rG   s    r=   ÚringÚGEOSGeometryBase.ring  r±   r@   c                 óB   • [         R                  " U R                  5      $ )z*Return false if the Geometry isn't simple.)rC   Úgeos_issimpler;   rG   s    r=   ÚsimpleÚGEOSGeometryBase.simple  r¶   r@   c                 óB   • [         R                  " U R                  5      $ )z#Test the validity of this Geometry.)rC   Úgeos_isvalidr;   rG   s    r=   ÚvalidÚGEOSGeometryBase.valid  s   € ô × Ò  §¡Ó*Ð*r@   c                 ó^   • [         R                  " U R                  5      R                  5       $ )z;
Return a string containing the reason for any invalidity.
)rC   Úgeos_isvalidreasonr;   r¬   rG   s    r=   Úvalid_reasonÚGEOSGeometryBase.valid_reason  s"   € ô
 ×&Ò& t§x¡xÓ0×7Ñ7Ó9Ð9r@   c                 óX   • [         R                  " U R                  UR                  5      $ )z/Return true if other.within(this) returns true.)rC   Úgeos_containsr;   r�   s     r=   ÚcontainsÚGEOSGeometryBase.contains  s   € ä×!Ò! $§(¡(¨E¯I©IÓ6Ð6r@   c                 óX   • [         R                  " U R                  UR                  5      $ )z£
Return True if the DE-9IM Intersection Matrix for the two geometries is
T*****FF*, *T****FF*, ***T**FF*, or ****T*FF*. If either geometry is
empty, return False.
)rC   Úgeos_coversr;   r�   s     r=   ÚcoversÚGEOSGeometryBase.covers  s   € ô ×Ò §¡¨%¯)©)Ó4Ð4r@   c                 óX   • [         R                  " U R                  UR                  5      $ )z³
Return true if the DE-9IM intersection matrix for the two Geometries
is T*T****** (for a point and a curve,a point and an area or a line and
an area) 0******** (for two curves).
)rC   Úgeos_crossesr;   r�   s     r=   ÚcrossesÚGEOSGeometryBase.crosses&  s   € ô × Ò  §¡¨5¯9©9Ó5Ð5r@   c                 óX   • [         R                  " U R                  UR                  5      $ )zT
Return true if the DE-9IM intersection matrix for the two Geometries
is FF*FF****.
)rC   Úgeos_disjointr;   r�   s     r=   ÚdisjointÚGEOSGeometryBase.disjoint.  ó   € ô
 ×!Ò! $§(¡(¨E¯I©IÓ6Ð6r@   c                 óX   • [         R                  " U R                  UR                  5      $ )zT
Return true if the DE-9IM intersection matrix for the two Geometries
is T*F**FFF*.
)rC   Úgeos_equalsr;   r�   s     r=   ÚequalsÚGEOSGeometryBase.equals5  ó   € ô
 ×Ò §¡¨%¯)©)Ó4Ð4r@   c                 ól   • [         R                  " U R                  UR                  [        U5      5      $ )zS
Return true if the two Geometries are exactly equal, up to a
specified tolerance.
)rC   Úgeos_equalsexactr;   Úfloat)r:   r�   Ú	tolerances      r=   rŽ   ÚGEOSGeometryBase.equals_exact<  s&   € ô
 ×$Ò$ T§X¡X¨u¯y©y¼%À	Ó:JÓKÐKr@   c                 óX   • [         R                  " U R                  UR                  5      $ )z%Return true if disjoint return false.)rC   Úgeos_intersectsr;   r�   s     r=   Ú
intersectsÚGEOSGeometryBase.intersectsC  s   € ä×#Ò# D§H¡H¨e¯i©iÓ8Ð8r@   c                 óX   • [         R                  " U R                  UR                  5      $ )z�
Return true if the DE-9IM intersection matrix for the two Geometries
is T*T***T** (for two points or two surfaces) 1*T***T** (for two curves).
)rC   Úgeos_overlapsr;   r�   s     r=   ÚoverlapsÚGEOSGeometryBase.overlapsG  rò   r@   c                 óÊ   • [        U[        5      (       a  [        U5      S:”  a  [        S5      e[        R
                  " U R                  UR                  [        U5      5      $ )zu
Return true if the elements in the DE-9IM intersection matrix for the
two Geometries match the elements in pattern.
é	   z#invalid intersection matrix pattern)rŒ   r�   rx   r   rC   Úgeos_relatepatternr;   r   )r:   r�   Úpatterns      r=   Úrelate_patternÚGEOSGeometryBase.relate_patternN  sJ   € ô
 ˜'¤3×'Ñ'¬3¨w«<¸!Ó+;ÜÐ EÓFÐFÜ×&Ò& t§x¡x°·±¼KÈÓ<PÓQÐQr@   c                 óX   • [         R                  " U R                  UR                  5      $ )zl
Return true if the DE-9IM intersection matrix for the two Geometries
is FT*******, F**T***** or F***T****.
)rC   Úgeos_touchesr;   r�   s     r=   ÚtouchesÚGEOSGeometryBase.touchesW  s   € ô
 × Ò  §¡¨5¯9©9Ó5Ð5r@   c                 óX   • [         R                  " U R                  UR                  5      $ )zT
Return true if the DE-9IM intersection matrix for the two Geometries
is T*F**F***.
)rC   Úgeos_withinr;   r�   s     r=   ÚwithinÚGEOSGeometryBase.within^  r÷   r@   c                 óT   • [         R                  " U R                  5      nUS:X  a  gU$ )z=Get the SRID for the geometry. Return None if no SRID is set.r   N)rC   Úgeos_get_sridr;   )r:   Úss     r=   ri   ÚGEOSGeometryBase.sridf  s'   € ô ×Ò˜tŸx™xÓ(ˆØ�‹6ØàˆHr@   c                 óZ   • [         R                  " U R                  Uc  S5        gU5        g)zSet the SRID for the geometry.Nr   )rC   Úgeos_set_sridr;   ©r:   ri   s     r=   ri   r  o  s!   € ô 	×Ò˜4Ÿ8™8¨$©, QÕA¸DÕAr@   c                 óh   • U R                   nU(       a  SU< SU R                  < 3$ U R                  $ )z/
Return the EWKT (SRID + WKT) of the Geometry.
zSRID=Ú;)ri   r€   r  s     r=   rS   ÚGEOSGeometryBase.ewktu  s'   € ð
 �y‰yˆß26›t T§X£XÐ.ÐD¸D¿H¹HÐDr@   c                 óv   • [        U R                  (       a  SOSSS9R                  U 5      R                  5       $ )zAReturn the WKT (Well-Known Text) representation of this Geometry.r*   r)   T)ÚdimÚtrim)r   rE   Úwriter¬   rG   s    r=   r€   ÚGEOSGeometryBase.wkt}  s-   € ô ˜dŸiŸi™¨Q°TÑ:×@Ñ@ÀÓF×MÑMÓOÐOr@   c                 óX   • [        U R                  (       a  SOSS9R                  U 5      $ )zÏ
Return the WKB of this Geometry in hexadecimal form. Please note
that the SRID is not included in this representation because it is not
a part of the OGC specification (use the `hexewkb` property instead).
r*   r)   ©r  )r   rE   Ú	write_hexrG   s    r=   rZ   ÚGEOSGeometryBase.hex‚  s"   € ô ˜dŸiŸi™¨QÑ/×9Ñ9¸$Ó?Ð?r@   c                 óX   • [        U R                  (       a  SOSS9R                  U 5      $ )z 
Return the EWKB of this Geometry in hexadecimal form. This is an
extension of the WKB specification that includes SRID value that are
a part of this geometry.
r*   r)   r#  )r   rE   r$  rG   s    r=   ÚhexewkbÚGEOSGeometryBase.hexewkb�  s"   € ô ˜tŸyŸy™!¨aÑ0×:Ñ:¸4Ó@Ð@r@   c                 ó.   • U R                   R                  $ )z1
Return GeoJSON representation of this Geometry.
)ÚogrÚjsonrG   s    r=   r+  ÚGEOSGeometryBase.json–  s   € ð
 �x‰x�}‰}Ðr@   c                 ó\   • [        U R                  (       a  SOS5      R                  U 5      $ )z¡
Return the WKB (Well-Known Binary) representation of this Geometry
as a Python memoryview. SRID and Z values are not included, use the
`ewkb` property instead.
r*   r)   )r   rE   r   rG   s    r=   r`   ÚGEOSGeometryBase.wkbŸ  s"   € ô ˜$Ÿ)Ÿ)‘Q¨Ó+×1Ñ1°$Ó7Ð7r@   c                 ó\   • [        U R                  (       a  SOS5      R                  U 5      $ )z¶
Return the EWKB representation of this Geometry as a Python memoryview.
This is an extension of the WKB specification that includes any SRID
value that are a part of this geometry.
r*   r)   )r   rE   r   rG   s    r=   ÚewkbÚGEOSGeometryBase.ewkb¨  s"   € ô ˜4Ÿ9Ÿ9‘a¨!Ó,×2Ñ2°4Ó8Ð8r@   c                 ó`   • U R                   nSU< SU R                  R                  < SU< S3$ )z/Return the KML representation of this Geometry.rW   rX   z</)rY   r¨   Úkml)r:   Úgtypes     r=   r3  ÚGEOSGeometryBase.kml±  s$   € ð —‘‰Û % t§~¡~×'9Ô'9»5ÐAÐAr@   c                 ó   • [        U 5      $ )z‚
Return a PreparedGeometry corresponding to this geometry -- it is
optimized for the contains, intersects, and covers operations.
r   rG   s    r=   ÚpreparedÚGEOSGeometryBase.prepared·  s   € ô   Ó%Ð%r@   c                 óT   • [         R                  R                  U R                  5      $ r^   )r   r†   rq   r`   rG   s    r=   Ú_ogr_ptrÚGEOSGeometryBase._ogr_ptrÀ  s   € Ü×Ñ×)Ñ)¨$¯(©(Ó3Ð3r@   c                 ó`   • [         R                  " U R                  5       U R                  5      $ )z*Return the OGR Geometry for this Geometry.)r   r†   r:  ÚsrsrG   s    r=   r*  ÚGEOSGeometryBase.ogrÃ  s!   € ô ×Ò §¡£°·±Ó:Ð:r@   c                 ó¼   • U R                   (       a!   [        R                  " U R                   5      $ g! [        R                  [        R                  4 a     gf = f)z:Return the OSR SpatialReference for SRID of this Geometry.N)ri   r   ÚSpatialReferenceÚGDALExceptionÚSRSExceptionrG   s    r=   r=  ÚGEOSGeometryBase.srsÈ  sR   € ð �9�9ðÜ×,Ò,¨T¯Y©YÓ7Ð7ð øô ×&Ñ&¬×(9Ñ(9Ð:ó ØØðús   “4 ´$AÁAc                 ó   • U R                   $ )zAlias for `srs` property.)r=  rG   s    r=   ÚcrsÚGEOSGeometryBase.crsÒ  s   € ð �x‰xˆr@   c                 ó4  • U R                   nX:X  a  U(       a  U R                  5       $ g[        U[        R                  5      (       a  SnOUb  US:  a  [        S5      e[        R                  " U R                  5       U5      nUR                  U5        UR                  5       nU(       a  [        XTR                   S9$ U(       aH  [        R                  " U R                  5        XPl        U R                  5         UR                   U l         g[        S5      e)a4  
Requires GDAL. Transform the geometry according to the given
transformation object, which may be an integer SRID, and WKT or
PROJ string. By default, transform the geometry in-place and return
nothing. However if the `clone` keyword is set, don't modify the
geometry and return a transformed clone instead.
Nr   z5Calling transform() with no SRID set is not supportedrv   zTransformed WKB was invalid.)ri   rK   rŒ   r   ÚCoordTransformr   r†   r:  Ú	transformÚ	_geos_ptrr1   rC   Údestroy_geomr;   r9   )r:   ÚctrK   ri   Úgr;   s         r=   rI  ÚGEOSGeometryBase.transform×  sÔ   € ð �y‰yˆà‹:æØ—z‘z“|Ð#àä�bœ$×-Ñ-×.Ñ.ð ‰DØ‰\˜T A›XÜÐ WÓXÐXô ×Ò˜TŸ]™]›_¨dÓ3ˆØ	�‰�BŒà�k‰k‹mˆÞä ¯&©&Ñ1Ð1Þô ×Ò˜dŸh™hÔ'ØŒHØ�O‰OÔØŸ™ˆD�IäÐ >Ó?Ð?r@   c                 ó(   • [        XR                  S9$ )z'Return Geometry from the given pointer.rv   )r1   ri   )r:   Úgptrs     r=   Ú	_topologyÚGEOSGeometryBase._topology  s   € ä˜D§y¡yÑ1Ð1r@   c                 ó`   • U R                  [        R                  " U R                  5      5      $ )z9Return the boundary as a newly allocated Geometry object.)rQ  rC   Úgeos_boundaryr;   rG   s    r=   ÚboundaryÚGEOSGeometryBase.boundary  ó"   € ð �~‰~œd×0Ò0°·±Ó:Ó;Ð;r@   c                 ób   • U R                  [        R                  " U R                  X5      5      $ )aS  
Return a geometry that represents all points whose distance from this
Geometry is less than or equal to distance. Calculations are in the
Spatial Reference System of this Geometry. The optional third parameter sets
the number of segment used to approximate a quarter circle (defaults to 8).
(Text from PostGIS documentation at ch. 6.1.3)
)rQ  rC   Úgeos_bufferr;   )r:   ÚwidthÚquadsegss      r=   ÚbufferÚGEOSGeometryBase.buffer  s$   € ð �~‰~œd×.Ò.¨t¯x©x¸ÓIÓJÐJr@   c           
      óf   • U R                  [        R                  " U R                  XX4U5      5      $ )zé
Same as buffer() but allows customizing the style of the memoryview.

End cap style can be round (1), flat (2), or square (3).
Join style can be round (1), mitre (2), or bevel (3).
Mitre ratio limit only affects mitered join style.
)rQ  rC   Úgeos_bufferwithstyler;   )r:   rZ  r[  Úend_cap_styleÚ
join_styleÚmitre_limits         r=   Úbuffer_with_styleÚ"GEOSGeometryBase.buffer_with_style  s0   € ð �~‰~Ü×%Ò%Ø—‘˜%¨=Àkóó
ð 	
r@   c                 ó`   • U R                  [        R                  " U R                  5      5      $ )z°
The centroid is equal to the centroid of the set of component Geometries
of highest dimension (since the lower-dimension geometries contribute zero
"weight" to the centroid).
)rQ  rC   Úgeos_centroidr;   rG   s    r=   ÚcentroidÚGEOSGeometryBase.centroid%  s"   € ð �~‰~œd×0Ò0°·±Ó:Ó;Ð;r@   c                 ó`   • U R                  [        R                  " U R                  5      5      $ )zR
Return the smallest convex Polygon that contains all the points
in the Geometry.
)rQ  rC   Úgeos_convexhullr;   rG   s    r=   Úconvex_hullÚGEOSGeometryBase.convex_hull.  s"   € ð �~‰~œd×2Ò2°4·8±8Ó<Ó=Ð=r@   c                 óv   • U R                  [        R                  " U R                  UR                  5      5      $ )z^
Return a Geometry representing the points making up this Geometry
that do not make up other.
)rQ  rC   Úgeos_differencer;   r�   s     r=   r    ÚGEOSGeometryBase.difference6  s(   € ð
 �~‰~œd×2Ò2°4·8±8¸U¿Y¹YÓGÓHÐHr@   c                 ó`   • U R                  [        R                  " U R                  5      5      $ )z2Return the envelope for this geometry (a polygon).)rQ  rC   Úgeos_enveloper;   rG   s    r=   ÚenvelopeÚGEOSGeometryBase.envelope=  rW  r@   c                 óv   • U R                  [        R                  " U R                  UR                  5      5      $ )zLReturn a Geometry representing the points shared by this Geometry and other.)rQ  rC   Úgeos_intersectionr;   r�   s     r=   rœ   ÚGEOSGeometryBase.intersectionB  s&   € à�~‰~œd×4Ò4°T·X±X¸u¿y¹yÓIÓJÐJr@   c                 ó`   • U R                  [        R                  " U R                  5      5      $ )z+Compute an interior point of this Geometry.)rQ  rC   Úgeos_pointonsurfacer;   rG   s    r=   Úpoint_on_surfaceÚ!GEOSGeometryBase.point_on_surfaceF  s"   € ð �~‰~œd×6Ò6°t·x±xÓ@ÓAÐAr@   c                 ót   • [         R                  " U R                  UR                  5      R                  5       $ )zFReturn the DE-9IM intersection matrix for this Geometry and the other.)rC   Úgeos_relater;   r¬   r�   s     r=   ÚrelateÚGEOSGeometryBase.relateK  s&   € ä×Ò §¡¨%¯)©)Ó4×;Ñ;Ó=Ð=r@   c                 óÐ   • U(       a0  U R                  [        R                  " U R                  U5      5      $ U R                  [        R                  " U R                  U5      5      $ )aÚ  
Return the Geometry, simplified using the Douglas-Peucker algorithm
to the specified tolerance (higher tolerance => less points).  If no
tolerance provided, defaults to 0.

By default, don't preserve topology - e.g. polygons can be split,
collapse to lines or disappear holes can be created or disappear, and
lines can cross. By specifying preserve_topology=True, the result will
have the same dimension and number of components as the input. This is
significantly slower.
)rQ  rC   Úgeos_preservesimplifyr;   Úgeos_simplify)r:   rû   Úpreserve_topologys      r=   ÚsimplifyÚGEOSGeometryBase.simplifyO  sG   € ö Ø—>‘>¤$×"<Ò"<¸T¿X¹XÀyÓ"QÓRÐRà—>‘>¤$×"4Ò"4°T·X±X¸yÓ"IÓJÐJr@   c                 óv   • U R                  [        R                  " U R                  UR                  5      5      $ )zp
Return a set combining the points in this Geometry not in other,
and the points in other not in this Geometry.
)rQ  rC   Úgeos_symdifferencer;   r�   s     r=   r¤   ÚGEOSGeometryBase.sym_difference`  s(   € ð
 �~‰~œd×5Ò5°d·h±hÀÇ	Á	ÓJÓKÐKr@   c                 ó`   • U R                  [        R                  " U R                  5      5      $ )z6Return the union of all the elements of this geometry.)rQ  rC   Úgeos_unary_unionr;   rG   s    r=   Úunary_unionÚGEOSGeometryBase.unary_uniong  s"   € ð �~‰~œd×3Ò3°D·H±HÓ=Ó>Ð>r@   c                 óv   • U R                  [        R                  " U R                  UR                  5      5      $ )zIReturn a Geometry representing all the points in this Geometry and other.)rQ  rC   Ú
geos_unionr;   r�   s     r=   r˜   ÚGEOSGeometryBase.unionl  s$   € à�~‰~œdŸošo¨d¯h©h¸¿	¹	ÓBÓCÐCr@   c                 óf   • [         R                  " U R                  [        [	        5       5      5      $ )z Return the area of the Geometry.)rC   Ú	geos_arear;   r   r   rG   s    r=   ÚareaÚGEOSGeometryBase.areaq  s    € ô �~Š~˜dŸh™h¬¬h«jÓ(9Ó:Ð:r@   c                 ó¼   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  UR
                  [        [        5       5      5      $ )z‘
Return the distance between the closest points on this Geometry
and the other. Units will be in those of the coordinate system of
the Geometry.
z/distance() works only on other GEOS Geometries.)rŒ   r1   Ú	TypeErrorrC   Úgeos_distancer;   r   r   r�   s     r=   ÚdistanceÚGEOSGeometryBase.distancev  sA   € ô ˜%¤×.Ñ.ÜÐMÓNÐNÜ×!Ò! $§(¡(¨E¯I©I´u¼X»ZÓ7HÓIÐIr@   c                 ó˜   • SSK Jn  U R                  n[        X!5      (       a  UR                  u  p4X4peOUS   S   u  p4US   S   u  pVX4XV4$ )zZ
Return the extent of this geometry as a 4-tuple, consisting of
(xmin, ymin, xmax, ymax).
r   r&   r   r)   )r5   r'   rr  rŒ   Útuple)r:   r'   ÚenvÚxminÚyminÚxmaxÚymaxs          r=   ÚextentÚGEOSGeometryBase.extent€  sT   € õ 	!à�m‰mˆÜ�c×!Ñ!ØŸ™‰JˆDØ‘$à˜Q™ ™‰JˆDØ˜Q™ ™‰JˆDØ˜DÐ'Ð'r@   c                 óf   • [         R                  " U R                  [        [	        5       5      5      $ )z\
Return the length of this Geometry (e.g., 0 for point, or the
circumference of a Polygon).
)rC   Úgeos_lengthr;   r   r   rG   s    r=   ÚlengthÚGEOSGeometryBase.length‘  s"   € ô ×Ò §¡¬%´³
Ó*;Ó<Ð<r@   c                 óT   • [        [        R                  " U R                  5      5      $ )zClone this Geometry.)r1   rC   Ú
geom_cloner;   rG   s    r=   rK   ÚGEOSGeometryBase.clone™  s   € äœDŸOšO¨D¯H©HÓ5Ó6Ð6r@   )r8   rF   r/   r;   ri   )F)r   )rÇ   )rÇ   r   r   g      @)g        F)bÚ__name__Ú
__module__Ú__qualname__Ú__firstlineno__r2   r   Úptr_typerC   rK  Ú
destructorrB   r>   r9   rL   rP   rT   r[   ra   rf   rj   rn   Úclassmethodrq   Ústaticmethodr�   r}   r‡   r‘   r•   r™   r�   r¡   r¥   Úpropertyr¨   rY   r7   r´   r¹   r¼   rÀ   rÄ   rÉ   rÍ   rE   rÔ   rØ   rÜ   rà   rä   rè   rì   rð   rõ   rŽ   rÿ   r  r	  r  r  ri   ÚsetterrS   r€   rZ   r'  r+  Úgeojsonr`   r0  r3  r7  r:  r*  r=  rE  rI  rQ  rU  r\  rc  rg  rk  r    rr  rœ   ry  r}  rƒ  r¤   rŠ  r˜   r‘  r–  rŸ  r£  rK   Ú__static_attributes__© r@   r=   r   r      s<  † Ø€Mà€HØ×"Ñ"€JØ€Fòò@
òòòòPò
ò-ò0ò
ð ñ!ó ð!ð ñDó ðDð  ñ!ó ð!ð ñ:ó ð:ò
ò +ò!ò
(ò
&ò
*ð
 ñ$ó ð$ð ñ1ó ð1ð ñ*ó ð*ð ñ,ó ð,ð ñ-ó ð-ð ñó ðð ñ'ó ð'ô
&òKð ñ+ó ð+ð ñ(ó ð(ð ñ*ó ð*ð ñ,ó ð,ð ñ+ó ð+ð ñ:ó ð:ò7ò5ò6ò7ò5ôLò9ò7òRò6ò5ð ñó ðð 
‡[�[ñBó ðBð
 ñEó ðEð ñPó ðPð ñ@ó ð@ð ñAó ðAð ñó ðð €Gàñ8ó ð8ð ñ9ó ð9ð ñBó ðBð
 ñ&ó ð&ò4ð ñ;ó ð;ð ñó ðð ñó ðô(@òV2ð ñ<ó ð<ôKð MPô
ð  ñ<ó ð<ð ñ>ó ð>òIð ñ<ó ð<òKð ñBó ðBò>ôKò"Lð ñ?ó ð?òDð
 ñ;ó ð;òJð ñ(ó ð(ð  ñ=ó ð=õ7r@   r   c                   óP   • \ rS rSrSrS rS rS rS r\	S 5       r
\	S 5       rS	rg
)ÚLinearGeometryMixiniž  z*
Used for LineString and MultiLineString.
c                 ób   • U R                  [        R                  " U R                  U5      5      $ r^   )rQ  rC   Úgeos_interpolater;   ©r:   r–  s     r=   ÚinterpolateÚLinearGeometryMixin.interpolate£  s"   € Ø�~‰~œd×3Ò3°D·H±H¸hÓGÓHÐHr@   c                 ób   • U R                  [        R                  " U R                  U5      5      $ r^   )rQ  rC   Úgeos_interpolate_normalizedr;   r¹  s     r=   Úinterpolate_normalizedÚ*LinearGeometryMixin.interpolate_normalized¦  s"   € Ø�~‰~œd×>Ò>¸t¿x¹xÈÓRÓSÐSr@   c                 óš   • SSK Jn  [        X5      (       d  [        S5      e[        R
                  " U R                  UR                  5      $ ©Nr   r&   z%locate_point argument must be a Point)r5   r'   rŒ   r”  rC   Úgeos_projectr;   ©r:   r5   r'   s      r=   ÚprojectÚLinearGeometryMixin.project©  s7   € Ý ä˜%×'Ñ'ÜÐCÓDÐDÜ× Ò  §¡¨5¯9©9Ó5Ð5r@   c                 óš   • SSK Jn  [        X5      (       d  [        S5      e[        R
                  " U R                  UR                  5      $ rÁ  )r5   r'   rŒ   r”  rC   Úgeos_project_normalizedr;   rÃ  s      r=   Úproject_normalizedÚ&LinearGeometryMixin.project_normalized°  s7   € Ý ä˜%×'Ñ'ÜÐCÓDÐDÜ×+Ò+¨D¯H©H°e·i±iÓ@Ð@r@   c                 ó`   • U R                  [        R                  " U R                  5      5      $ )z)
Return the line merge of this Geometry.
)rQ  rC   Úgeos_linemerger;   rG   s    r=   ÚmergedÚLinearGeometryMixin.merged·  s"   € ð
 �~‰~œd×1Ò1°$·(±(Ó;Ó<Ð<r@   c                 óB   • [         R                  " U R                  5      $ )z0
Return whether or not this Geometry is closed.
)rC   Úgeos_isclosedr;   rG   s    r=   ÚclosedÚLinearGeometryMixin.closed¾  s   € ô
 ×!Ò! $§(¡(Ó+Ð+r@   r´  N)r¨  r©  rª  r«  Ú__doc__rº  r¾  rÄ  rÈ  r°  rÌ  rÐ  r³  r´  r@   r=   r¶  r¶  ž  sF   † ñòIòTò6òAð ñ=ó ð=ð ñ,ó ó,r@   r¶  c                   ó0   ^ • \ rS rSrSrSU 4S jjrSrU =r$ )r1   iÆ  z6A class that, generally, encapsulates a GEOS geometry.c                 ó¸  >• Sn[        U[        5      (       a  [        U5      n[        U[        5      (       aô  [        R
                  " U5      nU(       a7  US   (       a  [        US   5      nU R                  [        US   5      5      nGO4[        R
                  " U5      (       a#  [        5       R                  [        U5      5      nOö[        R
                  " U5      (       a<  [        R                  R                  U5      nUR!                  5       nUR"                  nOŸ[%        S5      e[        U[&        5      (       a  UnO|[        U[(        5      (       a  [        5       R                  U5      nOM[        U[*        5      (       a!  [,        R.                  " UR0                  5      nO[3        S[5        U5      -  5      eU(       d  [7        S5      eU=(       d    [,        R8                  " U5      =(       d    SnU(       a  U(       a  X2:w  a  [%        SU-  5      e[:        TU ]y  US5        U=(       d    UnU(       a  [        U[        5      (       a  X l        ggg)aX  
The base constructor for GEOS geometry objects. It may take the
following inputs:

 * strings:
    - WKT
    - HEXEWKB (a PostGIS-specific canonical form)
    - GeoJSON (requires GDAL)
 * memoryview:
    - WKB

The `srid` keyword specifies the Source Reference Identifier (SRID)
number for this Geometry. If not provided, it defaults to None.
Nri   r€   z3String input unrecognized as WKT EWKT, and HEXEWKB.z Improper geometry input type: %sz4Could not initialize GEOS Geometry with given input.z$Input geometry already has SRID: %d.)rŒ   r_   r   r�   r	   rz   r|   r}   r   r   r   rd   r   r   r†   Ú	from_jsonrJ  ri   r{   r   re   r1   rC   r¦  r;   r”  r0   r   r  Úsuperr>   )r:   Ú	geo_inputri   Ú
input_sridÚwkt_mrM  r*  r8   s          €r=   r>   ÚGEOSGeometry.__init__Ê  s±  ø€ ð ˆ
Ü�i¤×'Ñ'Ü! )Ó,ˆIÜ�i¤×%Ñ%Ü—O’O IÓ.ˆEÞà˜—=Ü!$ U¨6¡]Ó!3�JØ—N‘N¤;¨u°U©|Ó#<Ó=’Ü—’ ×+Ñ+ä“G—L‘L¤¨YÓ!7Ó8‘Ü×!Ò! )×,Ñ,ä×&Ñ&×0Ñ0°Ó;�Ø—M‘M“O�Ø ŸX™X‘
ä Ð!VÓWÐWÜ˜	¤8×,Ñ,à‰AÜ˜	¤:×.Ñ.ä“—‘˜YÓ'‰AÜ˜	¤<×0Ñ0Ü—’ 	§¡Ó.‰AäÐ>ÄÀiÃÑPÓQÐQæÜÐ VÓWÐWà×@¤4×#5Ò#5°aÓ#8×@¸Dˆ
Þž$ :Ó#5ÜÐCÀjÑPÓQÐQä‰Ñ˜˜DÔ!à×!˜TˆÞ”J˜t¤S×)Ñ)Ø�Ið *ˆ4r@   rv   r^   )r¨  r©  rª  r«  rÒ  r>   r³  Ú__classcell__)r8   s   @r=   r1   r1   Æ  s   ø† á<÷9õ 9r@   r1   )*rÒ  ry   Úctypesr   r   r   Údjango.contrib.gisr   Údjango.contrib.gis.geometryr   r   r	   Údjango.contrib.gis.geosr
   rC   Údjango.contrib.gis.geos.baser   Ú django.contrib.gis.geos.coordseqr   Údjango.contrib.gis.geos.errorr   Údjango.contrib.gis.geos.libgeosr   r   Ú$django.contrib.gis.geos.mutable_listr   Ú django.contrib.gis.geos.preparedr   Ú%django.contrib.gis.geos.prototypes.ior   r   r   r   r   Údjango.utils.deconstructr   Údjango.utils.encodingr   r   r   r¶  r1   r´  r@   r=   Ú<module>ré     sw   ðñó 
ß -Ñ -å #ß HÑ HÝ 6Ý 1Ý 9Ý 7ß HÝ :Ý =ß TÕ TÝ 4ß 8ôE
7�xô E
7÷P%,ñ %,ðP ô<Ð# Yó <ó ñ<r@   