
    k"g                     r    d dl Z d dlmZ d dlmZ d dlmZ d dlmZ 	 d dl	Z	d Zd Zd	 Zy# e
$ r dZ	Y w xY w)
    N)BytesIO)settings)HttpResponse)loaderFc                 *   t               }t        j                  |dt        j                        5 }|j	                  d| j                  t        j                               ddd       |j                  d       |j                         S # 1 sw Y   *xY w)z0Return compressed KMZ from the given KML string.azdoc.kmlNr   )
r   zipfileZipFileZIP_DEFLATEDwritestrencoder   DEFAULT_CHARSETseekread)kmlkmzzfs      U/var/www/html/djangosite/lib/python3.12/site-packages/django/contrib/gis/shortcuts.pycompress_kmlr      sn    
)C	c7#7#7	8 EB
Iszz(*B*BCDEHHQK88:E Es   0B		Bc                  B    t        t        j                  | i |d      S )z9Render the response as KML (using the correct MIME type).z$application/vnd.google-earth.kml+xmlcontent_type)r   r   render_to_stringargskwargss     r   render_to_kmlr      s%    00;     c            	      T    t        t        t        j                  | i |      d      S )zW
    Compress the KML content and return as KMZ (using the correct
    MIME type).
    z application/vnd.google-earth.kmzr   )r   r   r   r   r   s     r   render_to_kmzr        s,    
 V,,d=f=>7 r   )r	   ior   django.confr   django.httpr   django.templater   numpyImportErrorr   r   r     r   r   <module>r(      sA        $ "
+  Es   , 66