Ë
    ¹ûàg¯k  ã                   óê  — d Z ddlZddlZddlmZ ddlmZmZmZm	Z	m
Z
mZ ddlmZ ddlmZmZ ddlmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZmZ ddlmZm Z m!Z! ddl"m#Z# ddl$m%Z%  G d„ de«      Z& G d„ de&«      Z' G d„ de&«      Z( G d„ de(«      Z) G d„ de&«      Z* G d„ de&«      Z+ G d„ de+«      Z, G d„ de+«      Z- G d„ d e+«      Z.i d!e'“d"e(“d#e*“d$e,“d%e-“d&e.“d'e+“d(e)“d)e'“d*e(“d+e*“d,e,“d-e-“d.e.“d/e+“d0e'“d1e(“d2e*d3e,d4e-d5e.d6e+d!ej^                  z   e'd"ej^                  z   e(d#ej^                  z   e*d$ej^                  z   e,d%ej^                  z   e-d&ej^                  z   e.d'ej^                  z   e+i¥Z0y)7a‹  
 The OGRGeometry is a wrapper for using the OGR Geometry class
 (see https://gdal.org/api/ogrgeometry_cpp.html#_CPPv411OGRGeometry).
 OGRGeometry may be instantiated when reading geometries from OGR Data Sources
 (e.g. SHP files), or when given OGC WKT (a string).

 While the 'full' API is not present yet, the API is "pythonic" unlike
 the traditional and "next-generation" OGR Python bindings.  One major
 advantage OGR Geometries have over their GEOS counterparts is support
 for spatial reference systems and their transformation.

 Example:
  >>> from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, SpatialReference
  >>> wkt1, wkt2 = 'POINT(-90 30)', 'POLYGON((0 0, 5 0, 5 5, 0 5)'
  >>> pnt = OGRGeometry(wkt1)
  >>> print(pnt)
  POINT (-90 30)
  >>> mpnt = OGRGeometry(OGRGeomType('MultiPoint'), SpatialReference('WGS84'))
  >>> mpnt.add(wkt1)
  >>> mpnt.add(wkt1)
  >>> print(mpnt)
  MULTIPOINT (-90 30,-90 30)
  >>> print(mpnt.srs.name)
  WGS 84
  >>> print(mpnt.srs.proj)
  +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
  >>> mpnt.transform(SpatialReference('NAD27'))
  >>> print(mpnt.proj)
  +proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs
  >>> print(mpnt)
  MULTIPOINT (-89.99993037860248 29.99979788655764,-89.99993037860248 29.99979788655764)

  The OGRGeomType class is to make it easy to specify an OGR geometry type:
  >>> from django.contrib.gis.gdal import OGRGeomType
  >>> gt1 = OGRGeomType(3) # Using an integer for the type
  >>> gt2 = OGRGeomType('Polygon') # Using a string
  >>> gt3 = OGRGeomType('POLYGON') # It's case-insensitive
  >>> print(gt1 == 3, gt1 == 'Polygon') # Equivalence works w/non-OGRGeomType objects
  True True
é    N)Úb2a_hex)ÚbyrefÚc_char_pÚc_doubleÚc_ubyteÚc_void_pÚ	string_at)ÚGDALBase)ÚEnvelopeÚOGREnvelope)ÚGDALExceptionÚSRSException)ÚOGRGeomType)Úgeom)Úsrs)ÚCoordTransformÚSpatialReference)Ú	hex_regexÚ
json_regexÚ	wkt_regex)ÚRemovedInDjango60Warning)Úforce_bytesc                   ó0  — e Zd ZdZej
                  ZdDd„Zd„ Zd„ Z	e
d„ «       Zed„ «       Ze
d„ «       Zed	„ «       Ze
d
„ «       Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ «       Zed„ «       Zej4                  d„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Z ed„ «       Z!ed„ «       Z"ed„ «       Z#ed„ «       Z$ed„ «       Z%d„ Z&ed „ «       Z'd!„ Z(d"„ Z)d#„ Z* ee)e*«      Z+d$„ Z,d%„ Z- ee,e-«      Z.d&„ Z/ed'„ «       Z0ed(„ «       Z1ed)„ «       Z2ed*„ «       Z3e3Z4ed+„ «       Z5ed,„ «       Z6ed-„ «       Z7ed.„ «       Z8ed/„ «       Z9d0„ Z:d1„ Z;dEd2„Z<d3„ Z=d4„ Z>d5„ Z?d6„ Z@d7„ ZAd8„ ZBd9„ ZCd:„ ZDd;„ ZEdDd<„ZFed=„ «       ZGed>„ «       ZHd?„ ZId@„ ZJdA„ ZKdB„ ZLedC„ «       ZMy)FÚOGRGeometryzEncapsulate an OGR geometry.Nc           	      ó*  — t        |t        «      }|r5t        j                  |«      r t	        t
        j                  |«      «      }d}|�r]t        j                  |«      }t        j                  |«      }|rÛ|d   rt        |d   «      }|d   j                  «       dk(  rft        j                  t        |d   «      j                  «      }t        j                  |t!        t#        |d   j%                  «       «      «      «       �n$t        j&                  t!        t#        |d   j%                  «       «      «      dt!        t)        «       «      «      }nØ|r | j+                  |j%                  «       «      }n¶t        |«       t        j                  t        |«      j                  «      }n‚t        |t        «      r| j-                  |«      }n`t        |t        «      r t        j                  |j                  «      }n0t        || j.                  «      r|}nt1        dt3        |«      z  «      ‚|st1        d|z  «      ‚|| _        |r|| _        t8        j;                  | j<                  j                  «      x}€t?        d	| j<                  › �«      ‚|| _         y)
