
    d                        U d Z ddlmZ ddlZ ej        e          ZddlZddlm	c m
Z ddlmZmZ ddlmZmZ erddlmZ dZeZd	ed
<   eZd	ed<    G d de          Z ed          ZddZ e            ZdS )a   This modules exposes geometry data for Unites States.

This module contains one dict: ``data``.

The data is indexed by two-tuples of ``(state_id, county_id)`` that
have the following dictionaries as values:

.. code-block:: ipython

    In [25]: data[(1,1)]
    Out[25]:
    {
        'name': 'Autauga',
        'detailed name': 'Autauga County, Alabama',
        'state': 'al',
        'lats': [32.4757, ..., 32.48112],
        'lons': [-86.41182, ..., -86.41187]
    }

Entries for ``'name'`` can have duplicates for certain states (e.g. Virginia).
The combination of ``'detailed name'`` and ``'state'`` will always be unique.

.. bokeh-sampledata-xref:: us_counties
    )annotationsN)TYPE_CHECKING	TypedDict   )external_pathopen_csv)	TypeAlias)datar	   StateCountyc                  B    e Zd ZU ded<   ded<   ded<   ded<   ded<   dS )	
CountyDatastrnamedetailed_namestatezlist[float]latslonsN)__name__
__module____qualname____annotations__     <lib/python3.11/site-packages/bokeh/sampledata/us_counties.pyr   r   M   sH         IIIJJJr   r   NaNreturn&dict[tuple[State, County], CountyData]c                 `   i } t          t          d                    5 }t          |           t          j        |dd          }|D ]L}|\  }}}}}}}}}}	}
}}t          j        |          }g }g }t          |                    d                    D ]\  }}|dk    r4|	                    t                     |	                    t                     t          |j        t                    sJ d |j                                        D             }t          t!          d |D                        \  }}|                    |           |                    |           t%          |||||	          | t'          |	          t'          |
          f<   N	 d
d
d
           n# 1 swxY w Y   | S )z

    zUS_Counties.csv,")	delimiter	quotecharz).//outerBoundaryIs/LinearRing/coordinatesr   c              3  P   K   | ]!}|                     d           dd         V  "dS )r    Nr   )split).0cs     r   	<genexpr>z_read_data.<locals>.<genexpr>i   s5      FFq!''#,,rr*FFFFFFr   c                P    g | ]#\  }}t          |          t          |          f$S r   )float)r&   lonlats      r   
<listcomp>z_read_data.<locals>.<listcomp>j   s-    %V%V%V83uSzz5::&>%V%V%Vr   )r   r   r   r   r   N)r   r   nextcsvreaderet
fromstring	enumeratefindallappendnan
isinstancetextr   r%   listzipextendr   int)r
   fr0   rowr   _r   geometrydet_namestate_id	county_idxmlr   r   ipolycoordsr,   r+   s                      r   
_read_datarH   V   s    46D	- 122	3	3 qQA<<< 	 	CX[UD!UAxAq(HiQRTU-))C "D "D$S[[1\%]%]^^ ! !4q55KK$$$KK$$$!$)S11111FFDIOO4E4EFFF%V%Vv%V%V%V WXXSC   C    4> (5 5 5D#h--Y011	              2 Ks   E7F##F'*F')r   r   )__doc__
__future__r   logging	getLoggerr   logr/   xml.etree.ElementTreeetreeElementTreer1   typingr   r   util.sampledatar   r   typing_extensionsr	   __all__r<   r   r   r   r   r*   r6   rH   r
   r   r   r   <module>rU      s?    6 # " " " " " g!! 


 " " " " " " " " " + + + + + + + + 6 5 5 5 5 5 5 5 ,++++++                  eEll   J z||r   