
    Dvg                     v    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	n# e
$ r dZ	Y nw xY wd Zd Zd	 ZdS )
    N)BytesIO)settings)HttpResponse)loaderFc                 F   t                      }t          j        |dt          j                  5 }|                    d|                     t          j                             ddd           n# 1 swxY w Y   |                    d           |	                                S )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      Y/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/django/contrib/gis/shortcuts.pycompress_kmlr      s    
))C	c7#7	8	8 EB
Iszz(*BCCDDDE E E E E E E E E E E E E E EHHQKKK88::s   4A//A36A3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0;       c            	      \    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        s9    
 V,d=f==>>7   r   )r	   ior   django.confr   django.httpr   django.templater   numpyImportErrorr   r   r     r   r   <module>r(      s                       $ $ $ $ $ $ " " " " " "LLLL   EEE        s   # --