z=Initialize Geometry on either WKT or an OGR pointer as input.FÚsridÚtypeÚ
LINEARRINGÚwktNz4Invalid input type for OGR Geometry construction: %sz)Cannot create OGR Geometry from input: %szUnsupported geometry type: )!Ú
isinstanceÚstrr   ÚmatchÚ
memoryviewÚbytesÚfromhexr   r   ÚintÚupperÚcapiÚcreate_geomr   ÚnumÚ
import_wktr   r   ÚencodeÚfrom_wktr   Ú
_from_jsonÚ	_from_wkbÚptr_typer   r   Úptrr   ÚGEO_CLASSESÚgetÚ	geom_typeÚ	TypeErrorÚ	__class__)ÚselfÚ
geom_inputr   Ústr_instanceÚwkt_mÚjson_mÚgÚ	geo_classs           ú`/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/django/contrib/gis/gdal/geometries.pyÚ__init__zOGRGeometry.__init__D   s  € ä! *¬cÓ2ˆñ œIŸO™O¨JÔ7Ü#¤E§M¡M°*Ó$=Ó>ˆJØ ˆLò Ü—O‘O JÓ/ˆEÜ×%Ñ% jÓ1ˆFÙØ˜’=ä˜e F™mÓ,�CØ˜‘=×&Ñ&Ó(¨LÒ8ô ×(Ñ(¬°U¸6±]Ó)C×)GÑ)GÓH�AÜ—O‘O A¤u¬X°e¸E±l×6IÑ6IÓ6KÓ-LÓ'MÖNäŸ™Üœh u¨U¡|×':Ñ':Ó'<Ó=Ó>ÀÄeÌHËJÓFWó‘Añ Ø—O‘O J×$5Ñ$5Ó$7Ó8‘ô ˜JÔ'Ü×$Ñ$¤[°Ó%<×%@Ñ%@ÓA‘Ü˜
¤JÔ/à—‘˜zÓ*‰AÜ˜
¤KÔ0ä× Ñ  §¡Ó0‰AÜ˜
 D§M¡MÔ2à‰AäØFÜ�zÓ"ñ#óð ñ ÜØ;¸jÑHóð ð ˆŒñ ØˆDŒHô %Ÿ™¨¯©×);Ñ);Ó<Ð<ˆIÐEÜÐ9¸$¿.¹.Ð9IÐJÓKÐKØ"ˆ�ó    c                 ój   — | j                   }|r|j                  }nd }t        | j                  «      |fS ©N)r   r   r$   Úwkb©r7   r   s     r>   Ú__getstate__zOGRGeometry.__getstate__†   s/   € Ø�h‰hˆÙØ—'‘'‰CàˆCÜ�T—X‘X‹ Ð#Ð#r@   c                 ó¨   — |\  }}t        j                  |d t        t        «       «      t	        |«      «      }|st        d«      ‚|| _        || _        y )Nz.Invalid OGRGeometry loaded from pickled state.)r(   Úfrom_wkbr   r   Úlenr   r1   r   )r7   ÚstaterC   r   r1   s        r>   Ú__setstate__zOGRGeometry.__setstate__Ž   sG   € Ø‰ˆˆSÜ�m‰m˜C ¤u¬X«ZÓ'8¼#¸c»(ÓCˆÙÜÐ PÓQÐQØˆŒØˆ�r@   c                 óx   — t        j                  t        |«      d t        t	        «       «      t        |«      «      S rB   )r(   rG   r$   r   r   rH   )Úclsr8   s     r>   r/   zOGRGeometry._from_wkb–   s,   € ä�}‰}Ü�*Ó˜t¤U¬8«:Ó%6¼¸J»ó
ð 	
r@   c                 ó,   — t        j                  | «      S rB   )r(   Ú	from_json©r8   s    r>   r.   zOGRGeometry._from_jsonœ   s   € ä�~‰~˜jÓ)Ð)r@   c                 ód   — |\  }}}}t        d|›d|›d|›d|›d|›d|›d|›d|›d|›d|›d�«      S )z2Construct a Polygon from a bounding box (4-tuple).z	POLYGON((ú z, z)))r   )rL   ÚbboxÚx0Úy0Úx1Úy1s         r>   Ú	from_bboxzOGRGeometry.from_bbox    s8   € ð ‰ˆˆB��BÝâ’2’rš2šr¢2¢rª2ªr²2ð7ó
ð 	
r@   c                 óP   — t        t         j                  t        | «      «      «      S rB   )r   r.   r   rO   s    r>   rN   zOGRGeometry.from_json©   s   € äœ;×1Ñ1´+¸jÓ2IÓJÓKÐKr@   c                 óJ   —  | t        j                  t        |«      «      «      S rB   )r(   Úfrom_gmlr   )rL   Ú
gml_strings     r>   rZ   zOGRGeometry.from_gml­   s   € á”4—=‘=¤¨ZÓ!8Ó9Ó:Ð:r@   c                 ó$   — | j                  |«      S )z'Return the union of the two geometries.)Úunion©r7   Úothers     r>   Ú__or__zOGRGeometry.__or__³   s   € à�z‰z˜%Ó Ð r@   c                 ó$   — | j                  |«      S )z7Return the intersection of this Geometry and the other.)Úintersectionr^   s     r>   Ú__and__zOGRGeometry.__and__¸   s   € à× Ñ  Ó'Ð'r@   c                 ó$   — | j                  |«      S )z2Return the difference this Geometry and the other.)Ú
differencer^   s     r>   Ú__sub__zOGRGeometry.__sub__½   s   € à�‰˜uÓ%Ð%r@   c                 ó$   — | j                  |«      S )z?Return the symmetric difference of this Geometry and the other.)Úsym_differencer^   s     r>   Ú__xor__zOGRGeometry.__xor__Â   s   € à×"Ñ" 5Ó)Ð)r@   c                 óH   — t        |t        «      xr | j                  |«      S )z$Is this Geometry equal to the other?)r    r   Úequalsr^   s     r>   Ú__eq__zOGRGeometry.__eq__Æ   s   € ä˜%¤Ó-ÒD°$·+±+¸eÓ2DÐDr@   c                 ó   — | j                   S )z*WKT is used for the string representation.)r   ©r7   s    r>   Ú__str__zOGRGeometry.__str__Ê   s   € à�x‰xˆr@   c                 ó@   — t        j                  | j                  «      S )z5Return 0 for points, 1 for lines, and 2 for surfaces.)r(   Úget_dimsr1   rn   s    r>   Ú	dimensionzOGRGeometry.dimensionÏ   ó   € ô �}‰}˜TŸX™XÓ&Ð&r@   c                 ó@   — t        j                  | j                  «      S )z0Return the coordinate dimension of the Geometry.)r(   Úget_coord_dimr1   rn   s    r>   Ú	coord_dimzOGRGeometry.coord_dimÔ   ó   € ô ×!Ñ! $§(¡(Ó+Ð+r@   c                 óž   — d}t        j                  |t        d¬«       |dvrt        d«      ‚t	        j
                  | j                  |«       y)z.Set the coordinate dimension of this Geometry.z5coord_dim setter is deprecated. Use set_3d() instead.é   )Ú
stacklevel)ry   é   z(Geometry dimension must be either 2 or 3N)ÚwarningsÚwarnr   Ú
ValueErrorr(   Úset_coord_dimr1   )r7   ÚdimÚmsgs      r>   rv   zOGRGeometry.coord_dimÚ   sC   € ð FˆÜ�‰�cÔ3ÀÕBØ�fÑÜÐGÓHÐHÜ×Ñ˜4Ÿ8™8 SÕ)r@   c                 ó@   — t        j                  | j                  «      S )z/Return the number of elements in this Geometry.)r(   Úget_geom_countr1   rn   s    r>   Ú
geom_countzOGRGeometry.geom_countã   s   € ô ×"Ñ" 4§8¡8Ó,Ð,r@   c                 ó@   — t        j                  | j                  «      S )z-Return the number of Points in this Geometry.)r(   Úget_point_countr1   rn   s    r>   Úpoint_countzOGRGeometry.point_countè   s   € ô ×#Ñ# D§H¡HÓ-Ð-r@   c                 ó   — | j                   S )z7Alias for `point_count` (same name method in GEOS API.)©r‡   rn   s    r>   Ú
num_pointszOGRGeometry.num_pointsí   ó   € ð ×ÑÐr@   c                 ó   — | j                   S )zAlias for `point_count`.r‰   rn   s    r>   Ú
num_coordszOGRGeometry.num_coordsò   r‹   r@   c                 óR   — t        t        j                  | j                  «      «      S )z"Return the Type for this Geometry.)r   r(   Úget_geom_typer1   rn   s    r>   r4   zOGRGeometry.geom_type÷   s   € ô œ4×-Ñ-¨d¯h©hÓ7Ó8Ð8r@   c                 ó@   — t        j                  | j                  «      S )z!Return the Name of this Geometry.)r(   Úget_geom_namer1   rn   s    r>   Ú	geom_namezOGRGeometry.geom_nameü   rw   r@   c                 ó@   — t        j                  | j                  «      S )zHReturn the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise.)r(   Úget_arear1   rn   s    r>   ÚareazOGRGeometry.area  rs   r@   c           	      óv   — t        t        j                  | j                  t	        t        «       «      «      «      S )z&Return the envelope for this Geometry.)r   r(   Úget_enveloper1   r   r   rn   s    r>   ÚenvelopezOGRGeometry.envelope  s'   € ô œ×)Ñ)¨$¯(©(´E¼+»-Ó4HÓIÓJÐJr@   c                 ó@   — t        j                  | j                  «      S rB   )r(   Úis_emptyr1   rn   s    r>   ÚemptyzOGRGeometry.empty  s   € ä�}‰}˜TŸX™XÓ&Ð&r@   c                 ó.   — | j                   j                  S )zCReturn the envelope as a 4-tuple, instead of as an Envelope object.)r˜   Útuplern   s    r>   ÚextentzOGRGeometry.extent  s   € ð �}‰}×"Ñ"Ð"r@   c                 ó@   — t        j                  | j                  «      S )z.Return True if the geometry has Z coordinates.)r(   Úis_3dr1   rn   s    r>   r    zOGRGeometry.is_3d  s   € ô �z‰z˜$Ÿ(™(Ó#Ð#r@   c                 ó´   — |du r!t        j                  | j                  d«       y|du r!t        j                  | j                  d«       yt        d|›d�«      ‚)z'Set if this geometry has Z coordinates.Té   Fr   z*Input to 'set_3d' must be a boolean, got 'ú'.N)r(   Úset_3dr1   r~   ©r7   Úvalues     r>   r¤   zOGRGeometry.set_3d  sJ   € à�D‰=Ü�K‰K˜Ÿ™ !Õ$Ø�e‰^Ü�K‰K˜Ÿ™ !Õ$äÐIÈ%ÈÐRTÐUÓVÐVr@   c                 ó@   — t        j                  | j                  «      S )z.Return True if the geometry has M coordinates.)r(   Úis_measuredr1   rn   s    r>   r¨   zOGRGeometry.is_measured#  ó   € ô ×Ñ §¡Ó)Ð)r@   c                 ó´   — |du r!t        j                  | j                  d«       y|du r!t        j                  | j                  d«       yt        d|›d�«      ‚)z'Set if this geometry has M coordinates.Tr¢   Fr   z0Input to 'set_measured' must be a boolean, got 'r£   N)r(   Úset_measuredr1   r~   r¥   s     r>   r«   zOGRGeometry.set_measured(  sQ   € à�D‰=Ü×Ñ˜dŸh™h¨Õ*Ø�e‰^Ü×Ñ˜dŸh™h¨Õ*äØBÀ5À)È2ÐNóð r@   c                 óœ   — 	 t        j                  | j                  «      }t        t	        j
                  |«      «      S # t        $ r Y yw xY w)z/Return the Spatial Reference for this Geometry.N)r(   Úget_geom_srsr1   r   Úsrs_apiÚ	clone_srsr   )r7   Úsrs_ptrs     r>   Ú_get_srszOGRGeometry._get_srs6  sC   € ð	Ü×'Ñ'¨¯©Ó1ˆGÜ#¤G×$5Ñ$5°gÓ$>Ó?Ð?øÜò 	Ùð	ús   ‚<? ¿	AÁ
Ac                 ó  — t        |t        «      r|j                  }nJt        |t        t        f«      rt        |«      }|j                  }n|€d}nt        dt        |«      z  «      ‚t        j                  | j                  |«       y)z+Set the SpatialReference for this geometry.Nz7Cannot assign spatial reference with object of type: %s)	r    r   r1   r&   r!   r5   r   r(   Ú
assign_srs)r7   r   r°   Úsrs       r>   Ú_set_srszOGRGeometry._set_srs>  sq   € ô �cÔ+Ô,Ø—g‘g‰GÜ˜œc¤3˜ZÔ(Ü! #Ó&ˆBØ—f‘f‰GØˆ[Ø‰GäØIÌDÐQTËIÑUóð ô 	�‰˜Ÿ™ 'Õ*r@   c                 ó8   — | j                   }|r|j                  S y rB   )r   r   rD   s     r>   Ú	_get_sridzOGRGeometry._get_sridT  s   € Ø�h‰hˆÙØ—8‘8ˆOØr@   c                 óL   — t        |t        «      s|€|| _        y t        d«      ‚)Nz!SRID must be set with an integer.)r    r&   r   r5   )r7   r   s     r>   Ú	_set_sridzOGRGeometry._set_sridZ  s#   € Ü�dœCÔ  D LØˆD�HäÐ?Ó@Ð@r@   c                 óD   — ddl m} |j                  | j                  «      S )Nr   ©ÚGEOSGeometry)Údjango.contrib.gis.geosr¼   r/   rC   ©r7   r¼   s     r>   Ú	_geos_ptrzOGRGeometry._geos_ptrc  s   € Ý8à×%Ñ% d§h¡hÓ/Ð/r@   c                 óP   — ddl m}  || j                  «       | j                  «      S )z3Return a GEOSGeometry object from this OGRGeometry.r   r»   )r½   r¼   r¿   r   r¾   s     r>   ÚgeoszOGRGeometry.geosh  s   € õ 	9á˜DŸN™NÓ,¨d¯i©iÓ8Ð8r@   c                 ó@   — t        j                  | j                  «      S )z.Return the GML representation of the Geometry.)r(   Úto_gmlr1   rn   s    r>   ÚgmlzOGRGeometry.gmlo  s   € ô �{‰{˜4Ÿ8™8Ó$Ð$r@   c                 óH   — t        | j                  «      j                  «       S )z<Return the hexadecimal representation of the WKB (a string).)r   rC   r'   rn   s    r>   ÚhexzOGRGeometry.hext  s   € ô �t—x‘xÓ ×&Ñ&Ó(Ð(r@   c                 ó@   — t        j                  | j                  «      S )zE
        Return the GeoJSON representation of this Geometry.
        )r(   Úto_jsonr1   rn   s    r>   ÚjsonzOGRGeometry.jsony  s   € ô
 �|‰|˜DŸH™HÓ%Ð%r@   c                 óB   — t        j                  | j                  d«      S )z.Return the KML representation of the Geometry.N)r(   Úto_kmlr1   rn   s    r>   ÚkmlzOGRGeometry.kml‚  s   € ô �{‰{˜4Ÿ8™8 TÓ*Ð*r@   c                 ó@   — t        j                  | j                  «      S )z"Return the size of the WKB buffer.)r(   Úget_wkbsizer1   rn   s    r>   Úwkb_sizezOGRGeometry.wkb_size‡  r©   r@   c                 ó   — t         j                  dk(  rd}nd}| j                  }t        |z  «       }| j                  rt
        j                  nt
        j                  } || j                  |t        |«      «       t        t        ||«      «      S )z.Return the WKB representation of the Geometry.Úlittler¢   r   )ÚsysÚ	byteorderrÏ   r   r¨   r(   Ú
to_iso_wkbÚto_wkbr1   r   r#   r	   )r7   rÓ   ÚszÚbufrÕ   s        r>   rC   zOGRGeometry.wkbŒ  sn   € ô �=‰=˜HÒ$Ø‰IàˆIØ�]‰]ˆä˜‰|Óˆð %)×$4Ò$4”—’¼$¿+¹+ˆÙˆt�x‰x˜¤E¨#£JÔ/äœ) C¨Ó,Ó-Ð-r@   c                 ó¢   — | j                   rt        j                  nt        j                  } || j                  t        t        «       «      «      S )z.Return the WKT representation of the Geometry.)r¨   r(   Ú
to_iso_wktÚto_wktr1   r   r   )r7   rÚ   s     r>   r   zOGRGeometry.wktž  s3   € ð %)×$4Ò$4”—’¼$¿+¹+ˆÙ�d—h‘h¤¤h£jÓ 1Ó2Ð2r@   c                 ó†   — | j                   }|r(|j                  rd|j                  ›d| j                  ›�S | j                  S )z/Return the EWKT representation of the Geometry.zSRID=ú;)r   r   r   rD   s     r>   ÚewktzOGRGeometry.ewkt§  s2   € ð �h‰hˆÙ�3—8“8Ø#&§8£8¨T¯XªXÐ6Ð6à—8‘8ˆOr@   c                 óh   — t        t        j                  | j                  «      | j                  «      S )zClone this OGR Geometry.)r   r(   Ú
clone_geomr1   r   rn   s    r>   ÚclonezOGRGeometry.clone±  s    € äœ4Ÿ?™?¨4¯8©8Ó4°d·h±hÓ?Ð?r@   c                 óB   — t        j                  | j                  «       y)z©
        If there are any rings within this geometry that have not been
        closed, this routine will do so by adding the starting point at the
        end.
        N)r(   Úgeom_close_ringsr1   rn   s    r>   Úclose_ringszOGRGeometry.close_ringsµ  s   € ô 	×Ñ˜dŸh™hÕ'r@   c                 óæ  — |r#| j                  «       }|j                  |«       |S t        |t        «      r+t	        j
                  | j                  |j                  «       yt        |t        «      r+t	        j                  | j                  |j                  «       yt        |t        t        f«      r6t        |«      }t	        j                  | j                  |j                  «       yt        d«      ‚)aq  
        Transform this geometry to a different spatial reference system.
        May take a CoordTransform object, a SpatialReference object, string
        WKT or PROJ, and/or an integer SRID.  By default, return nothing
        and transform the geometry in-place. However, if the `clone` keyword is
        set, return a transformed clone of this geometry.
        zUTransform only accepts CoordTransform, SpatialReference, string, and integer objects.N)rà   Ú	transformr    r   r(   Úgeom_transformr1   r   Úgeom_transform_tor&   r!   r5   )r7   Úcoord_transrà   Úkloner´   s        r>   rå   zOGRGeometry.transform¾  s­   € ñ Ø—J‘J“LˆEØ�O‰O˜KÔ(ØˆLô �k¤>Ô2Ü×Ñ §¡¨+¯/©/Õ:Ü˜Ô%5Ô6Ü×"Ñ" 4§8¡8¨[¯_©_Õ=Ü˜¤c¬3 ZÔ0Ü! +Ó.ˆBÜ×"Ñ" 4§8¡8¨R¯V©VÕ4äðAóð r@   c                 ór   — t        |t        «      st        d«      ‚ || j                  |j                  «      S )z�A generalized function for topology operations, takes a GDAL function and
        the other geometry to perform the operation on.z<Must use another OGRGeometry object for topology operations!)r    r   r5   r1   )r7   Úfuncr_   s      r>   Ú	_topologyzOGRGeometry._topologyÛ  s5   € ô ˜%¤Ô-ÜØNóð ñ �D—H‘H˜eŸi™iÓ(Ð(r@   c                 óB   — | j                  t        j                  |«      S )z7Return True if this geometry intersects with the other.)rì   r(   Úogr_intersectsr^   s     r>   Ú
intersectszOGRGeometry.intersectsç  s   € à�~‰~œd×1Ñ1°5Ó9Ð9r@   c                 óB   — | j                  t        j                  |«      S )z8Return True if this geometry is equivalent to the other.)rì   r(   Ú
ogr_equalsr^   s     r>   rk   zOGRGeometry.equalsë  ó   € à�~‰~œdŸo™o¨uÓ5Ð5r@   c                 óB   — | j                  t        j                  |«      S )zBReturn True if this geometry and the other are spatially disjoint.)rì   r(   Úogr_disjointr^   s     r>   ÚdisjointzOGRGeometry.disjointï  ó   € à�~‰~œd×/Ñ/°Ó7Ð7r@   c                 óB   — | j                  t        j                  |«      S )z/Return True if this geometry touches the other.)rì   r(   Úogr_touchesr^   s     r>   ÚtoucheszOGRGeometry.touchesó  ó   € à�~‰~œd×.Ñ.°Ó6Ð6r@   c                 óB   — | j                  t        j                  |«      S )z/Return True if this geometry crosses the other.)rì   r(   Úogr_crossesr^   s     r>   ÚcrosseszOGRGeometry.crosses÷  rú   r@   c                 óB   — | j                  t        j                  |«      S )z1Return True if this geometry is within the other.)rì   r(   Ú
ogr_withinr^   s     r>   ÚwithinzOGRGeometry.withinû  rò   r@   c                 óB   — | j                  t        j                  |«      S )z0Return True if this geometry contains the other.)rì   r(   Úogr_containsr^   s     r>   ÚcontainszOGRGeometry.containsÿ  rö   r@   c                 óB   — | j                  t        j                  |«      S )z0Return True if this geometry overlaps the other.)rì   r(   Úogr_overlapsr^   s     r>   ÚoverlapszOGRGeometry.overlaps  rö   r@   c                 óÐ   — t        |t        «      r1t         || j                  |j                  «      | j                  «      S t         || j                  «      | j                  «      S )z?A helper routine for the OGR routines that generate geometries.)r    r   r1   r   )r7   Úgen_funcr_   s      r>   Ú_geomgenzOGRGeometry._geomgen  sF   € ä�eœ[Ô)Ü™x¨¯©°%·)±)Ó<¸d¿h¹hÓGÐGä™x¨¯©Ó1°4·8±8Ó<Ð<r@   c                 ó@   — | j                  t        j                  «      S )z%Return the boundary of this geometry.)r	  r(   Úget_boundaryrn   s    r>   ÚboundaryzOGRGeometry.boundary  s   € ð �}‰}œT×.Ñ.Ó/Ð/r@   c                 ó@   — | j                  t        j                  «      S )zk
        Return the smallest convex Polygon that contains all the points in
        this Geometry.
        )r	  r(   Úgeom_convex_hullrn   s    r>   Úconvex_hullzOGRGeometry.convex_hull  s   € ð �}‰}œT×2Ñ2Ó3Ð3r@   c                 óB   — | j                  t        j                  |«      S )z€
        Return a new geometry consisting of the region which is the difference
        of this geometry and the other.
        )r	  r(   Ú	geom_diffr^   s     r>   re   zOGRGeometry.difference  s   € ð
 �}‰}œTŸ^™^¨UÓ3Ð3r@   c                 óB   — | j                  t        j                  |«      S )zx
        Return a new geometry consisting of the region of intersection of this
        geometry and the other.
        )r	  r(   Úgeom_intersectionr^   s     r>   rb   zOGRGeometry.intersection#  s   € ð
 �}‰}œT×3Ñ3°UÓ;Ð;r@   c                 óB   — | j                  t        j                  |«      S )zq
        Return a new geometry which is the symmetric difference of this
        geometry and the other.
        )r	  r(   Úgeom_sym_diffr^   s     r>   rh   zOGRGeometry.sym_difference*  s   € ð
 �}‰}œT×/Ñ/°Ó7Ð7r@   c                 óB   — | j                  t        j                  |«      S )z{
        Return a new geometry consisting of the region which is the union of
        this geometry and the other.
        )r	  r(   Ú
geom_unionr^   s     r>   r]   zOGRGeometry.union1  s   € ð
 �}‰}œTŸ_™_¨eÓ4Ð4r@   c                 ó‚   — t        t        d«      «      }t        j                  | j                  |j                  «       |S )z.Return the centroid (a Point) of this Polygon.ÚPoint)r   r   r(   Úget_centroidr1   )r7   Úps     r>   ÚcentroidzOGRGeometry.centroid8  s0   € ô œ GÓ,Ó-ˆÜ×Ñ˜$Ÿ(™( A§E¡EÔ*Øˆr@   rB   )F)NÚ__name__Ú
__module__Ú__qualname__Ú__doc__r(   Údestroy_geomÚ
destructorr?   rE   rJ   Úclassmethodr/   Ústaticmethodr.   rW   rN   rZ   r`   rc   rf   ri   rl   ro   Úpropertyrr   rv   Úsetterr„   r‡   rŠ   r�   r4   r’   r•   r˜   r›   rž   r    r¤   r¨   r«   r±   rµ   r   r·   r¹   r   r¿   rÁ   rÄ   rÆ   rÉ   ÚgeojsonrÌ   rÏ   rC   r   rÝ   rà   rã   rå   rì   rï   rk   rõ   rù   rý   r   r  r  r	  r  r  re   rb   rh   r]   r  © r@   r>   r   r   ?   se  „ Ù&à×"Ñ"€Jó?#òD$òð ñ
ó ð
ð
 ñ*ó ð*ð ñ
