Ë
    éxjì  ã                   óœ   — d dl mZmZmZ erd dl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mZ ddlmZ dd	lmZ dd
lmZ  G d„ d«      Zy)é    )ÚUnionÚListÚTYPE_CHECKINGN)ÚBufferé   )ÚHandlerLike)ÚapplyÚNodeLocationsForWays)ÚReaderÚFileÚ
FileBufferÚ
ThreadPool)Úosm_entity_bits)ÚAreaManager)Ú
create_mapc                   ó°   — e Zd ZdZdefd„Zddg fdeedef   de	d	ed
e
d   ddf
d„Zddg fdddede	d	ed
e
d   ddfd„Zdeedeef   de	d	ed
e
d   ddf
d„Zy)ÚSimpleHandlera@   The most generic of OSM data handlers. Derive your data processor
        from this class and implement callbacks for each object type you are
        interested in. The following data types are recognised:

          `node`, `way`, `relation`, `area` and `changeset`

        A callback takes exactly one parameter which is the object. Note that
        all objects that are handed into the handler are only readable and are
        only valid until the end of the callback is reached. Any data that
        should be retained must be copied into other data structures.
    Úreturnc                 ó\  — t         j                  }t        | d«      r|t         j                  z  }t        | d«      r|t         j                  z  }t        | d«      r|t         j
                  z  }t        | d«      r|t         j                  z  }t        | d«      r|t         j                  z  }|S )zG Return the list of OSM object types this handler will handle.
        ÚnodeÚwayÚrelationÚareaÚ	changeset)r   ÚNOTHINGÚhasattrÚNODEÚWAYÚRELATIONÚAREAÚ	CHANGESET)ÚselfÚentitiess     úE/build-osm/venv/lib/python3.12/site-packages/osmium/simple_handler.pyÚenabled_forzSimpleHandler.enabled_for!   s–   € ô #×*Ñ*ˆÜ�4˜Ô Øœ×,Ñ,Ñ,ˆHÜ�4˜ÔØœ×+Ñ+Ñ+ˆHÜ�4˜Ô$Øœ×0Ñ0Ñ0ˆHÜ�4˜Ô Øœ×,Ñ,Ñ,ˆHÜ�4˜Ô%Øœ×1Ñ1Ñ1ˆHàˆó    FÚflex_memÚfilenamezos.PathLike[str]Ú	locationsÚidxÚfiltersr   Nc                 ó,   — | j                  ||||«       y)aÚ   Apply the handler to the given file. If locations is true, then
            a location handler will be applied before, which saves the node
            positions. In that case, the type of this position index can be
            further selected in idx. If an area callback is implemented, then
            the file will be scanned twice and a location handler and a
            handler for assembling multipolygons and areas from ways will
            be executed.
        N)Ú_apply_object)r"   r(   r)   r*   r+   s        r$   Ú
apply_filezSimpleHandler.apply_file2   s   € ð 	×Ñ˜8 Y°°WÕ=r&   Úbufferr   Úformatc                 ó@   — | j                  t        ||«      |||«       y)z©Apply the handler to a string buffer. The buffer must be a
           byte string.

           The other parameters have the same meaning as for `apply_file()`.
        N)r-   r   )r"   r/   r0   r)   r*   r+   s         r$   Úapply_bufferzSimpleHandler.apply_buffer?   s   € ð 	×Ñœ: f¨fÓ5°yÀ#ÀwÕOr&   Úobjc                 óœ  — t        «       }| j                  «       }|t        j                  z  r�t	        «       }t        |t        j                  |¬«      5 }t        |g|¢|j                  «       ‘­Ž  d d d «       |t        j                  z  }t        t        |«      «      }	|	j                  «        |	 |j                  g |¢| ‘­Ž g|¢| ‘}
nG|r?|t        j                  z  }t        t        |«      «      }	|	j                  «        |	g|¢| ‘}
ng |¢| ‘}
t        |||¬«      5 }t        |g|
¢­Ž  d d d «       y # 1 sw Y   ŒÆxY w# 1 sw Y   y xY w)N)Úthread_pool)r   r%   r   r    r   r   r   r	   Úfirst_pass_handlerÚOBJECTr
   r   Úignore_errorsÚsecond_pass_handlerr   )r"   r3   r)   r*   r+   r5   r#   r   ÚrdÚlhÚhandlerss              r$   r-   zSimpleHandler._apply_objectI   s?  € ô !“lˆØ×#Ñ#Ó%ˆØ”o×*Ñ*Ò*Ü“=ˆDÜ˜œ_×5Ñ5À;ÕOÐSUÜ�bÐ>˜7Ð> D×$;Ñ$;Ó$=Ó>÷ Pð œ×.Ñ.Ñ.ˆHÜ%¤j°£oÓ6ˆBØ×ÑÔØÐ4˜D×4Ñ4ÐD°gÐD¸tÒDÐUÀwÐUÐPTÐU‰HÙØœ×,Ñ,Ñ,ˆHÜ%¤j°£oÓ6ˆBØ×ÑÔØÐ+˜WÐ+ dÐ+‰Hà'˜Ð' $Ð'ˆHä�C˜¨{Õ;¸rÜ�"Ð �xÓ ÷ <Ð;÷ PÐOú÷ <Ð;ús   ÁD6Ä EÄ6D?ÅE)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r%   r   Ústrr   Úboolr   r.   r2   r   r-   © r&   r$   r   r      sä   „ ñ
ð˜_ó ð$ &+°zØ24ñ> 5¨Ð.@À$Ð)FÑ#Gð >Ø"ð>Ø14ð>à  Ñ/ð>à9=ó>ð (-¸Ø46ñP 8ð P°Sð PØ $ðPØ36ðPà" =Ñ1ðPà;?óPð!  sÐ,>ÀÀjÐ'PÑ!Qð !Ø!%ð!Ø,/ð!à# MÑ2ð!à7;ô!r&   r   )Útypingr   r   r   ÚosÚtyping_extensionsr   Ú_osmiumr   r	   r
   Úior   r   r   r   Úosmr   r   r   Úindexr   r   rC   r&   r$   Ú<module>rK      s7   ð÷ .Ñ -áÛÝ(Ý$ç 0ß 4Ó 4Ý  Ý Ý ÷K!ò K!r&   