o
    ó<âgB  ã                   @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é    )ÚGDALBase)Úrasterc                   @   s*   e Zd ZdZedd„ ƒZejdd„ ƒZdS )ÚGDALRasterBasez@
    Attributes that exist on both GDALRaster and GDALBand.
    c                 C   sÖ   dg}t  | j¡}|r$d}|| }|r$| | ¡ ¡ |d7 }|| }|st  |¡ i }|D ];}t  | j|dkr9dn| ¡ ¡}|sAq-i }d}|| }|rb| ¡  d¡\}	}
|
||	< |d7 }|| }|sK|||pgd< q-|S )zô
        Return the metadata for this raster or band. The return value is a
        nested dictionary, where the first-level key is the metadata domain and
        the second-level is the metadata item names and values for that domain.
        ÚDEFAULTr   é   Nú=)	ÚcapiÚget_ds_metadata_domain_listÚ_ptrÚappendÚdecodeÚfree_dslÚget_ds_metadataÚencodeÚsplit)ÚselfÚdomain_listÚ	meta_listÚcounterÚdomainÚresultÚdataÚdomain_metaÚitemÚkeyÚval© r   úV/var/www/html/venv/lib/python3.10/site-packages/django/contrib/gis/gdal/raster/base.pyÚmetadata
   s<   	ý
þüzGDALRasterBase.metadatac                 C   s^   |  ¡ D ](\}}|dkrdn| ¡ }|  ¡ D ]\}}t | j| ¡ |r'| ¡ nd|¡ qqdS )zo
        Set the metadata. Update only the domains that are contained in the
        value dictionary.
        r   N)Úitemsr   r   Úset_ds_metadata_itemr
   )r   Úvaluer   r   Ú	meta_nameÚ
meta_valuer   r   r   r   <   s   üÿüN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   Úsetterr   r   r   r   r      s    
1r   N)Údjango.contrib.gis.gdal.baser   Ú"django.contrib.gis.gdal.prototypesr   r   r   r   r   r   r   Ú<module>   s    