ó ð
ð ñLó ðLð ñ;ó ð;ò
!ò
(ò
&ò
*òEòð
 ñ'ó ð'ð ñ,ó ð,ð
 ×Ññ*ó ð*ð ñ-ó ð-ð ñ.ó ð.ð ñ ó ð ð ñ ó ð ð ñ9ó ð9ð ñ,ó ð,ð ñ'ó ð'ð ñKó ðKð
 ñ'ó ð'ð ñ#ó ð#ð ñ$ó ð$òWð ñ*ó ð*ò	òò+ñ& �8˜XÓ
&€CòòAñ �I˜yÓ)€Dò0ð
 ñ9ó ð9ð ñ%ó ð%ð ñ)ó ð)ð ñ&ó ð&ð €Gàñ+ó ð+ð ñ*ó ð*ð ñ.ó ð.ð" ñ3ó ð3ð ñó ðò@ò(óò:
)ò:ò6ò8ò7ò7ò6ò8ò8ó
=ð ñ0ó ð0ð ñ4ó ð4ò4ò<ò8ò5ð ñó ñr@   r   c                   ó‚   ‡ — e Zd Zˆ fd„Zed„ «       Zed„ «       Zed„ «       Zed„ «       Z	ed„ «       Z
ed„ «       ZeZˆ xZS )r  c                 óx   •— ddl m} | j                  r|j                  j	                  «       S t
        ‰| �  «       S )Nr   )rÁ   )Údjango.contrib.gisrÁ   r›   r  Ú_create_emptyÚsuperr¿   )r7   rÁ   r6   s     €r>   r¿   zPoint._geos_ptrC  s,   ø€ Ý+à-1¯ZªZˆt�z‰z×'Ñ'Ó)ÐP¼U¹WÑ=NÓ=PÐPr@   c                 óR   — t        j                  t        d«      j                  «      S )NÚpoint)r(   r)   r   r*   )rL   s    r>   r,  zPoint._create_emptyH  s   € ä×Ñ¤¨GÓ 4× 8Ñ 8Ó9Ð9r@   c                 óB   — t        j                  | j                  d«      S )z'Return the X coordinate for this Point.r   )r(   Úgetxr1   rn   s    r>   ÚxzPoint.xL  ó   € ô �y‰y˜Ÿ™ 1Ó%Ð%r@   c                 óB   — t        j                  | j                  d«      S )z'Return the Y coordinate for this Point.r   )r(   Úgetyr1   rn   s    r>   ÚyzPoint.yQ  r3  r@   c                 ó\   — | j                   r t        j                  | j                  d«      S y)z'Return the Z coordinate for this Point.r   N)r    r(   Úgetzr1   rn   s    r>   ÚzzPoint.zV  s%   € ð �:Š:Ü—9‘9˜TŸX™X qÓ)Ð)ð r@   c                 ó\   — | j                   r t        j                  | j                  d«      S y)z'Return the M coordinate for this Point.r   N)r¨   r(   Úgetmr1   rn   s    r>   ÚmzPoint.m\  s'   € ð ×ÒÜ—9‘9˜TŸX™X qÓ)Ð)ð r@   c                 óz  — | j                   r:| j                  r.| j                  | j                  | j                  | j
                  fS | j                   r#| j                  | j                  | j                  fS | j                  r#| j                  | j                  | j
                  fS | j                  | j                  fS )zReturn the tuple of this point.)r    r¨   r2  r6  r9  r<  rn   s    r>   r�   zPoint.tupleb  s†   € ð �:Š:˜$×*Ò*Ø—6‘6˜4Ÿ6™6 4§6¡6¨4¯6©6Ð1Ð1Ø�:Š:Ø—6‘6˜4Ÿ6™6 4§6¡6Ð)Ð)Ø×ÒØ—6‘6˜4Ÿ6™6 4§6¡6Ð)Ð)Ø�v‰v�t—v‘vˆ~Ðr@   )r  r  r  r¿   r#  r,  r%  r2  r6  r9  r<  r�   ÚcoordsÚ__classcell__)r6   s   @r>   r  r  B  sˆ   ø„ ôQð
 ñ:ó ð:ð ñ&ó ð&ð ñ&ó ð&ð ñ*ó ð*ð
 ñ*ó ð*ð
 ñó ðð „Fr@   r  c                   ór   — e Zd Zd„ Zd„ Zed„ «       ZeZd„ Zed„ «       Z	ed„ «       Z
