
    hh                         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(SXS 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+ r5SYS, jr6S- r7S. r8S/ r9S0 r:S1 r;S2 r<\!S3 5       r=\=R|                  S4 5       r=\!S5 5       r?\!S6 5       r@\!S7 5       rA\!S8 5       rB\!S9 5       rC\CrD\!S: 5       rE\!S; 5       rF\!S< 5       rG\!S= 5       rHS> rI\!S? 5       rJ\!S@ 5       rK\!SA 5       rLSXSB jrMSC rN\!SD 5       rOSZSE jrP S[SF jrQ\!SG 5       rR\!SH 5       rSSI rT\!SJ 5       rUSK rV\!SL 5       rWSM rXS\SN jrYSO rZ\!SP 5       r[SQ r\\!SR 5       r]SS r^\!ST 5       r_\!SU 5       r`SV raSWrbg)]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              R/var/www/html/env/lib/python3.13/site-packages/django/contrib/gis/geos/geometry.py__init__GEOSGeometryBase.__init__   s    	 :*L99{#119  C,0 !%%"%*'-	6$2 '44T5E5E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kkLTXX.		: 	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__F   s    
 zz|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__M   s     zz|r@   c                     U R                   $ )z+EWKT is used for the string representation.)ewktrG   s    r=   __str__GEOSGeometryBase.__str__U   s    yy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__Y   s    &*nnc)DHH:M6NOOr@   c                 ,    [        U R                  5      $ N)byteswkbrG   s    r=   _to_pickle_wkbGEOSGeometryBase._to_pickle_wkb^   s    TXXr@   c                 F    [        5       R                  [        U5      5      $ r^   )r   read
memoryview)r:   r`   s     r=   _from_pickle_wkb!GEOSGeometryBase._from_pickle_wkba   s    w||JsO,,r@   c                 :    U R                  5       U R                  4$ r^   )ra   sridrG   s    r=   __getstate__GEOSGeometryBase.__getstate__d   s     ""$dii//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__i   s<    	##C( MNN	r@   c                 4    [        5       R                  U5      $ r^   )r   rd   )r<   r`   s     r=   	_from_wkbGEOSGeometryBase._from_wkbs       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_ewktw   s    4 

4#u:?"NIHH6	BE !>??uV}%DCDEEL2237d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    
 eS!!$..u5 ul+ )		UZZ')!!%(	
 . s   A4 4BBc                 D    [        U R                  U R                  45      $ r^   )hashri   r   rG   s    r=   __hash__GEOSGeometryBase.__hash__   s    TYY)**r@   c                 $    U R                  U5      $ )z0Return the union of this Geometry and the other.)unionr   s     r=   __or__GEOSGeometryBase.__or__   s    zz%  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!     ;;88>>## 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      ~~dhh'..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     ""488,,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     }}TXX&&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;     JJLE		*LDHH%r@   c                 f    [        [        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.