ed„ «       Zed„ «       Zy	)
Ú
LineStringc           
      óø  — d|cxk  r| j                   k  �rWn �nSt        «       t        «       t        «       t        «       f\  }}}}t        j                  | j                  |t        |«      t        |«      t        |«      t        |«      «       | j                  r:| j                  r.|j                  |j                  |j                  |j                  fS | j                  r#|j                  |j                  |j                  fS | j                  r#|j                  |j                  |j                  fS | j                  }|dk(  r|j                  fS |dk(  r|j                  |j                  fS yt        d|z  «      ‚)z$Return the Point at the given index.r   r¢   ry   z>Index out of range when accessing points of a line string: %s.N)r‡   r   r(   Ú	get_pointr1   r   r    r¨   r¦   rv   Ú
IndexError)r7   Úindexr2  r6  r9  r<  r€   s          r>   Ú__getitem__zLineString.__getitem__q  s!  € à�Ô(˜×(Ñ(×(Ü!›¤X£Z´³¼X»ZÐG‰JˆAˆq�!�QÜ�N‰N˜4Ÿ8™8 U¬E°!«H´e¸A³hÄÀaÃÌ%ÐPQË(ÔSØ�zŠz˜d×.Ò.Ø—w‘w §¡¨¯©°!·'±'Ð9Ð9Ø�zŠzØ—w‘w §¡¨¯©Ð0Ð0Ø×ÒØ—w‘w §¡¨¯©Ð0Ð0Ø—.‘.ˆCØ�aŠxØŸ™�zÐ!Ø˜’ØŸ™ §¡Ð)Ð)ð ô ØPÐSXÑXóð r@   c                 ó   — | j                   S )z.Return the number of points in the LineString.r‰   rn   s    r>   Ú__len__zLineString.__len__†  s   € à×ÑÐr@   c                 óP   ‡ — t        ˆ fd„t        t        ‰ «      «      D «       «      S )z3Return the tuple representation of this LineString.c              3   ó(   •K  — | ]	  }‰|   –— Œ y ­wrB   r(  ©Ú.0Úir7   s     €r>   ú	<genexpr>z#LineString.tuple.<locals>.<genexpr>�  s   øè ø€ Ò7 �T˜!•WÑ7ùs   ƒ)r�   ÚrangerH   rn   s   `r>   r�   zLineString.tupleŠ  s   ø€ ô Ó7¤e¬C°«IÓ&6Ô7Ó7Ð7r@   c                 ór   — t        t        | «      «      D �cg c]  } || j                  |«      ‘Œ c}S c c}w )zp
        Internal routine that returns a sequence (list) corresponding with
        the given function.
        )rO  rH   r1   )r7   rë   rM  s      r>   Ú_listarrzLineString._listarr‘  s,   € ô
 ,1´°T³Ó+;Ö< a‘�T—X‘X˜qÕ!Ò<Ð<ùÒ<s   —4c                 ó@   — | j                  t        j                  «      S )z#Return the X coordinates in a list.)rQ  r(   r1  rn   s    r>   r2  zLineString.x˜  ó   € ð �}‰}œTŸY™YÓ'Ð'r@   c                 ó@   — | j                  t        j                  «      S )z#Return the Y coordinates in a list.)rQ  r(   r5  rn   s    r>   r6  zLineString.y�  rS  r@   c                 óZ   — | j                   r| j                  t        j                  «      S y)z#Return the Z coordinates in a list.N)r    rQ  r(   r8  rn   s    r>   r9  zLineString.z¢  s#   € ð �:Š:Ø—=‘=¤§¡Ó+Ð+ð r@   c                 óZ   — | j                   r| j                  t        j                  «      S y)z#Return the M coordinates in a list.N)r¨   rQ  r(   r;  rn   s    r>   r<  zLineString.m¨  s%   € ð ×ÒØ—=‘=¤§¡Ó+Ð+ð r@   N)r  r  r  rF  rH  r%  r�   r>  rQ  r2  r6  r9  r<  r(  r@   r>   rA  rA  p  s|   „ òò* ð ñ8ó ð8ð €Fò=ð ñ(ó ð(ð ñ(ó ð(ð ñ,ó ð,ð
 ñ,ó ñ,r@   rA  c                   ó   — e Zd Zy)Ú
LinearRingN©r  r  r  r(  r@   r>   rX  rX  °  ó   „ Ør@   rX  c                   óP   — e Zd Zd„ Zd„ Zed„ «       ZeZed„ «       ZeZ	ed„ «       Z
y)ÚPolygonc                 ó   — | j                   S )z4Return the number of interior rings in this Polygon.©r„   rn   s    r>   rH  zPolygon.__len__µ  ó   € à�‰Ðr@   c                 óÜ   — d|cxk  r| j                   k  rJn nGt        t        j                  t        j                  | j
                  |«      «      | j                  «      S t        d|z  «      ‚)z$Get the ring at the specified index.r   z9Index out of range when accessing rings of a polygon: %s.©r„   r   r(   rß   Úget_geom_refr1   r   rD  ©r7   rE  s     r>   rF  zPolygon.__getitem__¹  sZ   € à�Ô'˜Ÿ™Õ'ÜÜ—‘¤× 1Ñ 1°$·(±(¸EÓ BÓCÀTÇXÁXóð ô ØKÈeÑSóð r@   c                 ó   — | d   S )z!Return the shell of this Polygon.r   r(  rn   s    r>   ÚshellzPolygon.shellÅ  s   € ð �A‰wˆr@   c                 óR   ‡ — t        ˆ fd„t        ‰ j                  «      D «       «      S )z/Return a tuple of LinearRing coordinate tuples.c              3   ó<   •K  — | ]  }‰|   j                   –— Œ y ­wrB   ©r�   rK  s     €r>   rN  z Polygon.tuple.<locals>.<genexpr>Ï  ó   øè ø€ ÒC q�T˜!‘W—]•]ÑCùó   ƒ©r�   rO  r„   rn   s   `r>   r�   zPolygon.tupleÌ  ó   ø€ ô ÓC¬E°$·/±/Ó,BÔCÓCÐCr@   c                 óR   ‡ — t        ˆ fd„t        ‰ j                  «      D «       «      S )z,Return the number of Points in this Polygon.c              3   ó<   •K  — | ]  }‰|   j                   –— Œ y ­wrB   r‰   rK  s     €r>   rN  z&Polygon.point_count.<locals>.<genexpr>×  ó   øè ø€ ÒG¨1�4˜‘7×&Õ&ÑGùrj  ©ÚsumrO  r„   rn   s   `r>   r‡   zPolygon.point_countÓ  ó   ø€ ô ÓG´°d·o±oÓ0FÔGÓGÐGr@   N)r  r  r  rH  rF  r%  re  Úexterior_ringr�   r>  r‡   r(  r@   r>   r\  r\  ´  sV   „ òò	ð ñó ðð €MàñDó ðDð €FàñHó ñHr@   r\  c                   óF   — e Zd ZdZd„ Zd„ Zd„ Zed„ «       Zed„ «       Z	e	Z
y)ÚGeometryCollectionzThe Geometry Collection class.c                 óÜ   — d|cxk  r| j                   k  rJn nGt        t        j                  t        j                  | j
                  |«      «      | j                  «      S t        d|z  «      ‚)z(Get the Geometry at the specified index.r   z?Index out of range when accessing geometry in a collection: %s.ra  rc  s     r>   rF  zGeometryCollection.__getitem__Þ  s]   € à�Ô'˜Ÿ™Õ'ÜÜ—‘¤× 1Ñ 1°$·(±(¸EÓ BÓCÀTÇXÁXóð ô ØQØñóð r@   c                 ó   — | j                   S )z<Return the number of geometries in this Geometry Collection.r^  rn   s    r>   rH  zGeometryCollection.__len__ê  r_  r@   c                 óª  — t        |t        «      rst        || j                  «      r2|D ],  }t        j                  | j
                  |j
                  «       Œ. yt        j                  | j
                  |j
                  «       yt        |t        «      r6t        |«      }t        j                  | j
                  |j
                  «       yt        d«      ‚)z-Add the geometry to this Geometry Collection.zMust add an OGRGeometry.N)r    r   r6   r(   Úadd_geomr1   r!   r   )r7   r   r<   Útmps       r>   ÚaddzGeometryCollection.addî  s�   € ä�dœKÔ(Ü˜$ §¡Ô/Øò 3�AÜ—M‘M $§(¡(¨A¯E©EÕ2ñ3ô —‘˜dŸh™h¨¯©Õ1Ü˜œcÔ"Ü˜dÓ#ˆCÜ�M‰M˜$Ÿ(™( C§G¡GÕ,äÐ :Ó;Ð;r@   c                 óR   ‡ — t        ˆ fd„t        ‰ j                  «      D «       «      S )z8Return the number of Points in this Geometry Collection.c              3   ó<   •K  — | ]  }‰|   j                   –— Œ y ­wrB   r‰   rK  s     €r>   rN  z1GeometryCollection.point_count.<locals>.<genexpr>   ro  rj  rp  rn   s   `r>   r‡   zGeometryCollection.point_countü  rr  r@   c                 óR   ‡ — t        ˆ fd„t        ‰ j                  «      D «       «      S )z:Return a tuple representation of this Geometry Collection.c              3   ó<   •K  — | ]  }‰|   j                   –— Œ y ­wrB   rh  rK  s     €r>   rN  z+GeometryCollection.tuple.<locals>.<genexpr>  ri  rj  rk  rn   s   `r>   r�   zGeometryCollection.tuple  rl  r@   N)r  r  r  r   rF  rH  r{  r%  r‡   r�   r>  r(  r@   r>   ru  ru  Û  sG   „ Ù$ò
òò<ð ñHó ðHð
 ñDó ðDð �Fr@   ru  c                   ó   — e Zd Zy)Ú
MultiPointNrY  r(  r@   r>   r�  r�    rZ  r@   r�  c                   ó   — e Zd Zy)ÚMultiLineStringNrY  r(  r@   r>   rƒ  rƒ    rZ  r@   rƒ  c                   ó   — e Zd Zy)ÚMultiPolygonNrY  r(  r@   r>   r…  r…    rZ  r@   r…  r¢   ry   r{   é   é   é   é   ée   iÑ  iÒ  iÓ  iÔ  iÕ  iÖ  i×  i¹  iº  i»  i¼  i½  i¾  i¿  )1r   rÒ   r|   Úbinasciir   Úctypesr   r   r   r   r   r	   Údjango.contrib.gis.gdal.baser
   Ú django.contrib.gis.gdal.enveloper   r   Údjango.contrib.gis.gdal.errorr   r   Ú django.contrib.gis.gdal.geomtyper   Ú"django.contrib.gis.gdal.prototypesr   r(   r   r®   Údjango.contrib.gis.gdal.srsr   r   Údjango.contrib.gis.geometryr   r   r   Údjango.utils.deprecationr   Údjango.utils.encodingr   r   r  rA  rX  r\  ru  r�  rƒ  r…  Úwkb25bitr2   r(  r@   r>   ú<module>r—     s  ðñ'óR Û Ý ß J× Jå 1ß Bß EÝ 8Ý ;Ý =ß Hß HÑ HÝ =Ý -ô�(ô ôF+ˆKô +ô\<,�ô <,ô@	�ô 	ô#Hˆkô #HôN,˜ô ,ô`	Ð#ô 	ô	Ð(ô 	ô	Ð%ô 	ð
Ø€uðà€zðð €wðð €zð	ð
 €ðð €|ðð Ððð ˆðð 	ˆ%ðð 	ˆ*ðð 	ˆ'ðð 	ˆ*ðð 	ˆ/ðð 	ˆ,ðð 	Ð
ðð  	ˆ%ð!ð" 	ˆ*ð#ð$ 	ˆ'Øˆ*Øˆ/Øˆ,ØÐ
Øˆ×ÑÑ˜eØˆ×ÑÑ˜jØˆ×ÑÑ˜gØˆ×ÑÑ˜jØˆ×ÑÑ˜oØˆ×ÑÑ˜lØˆ×ÑÑÐ0ñ;�r@   