rv   )r1   rC   geos_makevalidr;   ri   rG   s    r=   
make_validGEOSGeometryBase.make_valid   s$    
 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     ~~dhh''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"    
 &&txx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    !!$((EII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       599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-      
 !!$((EII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.equals4      
 %))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&    
 $$TXXuyy%	:JKKr@   c                     [        5       S:  a  [        S5      e[        R                  " U R                  UR                  5      $ )z>
Return true if the two Geometries are point-wise equivalent.
)r*      z8GEOSGeometry.equals_identical() requires GEOS >= 3.12.0.)r   r   rC   geos_equalsidenticalr;   r   s     r=   equals_identical!GEOSGeometryBase.equals_identicalB  s<     ')J  ((599==r@   c                 X    [         R                  " U R                  UR                  5      $ )z%Return true if disjoint return false.)rC   geos_intersectsr;   r   s     r=   
intersectsGEOSGeometryBase.intersectsL  s    ##DHHeii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.overlapsP  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_patternW  sJ    
 '3''3w<!+; EFF&&txx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.touches`  s    
   599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.withing  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.srido  s'     txx(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  x  s!     	488$,QAD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.ewkt~  s'    
 yy26tTXX.DDHH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-     diiQT:@@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"     dii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"     tyy!a0::4@@r@   c                 .    U R                   R                  $ )z1
Return GeoJSON representation of this Geometry.
)ogrjsonrG   s    r=   r/  GEOSGeometryBase.json  s    
 xx}}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"     499a!,224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=   r7  GEOSGeometryBase.kml  s$      %t~~'9'95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=   rA  GEOSGeometryBase.srs  sR     99,,TYY77  &&(9(9: s   4 $AAc                     U R                   $ )zAlias for `srs` property.)rA  rG   s    r=   crsGEOSGeometryBase.crs  s     xx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=   rM  GEOSGeometryBase.transform  s     yy:zz|#b$--.. D\TAX WXX T]]_d3	Bkkm&&11 dhh'HOODI >??r@   c                 (    [        XR                  S9$ )z'Return Geometry from the given pointer.rv   )r1   ri   )r:   gptrs     r=   	_topologyGEOSGeometryBase._topology  s    Dyy11r@   c                 `    U R                  [        R                  " U R                  5      5      $ )z9Return the boundary as a newly allocated Geometry object.)rU  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)
)rU  rC   geos_bufferr;   )r:   widthquadsegss      r=   bufferGEOSGeometryBase.buffer  s$     ~~d..txx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.
)rU  rC   geos_bufferwithstyler;   )r:   r^  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).
)rU  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.
)rU  rC   geos_convexhullr;   rG   s    r=   convex_hullGEOSGeometryBase.convex_hull7  s"     ~~d22488<==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.
)rU  rC   geos_differencer;   r   s     r=   r   GEOSGeometryBase.difference?  s(    
 ~~d22488UYYGHHr@   c                 `    U R                  [        R                  " U R                  5      5      $ )z2Return the envelope for this geometry (a polygon).)rU  rC   geos_enveloper;   rG   s    r=   envelopeGEOSGeometryBase.envelopeF  r[  r@   c                 v    U R                  [        R                  " U R                  UR                  5      5      $ )zLReturn a Geometry representing the points shared by this Geometry and other.)rU  rC   geos_intersectionr;   r   s     r=   r   GEOSGeometryBase.intersectionK  s&    ~~d44TXXuyyIJJr@   c                 `    U R                  [        R                  " U R                  5      5      $ )z+Compute an interior point of this Geometry.)rU  rC   geos_pointonsurfacer;   rG   s    r=   point_on_surface!GEOSGeometryBase.point_on_surfaceO  s"     ~~d66txx@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.relateT  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.
)rU  rC   geos_preservesimplifyr;   geos_simplify)r:   r   preserve_topologys      r=   simplifyGEOSGeometryBase.simplifyX  sG     >>$"<"<TXXy"QRR>>$"4"4TXXy"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.
)rU  rC   geos_symdifferencer;   r   s     r=   r   GEOSGeometryBase.sym_differencei  s(    
 ~~d55dhh		JKKr@   c                 `    U R                  [        R                  " U R                  5      5      $ )z6Return the union of all the elements of this geometry.)rU  rC   geos_unary_unionr;   rG   s    r=   unary_unionGEOSGeometryBase.unary_unionp  s"     ~~d33DHH=>>r@   c                 v    U R                  [        R                  " U R                  UR                  5      5      $ )zIReturn a Geometry representing all the points in this Geometry and other.)rU  rC   
geos_unionr;   r   s     r=   r   GEOSGeometryBase.unionu  s$    ~~doodhh		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.areaz  s      ~~dhhhj(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.distance  sA     %..MNN!!$((EIIuXZ7H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'   rv  r   tuple)r:   r'   envxminyminxmaxymaxs          r=   extentGEOSGeometryBase.extent  sT     	!mmc!!JD$QJDQJD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    DOODHH566r@   )r8   rF   r/   r;   ri   )F)r   )   )r  r   r   g      @)g        F)c__name__
__module____qualname____firstlineno__r2   r   ptr_typerC   rO  
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  r  ri   setterrS   r   rZ   r+  r/  geojsonr`   r4  r7  r;  r>  r.  rA  rI  rM  rU  rY  r`  rg  rk  ro  r   rv  r   r}  r  r  r   r  r   r  r  r  r  rK   __static_attributes__ r@   r=   r   r      sA   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^   )rU  rC   geos_interpolater;   r:   r  s     r=   interpolateLinearGeometryMixin.interpolate  s"    ~~d33DHHhGHHr@   c                 b    U R                  [        R                  " U R                  U5      5      $ r^   )rU  rC   geos_interpolate_normalizedr;   r  s     r=   interpolate_normalized*LinearGeometryMixin.interpolate_normalized  s"    ~~d>>txx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  599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++DHHeii@@r@   c                 `    U R                  [        R                  " U R                  5      5      $ )z)
Return the line merge of this Geometry.
)rU  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_jsonrN  ri   r{   r   re   r1   rC   r  r;   r  r0   r   r  superr>   )r:   	geo_inputri   
input_sridwkt_mrQ  r.  r8   s          r=   r>   GEOSGeometry.__init__  s    
i''!),Ii%%OOI.E=!$U6]!3JNN;uU|#<=++GLLY!78!!),,&&00;MMO XX
 !VWW	8,,A	:..Y'A	<00	.A>iPQQ VWW@4#5#5a#8@D
$:#5CjPQQD!!TJtS))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M
7x M
7`%, %,P <#Y < <r@   