
    Ch#                        S SK r S SKrS SKJr  S SKJrJr  S SKrS SK	J
r
Jr  S SKrS SKrS SKJr  S SKJr  S SKJrJr  SS	KJr  S
r\S   r\" \" \5      5      r/ SQrS/\-   r\S   rS rS r/ SQr\\ V s/ s H  o S-   PM	     sn -  rS r  S)S jr!S r"S r#S r$S r%    S*S jr&     S+S jr'S,S jr(S-S jr)S-S jr*S r+S r,S  r-    S.S! jr.S-S" jr/S# r0S$ r1S% r2S& r3S' r4S( r5gs  sn f )/    N)Version)Literalget_args)	DataFrameSeries)GeoDataFrame)import_optional_dependency)from_shapelyfrom_wkb   )_expand_user1.0.0)0.1.0z0.4.0z1.0.0-beta.1r   1.1.0)point
linestringpolygon
multipointmultilinestringmultipolygonWKB)r   geoarrowc                 t    [        U [        5      =(       a"    SU ;   =(       a    U R                  S5      (       + $ )Nz://)zhttp://zhttps://)
isinstancestr
startswith)urls    eC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\geopandas/io/arrow.py_is_fsspec_urlr   <   s2    3 	8SL	8677    c                     U R                  5        Ha  u  p[        U[        5      (       a  [        U5        M'  US:X  d  M/  [        U[        5      (       d  MF  U H  nUR                  SS5        M     Mc     g)a4  
Older PROJ versions will not recognize IDs of datum ensemble members that
were added in more recent PROJ database versions.

Cf https://github.com/opengeospatial/geoparquet/discussions/110
and https://github.com/OSGeo/PROJ/pull/3221

Mimicking the patch to GDAL from https://github.com/OSGeo/gdal/pull/5872
membersidN)itemsr   dict#_remove_id_from_member_of_ensembleslistpop)	json_dictkeyvaluemembers       r   r&   r&   D   sX      oo'
eT""/6I*UD"9"9

4&  	 (r    )Point
LineStringr.   Polygon
MultiPointMultiLineStringMultiPolygonGeometryCollectionz Zc                    [         R                  " U R                  R                  5      n[         R                  " U R                  R                  5      nX==   S-  ss'   [        U5      R                  5       R                  5       nSU;   a  UR                  S5        [        U Vs/ s H  n[        U   PM     sn5      $ s  snf )z+Get unique geometry types from a GeoSeries.   )shapelyget_type_idarray_datahas_zr   uniquetolistremovesorted_geometry_type_names)seriesarr_geometry_typesr;   geometry_typesidxs        r   _get_geometry_typesrE   d   s     ,,V\\-?-?@MM&,,,,-E"./668??AN	^b!G',GHHGs   (Cc                 r   Uc5  U(       a(  [        S UR                  5        5       5      (       a  SnO[        nU[        ;  a!  [	        SSR                  [        5       35      e0 nU R                  U R                  S:H      GH  nX   n[        U5      nUS   S:X  a  S	n[        U5      S
:X  a  US   nOSnSn	UR                  (       aF  US:X  a  UR                  R                  5       n	O%UR                  R                  5       n	[        U	5        SU(       a	  XR;   a  X%   OSSU	X0XE'   UR                  R                  5       n
[         R"                  " U
5      R%                  5       (       a  XU   S'   U(       d  M  SSS/SS/SS/SS/S.0XE   S'   GM     U R&                  UUS[(        R*                  S.S.$ )a  Create and encode geo metadata dict.

Parameters
----------
df : GeoDataFrame
schema_version : {'0.1.0', '0.4.0', '1.0.0-beta.1', '1.0.0', '1.1.0', None}
    GeoParquet specification version; if not provided will default to
    latest supported version.
geometry_encoding : dict, default None
    GeoParquet encoding per geometry column.
    Defaults to "WKB" for columns that are not present in the dictionary.
write_covering_bbox : bool, default False
    Writes the bounding box column for each row entry with column
    name 'bbox'. Writing a bbox column can be computationally
    expensive, hence is default setting is False.

Returns
-------
dict
Nc              3   *   #    U  H	  oS :g  v   M     g7f)r   N ).0encodings     r   	<genexpr>#_create_metadata.<locals>.<genexpr>   s      %
.H(.Hs   r   zschema_version must be one of: z, geometryr   0geometry_typer   rC   r   rJ   r   crsbboxxminyminxmaxymaxrR   rS   rT   rU   covering	geopandas)libraryversion)primary_columncolumnsrZ   creator)anyvaluesMETADATA_VERSIONSUPPORTED_VERSIONS
ValueErrorjoinr\   dtypesrE   lenrP   to_wktto_json_dictr&   total_boundsr=   npisfiniteall_geometry_column_namerX   __version__)dfschema_versiongeometry_encodingwrite_covering_bboxcolumn_metadatacolrA   rC   geometry_types_namerP   rQ   s              r   _create_metadataru   s   s   .  %
.?.F.F.H%
 "
 "
 %N-N//-dii8J.K-LM
 	

 Ozz"))z12,V4!#"1>"a'!/!2"2::(jj'')jj--/3C8 $)A "&3 
 ""))+;;t  ""+/C (#V,#V,#V,#V,	0O ,G 3Z 22"!*y7L7LM	 r    c                 L    [         R                  " U 5      R                  S5      $ )z}Encode metadata dict to UTF-8 JSON string.

Parameters
----------
metadata : dict

Returns
-------
UTF-8 encoded JSON string
utf-8)jsondumpsencode)metadatas    r   _encode_metadatar|      s     ::h&&w//r    c                 T    U c  g[         R                  " U R                  S5      5      $ )zDecode a UTF-8 encoded JSON string to dict.

Parameters
----------
metadata_str : string (UTF-8 encoded)

Returns
-------
dict
Nrw   )rx   loadsdecode)metadata_strs    r   _decode_metadatar      s'     ::l))'233r    c                     [        U [        5      (       d  [        S5      eU R                  R                  S;  a  [        S5      e[        S U R                  R                   5       5      nU(       d  [        S5      eg)zValidate that the GeoDataFrame conforms to requirements for writing
to Parquet format.

Raises `ValueError` if the GeoDataFrame is not valid.

copied from `pandas.io.parquet`

Parameters
----------
df : GeoDataFrame
z;Writing to Parquet/Feather only supports IO with DataFrames>   emptystringunicodez7Writing to Parquet/Feather requires string column namesc              3   J   #    U  H  oc  M  [        U[        5      v   M     g 7fN)r   r   )rI   names     r   rK   &_validate_dataframe.<locals>.<genexpr>   s       *8$
4.s   ##z!Index level names must be stringsN)r   r   rb   r\   inferred_typerk   indexnames)rn   valid_namess     r   _validate_dataframer      su     b)$$VWW 
zz'EERSS  *,((.. K <== r    c           	         U (       d  [        S5      eU R                  SU R                  S5      5      nU(       d  [        S5      eSnU H%  nU R                  US5      b  M  [        SU S35      e   [        U S	   [        5      (       d  [        S
5      eSnU S	   R	                  5        H  u  pVU H  nX6;  d  M
  [        SU SU S35      e   US   [
        ;  a  [        S[        < SUS    35      eUR                  SS5      S:X  a  [        R                  " SU S3[        SS9  SU;   d  M  US   nSU;   d  M  US   nS H!  n	XR                  5       ;  d  M  [        S5      e   M     g)zValidate geo metadata.
Must not be empty, and must contain the structure specified above.

Raises ValueError if metadata is not valid.

Parameters
----------
metadata : dict
9Missing or malformed geo metadata in Parquet/Feather filerZ   ro   zI'geo' metadata in Parquet/Feather file is missing required key: 'version')r[   r\   NzA'geo' metadata in Parquet/Feather file is missing required key: ''r\   z*'columns' in 'geo' metadata must be a dict)rJ   z@'geo' metadata in Parquet/Feather file is missing required key 'z' for column 'rJ   z;Only WKB geometry encoding or one of the native encodings (z) are supported, got: edgesplanar	sphericalz'The geo metadata indicate that column 'z' has spherical edges, but because GeoPandas currently does not support spherical geometry, it ignores this metadata and will interpret the edges of the geometries as planar.   
stacklevelrW   rQ   rV   z&Metadata for bbox column is malformed.)rb   getr   r%   r$   SUPPORTED_ENCODINGSGEOARROW_ENCODINGSwarningswarnUserWarningkeys)
r{   rZ   required_keysr*   required_col_keysrs   rr   rW   rQ   vars
             r   _validate_geo_metadatar     s    TUU ll9hll3C&DEGW
 	
 2M<<T"*5   hy)400EFF & ( 3 9 9 ;$C) uN3%q2  % :&.AA&) *'
346  w1[@MM9# ?, ,  (&z2H!';C))+-()QRR <; !<r    c                    SSK Jn  SSKJn  [	        U 5        Ub  US:w  a  US:w  a  [        S5      eU" XUSS9u  px[        U UUUS	9n	U(       a[  S
U R                  ;   a  [        S5      eU R                  n
UR                  U
S   U
S   U
S   U
S   // SQS9nUR                  S
U5      nUR                  R                  nUR                  S[        U	5      05        UR                  U5      $ )zoConvert a GeoDataFrame to a pyarrow Table.

Helper function with main, shared logic for to_parquet/to_feather.
r   )StructArray)geopandas_to_arrowr   r   zB'geoarrow' encoding is only supported with schema version >= 1.1.0F)rp   r   interleaved)ro   rp   rq   rQ   z`An existing column 'bbox' already exists in the dataframe. Please rename to write covering bbox.minxminymaxxmaxyrV   )r      geo)pyarrowr   geopandas.io._geoarrowr   r   rb   ru   r\   boundsfrom_arraysappend_columnschemar{   updater|   replace_schema_metadata)rn   r   rp   ro   rq   r   r   tablegeometry_encoding_dictgeo_metadatar   
bbox_arrayr{   s                r   _geopandas_to_arrowr   K  s    $9!%.G*CT  %7
u%%!E $
%0/	L RZZ8   ,,F^VF^VF^VF^L2 - 

 ##FJ7 ||$$HOOV-l;<=((22r    c                 r    [        SSS9n[        U5      n[        U UUUUS9n	UR                  " X4SU0UD6  g)a  
Write a GeoDataFrame to the Parquet format.

Any geometry columns present are serialized to WKB format in the file.

Requires 'pyarrow'.

This is tracking version 1.0.0 of the GeoParquet specification at:
https://github.com/opengeospatial/geoparquet. Writing older versions is
supported using the `schema_version` keyword.

.. versionadded:: 0.8

Parameters
----------
path : str, path object
index : bool, default None
    If ``True``, always include the dataframe's index(es) as columns
    in the file output.
    If ``False``, the index(es) will not be written to the file.
    If ``None``, the index(ex) will be included as columns in the file
    output except `RangeIndex` which is stored as metadata only.
compression : {'snappy', 'gzip', 'brotli', None}, default 'snappy'
    Name of the compression to use. Use ``None`` for no compression.
geometry_encoding : {'WKB', 'geoarrow'}, default 'WKB'
    The encoding to use for the geometry columns. Defaults to "WKB"
    for maximum interoperability. Specify "geoarrow" to use one of the
    native GeoArrow-based single-geometry type encodings.
schema_version : {'0.1.0', '0.4.0', '1.0.0', '1.1.0', None}
    GeoParquet specification version; if not provided will default to
    latest supported version.
write_covering_bbox : bool, default False
    Writes the bounding box column for each row entry with column
    name 'bbox'. Writing a bbox column can be computationally
    expensive, hence is default setting is False.
**kwargs
    Additional keyword arguments passed to pyarrow.parquet.write_table().
pyarrow.parquet(pyarrow is required for Parquet support.extra)r   rp   ro   rq   compressionN)r	   r   r   write_table)
rn   pathr   r   rp   ro   rq   kwargsparquetr   s
             r   _to_parquetr     sT    ` )!KG D
+%/E GGGr    c                 l    [        SSS9n[        U5      n[        XUS9nUR                  " Xq4SU0UD6  g)a  
Write a GeoDataFrame to the Feather format.

Any geometry columns present are serialized to WKB format in the file.

Requires 'pyarrow' >= 0.17.

This is tracking version 1.0.0 of the GeoParquet specification for
the metadata at: https://github.com/opengeospatial/geoparquet. Writing
older versions is supported using the `schema_version` keyword.

.. versionadded:: 0.8

Parameters
----------
path : str, path object
index : bool, default None
    If ``True``, always include the dataframe's index(es) as columns
    in the file output.
    If ``False``, the index(es) will not be written to the file.
    If ``None``, the index(ex) will be included as columns in the file
    output except `RangeIndex` which is stored as metadata only.
compression : {'zstd', 'lz4', 'uncompressed'}, optional
    Name of the compression to use. Use ``"uncompressed"`` for no
    compression. By default uses LZ4 if available, otherwise uncompressed.
schema_version : {'0.1.0', '0.4.0', '1.0.0', '1.1.0', None}
    GeoParquet specification version for the metadata; if not provided
    will default to latest supported version.
kwargs
    Additional keyword arguments passed to pyarrow.feather.write_feather().
pyarrow.feather(pyarrow is required for Feather support.r   )r   ro   r   N)r	   r   r   write_feather)rn   r   r   r   ro   r   featherr   s           r   _to_featherr     sE    @ )!KG DOE%I;I&Ir    c           	         Uc  [        U R                  R                  5      nUS    Vs/ s H  o3U R                  ;   d  M  UPM     nn[	        U R                  SS5      R                  5       R                  5      nUR                  UR                  S9  [        U5      (       d  [        S5      eUS   n[        U5      (       a.  Xd;  a)  US   n[        U5      S:  a  [        R                  " SSS	9  U R                  U5      nUc  0 nUR                  " S0 UD6nU H  nUS   U   n	S
U	;   a&  U	S
   n
[        U
[         5      (       a  [#        U
5        OSn
U	S   S:X  a!  [%        [&        R(                  " X   5      U
S9nO-SSKJn  [/        U" X   R1                  5       SU	S   -   5      U
S9nUR3                  UR                  U5      X;5        M     [5        XS9$ s  snf )zsConvert a pyarrow Table to a GeoDataFrame.

Helper function with main, shared logic for read_parquet/read_feather.
r\   r   )r*   No geometry columns are included in the columns read from
            the Parquet/Feather file.  To read this file without geometry columns,
            use pandas.read_parquet/read_feather() instead.r[   r   zMultiple non-primary geometry columns read from Parquet/Feather file. The first column read was promoted to the primary geometry.   r   rP   z	OGC:CRS84rJ   r   )rP   )construct_shapely_arrayz	geoarrow.)rM   rH   )_validate_and_decode_metadatar   r{   column_namesr'   slice	to_pandasr\   sortr   re   rb   r   r   dropr   r%   r&   r   ri   r9   r   r   r
   combine_chunksinsertr   )r   r   to_pandas_kwargsrs   geometry_columnsresult_column_namesrM   
table_attrrn   col_metadatarP   geom_arrr   s                r   _arrow_to_geopandasr     s   
 4U\\5J5JK
 $I..9K9K2K.   u{{1a0::<DDE1778  ?
 	
 ,-H !A#A&  1$MMT ,-J				1 0	1B  #I.s3L u%C#t$$3C8 C
#u, 4#>HF#'J--/|J?W1W 	H 			%++C0#@/  2 ..ws   GGc                 N   [        U [        5      (       a   Uc  Uc   SSKJn  UR	                  U 5      u  p[        U 5      (       a5  Uc2  [        SSS9nUR                  R                  " U 40 U=(       d    0 D6u  pUc  U(       a  [        SU  S35      eX4$ ! [
         a     Nmf = f)z|
Get the filesystem and path for a given filesystem and path.

If the filesystem is not None then it's just returned as is.
r   )
FileSystemfsspecz(fsspec is requred for 'storage_options'.r   z7Cannot provide 'storage_options' with non-fsspec path 'r   )r   r   
pyarrow.fsr   from_uri	Exceptionr   r	   core	url_to_fsrb   )r   
filesystemstorage_optionsr   r   s        r   _get_filesystem_pathr   2  s     $!8Z=O	-)2248J d
 2+F
 ";;00Q/:ORQ
oEdV1M
 	
 !  	 	s   B 
B$#B$c                     SSK Jn  [        XR                  5      (       a  U $  SSKn[        XR
                  5      (       a   UR                  UR                  U 5      5      $  U $ ! [         a     U $ f = f)a  Check if ``filesystem`` is a valid filesystem.

Simplified version of pyarrow.fs._ensure_filesystem. This is only needed
below because `pyarrow.parquet.read_metadata` does not yet accept a
filesystem keyword (https://issues.apache.org/jira/browse/ARROW-16719)
r   )fsN)	r   r   r   r   r   AbstractFileSystemPyFileSystemFSSpecHandlerImportError)r   r   r   s      r   _ensure_arrow_fsr   Q  s{     *mm,,A j";";<<??2#3#3J#?@@ =   
 s   A% %
A32A3c                     U b  SU ;  a  [        S5      e [        U R                  SS5      5      n[        U5        U$ ! [        [        R
                  R                  4 a    [        S5      ef = f)Nr   ziMissing geo metadata in Parquet/Feather file.
            Use pandas.read_parquet/read_feather() instead.r    r   )rb   r   r   	TypeErrorrx   decoderJSONDecodeErrorr   )r{   decoded_geo_metadatas     r   r   r   i  s|    61?
 	
V/VS0IJ /0	 t||334 VTUUVs	   > 0A.c                 |   SSK nSSK Jn  0 n[        UR                  5      [        S5      :  a	  [	        SS9n UR
                  " U 4SU0UD6R                  nUR                  nUb  S	U;  a   UR                  XS9R                  nXV4$ XV4$ ! [         a    UR                  XS9n NPf = f! [         a     XV4$ f = f)
a.  Open the Parquet file/dataset a first time to get the schema and metadata.

TODO: we should look into how we can reuse opened dataset for reading the
actual data, to avoid discovering the dataset twice (problem right now is
that the ParquetDataset interface doesn't allow passing the filters on read)

r   N)r   z15.0.0F)use_legacy_datasetr   )r   r   )r   r   r   rm   r%   ParquetDatasetr   r   read_schemar{   read_metadata)r   r   r   r   r   r   r{   s          r   !_read_parquet_schema_and_metadatar   z  s     Fw""#gh&77/B''NNvNUU H
 61	,,T,IRRH 6  B$$T$AB  		s#   B .B, B)(B),
B;:B;c                    [        SSS9nSSKnUR                  SS5      n[        XUS9u  p[	        U 5      n [        X5      u  p[        U
5      n[        US   5      S:X  a  [        S	5      eUb  [        X5      OSn[        U5      nU(       d  U(       a  [        X5      nS
U;   a  UR                  S
5      n[        X5      nOUnSUS'   UR                  " U 4XUS.UD6n[        UX5      $ )a  
Load a Parquet object from the file path, returning a GeoDataFrame.

You can read a subset of columns in the file using the ``columns`` parameter.
However, the structure of the returned GeoDataFrame will depend on which
columns you read:

* if no geometry columns are read, this will raise a ``ValueError`` - you
  should use the pandas `read_parquet` method instead.
* if the primary geometry column saved to this file is not included in
  columns, the first available geometry column will be set as the geometry
  column of the returned GeoDataFrame.

Supports versions 0.1.0, 0.4.0 and 1.0.0 of the GeoParquet
specification at: https://github.com/opengeospatial/geoparquet

If 'crs' key is not present in the GeoParquet metadata associated with the
Parquet object, it will default to "OGC:CRS84" according to the specification.

Requires 'pyarrow'.

.. versionadded:: 0.8

Parameters
----------
path : str, path object
columns : list-like of strings, default=None
    If not None, only these columns will be read from the file.  If
    the primary geometry column is not included, the first secondary
    geometry read from the file will be set as the geometry column
    of the returned GeoDataFrame.  If no geometry columns are present,
    a ``ValueError`` will be raised.
storage_options : dict, optional
    Extra options that make sense for a particular storage connection, e.g. host,
    port, username, password, etc. For HTTP(S) URLs the key-value pairs are
    forwarded to urllib as header options. For other URLs (e.g. starting with
    "s3://", and "gcs://") the key-value pairs are forwarded to fsspec. Please
    see fsspec and urllib for more details.

    When no storage options are provided and a filesystem is implemented by
    both ``pyarrow.fs`` and ``fsspec`` (e.g. "s3://") then the ``pyarrow.fs``
    filesystem is preferred. Provide the instantiated fsspec filesystem using
    the ``filesystem`` keyword if you wish to use its implementation.
bbox : tuple, optional
    Bounding box to be used to filter selection from geoparquet data. This
    is only usable if the data was saved with the bbox covering metadata.
    Input is of the tuple format (xmin, ymin, xmax, ymax).
to_pandas_kwargs : dict, optional
    Arguments passed to the `pa.Table.to_pandas` method for non-geometry columns.
    This can be used to control the behavior of the conversion of the non-geometry
    columns to a pandas DataFrame. For example, you can use this to control the
    dtype conversion of the columns. By default, the `to_pandas` method is called
    with no additional arguments.

**kwargs
    Any additional kwargs passed to :func:`pyarrow.parquet.read_table`.

Returns
-------
GeoDataFrame

Examples
--------
>>> df = geopandas.read_parquet("data.parquet")  # doctest: +SKIP

Specifying columns to read:

>>> df = geopandas.read_parquet(
...     "data.parquet",
...     columns=["geometry", "pop_est"]
... )  # doctest: +SKIP
r   r   r   r   Nr   )r   r   r\   r   filtersTuse_pandas_metadata)r\   r   r   )r	   geopandas.io._pyarrow_hotfixr(   r   r   r   r   re   rb   _get_parquet_bbox_filter"_check_if_covering_in_geo_metadata_get_non_bbox_columns_splice_bbox_and_filters
read_tabler   )r   r\   r   rQ   r   r   r   rX   r   r   r{   r   bbox_filterif_bbox_column_existsfilters_kwargr   r   s                    r   _read_parquetr    s!   ` )!KG ( L$/J+_J D8JF0:L
<	"#q(?
 	
 9=8H 4d  ?|L ,'= F

9-*=F$(F !gIOE ulEEr    c                 p    [        SSS9nSSKn[        U 5      n UR                  " U 4SU0UD6n[	        XbS9$ )a  
Load a Feather object from the file path, returning a GeoDataFrame.

You can read a subset of columns in the file using the ``columns`` parameter.
However, the structure of the returned GeoDataFrame will depend on which
columns you read:

* if no geometry columns are read, this will raise a ``ValueError`` - you
  should use the pandas `read_feather` method instead.
* if the primary geometry column saved to this file is not included in
  columns, the first available geometry column will be set as the geometry
  column of the returned GeoDataFrame.

Supports versions 0.1.0, 0.4.0, 1.0.0 and 1.1.0 of the GeoParquet
specification at: https://github.com/opengeospatial/geoparquet

If 'crs' key is not present in the Feather metadata associated with the
Parquet object, it will default to "OGC:CRS84" according to the specification.

Requires 'pyarrow' >= 0.17.

.. versionadded:: 0.8

Parameters
----------
path : str, path object
columns : list-like of strings, default=None
    If not None, only these columns will be read from the file.  If
    the primary geometry column is not included, the first secondary
    geometry read from the file will be set as the geometry column
    of the returned GeoDataFrame.  If no geometry columns are present,
    a ``ValueError`` will be raised.
to_pandas_kwargs : dict, optional
    Arguments passed to the `pa.Table.to_pandas` method for non-geometry columns.
    This can be used to control the behavior of the conversion of the non-geometry
    columns to a pandas DataFrame. For example, you can use this to control the
    dtype conversion of the columns. By default, the `to_pandas` method is called
    with no additional arguments.
**kwargs
    Any additional kwargs passed to pyarrow.feather.read_table().

Returns
-------
GeoDataFrame

Examples
--------
>>> df = geopandas.read_feather("data.feather")  # doctest: +SKIP

Specifying columns to read:

>>> df = geopandas.read_feather(
...     "data.feather",
...     columns=["geometry", "pop_est"]
... )  # doctest: +SKIP
r   r   r   r   Nr\   )r   )r	   r   r   r  r   )r   r\   r   r   r   rX   r   s          r   _read_featherr    sI    r )!KG (Dt?W??EuHHr    c                 f   U S   n[        U 5      (       a  [        U 5      n[        X5      $ U S   U   S   S:X  am  SS KJn  UR                  US45      US   :  UR                  US45      US   :*  -  UR                  US45      US	   :  -  UR                  US45      US
   :*  -  $ [        S5      e)Nr[   r\   rJ   r   r   x   yr   r   z}Specifying 'bbox' not supported for this Parquet file (it should either have a bbox covering column or use 'point' encoding).)r   _get_bbox_encoding_column_name_convert_bbox_to_parquet_filterpyarrow.computecomputefieldrb   )r   rQ   r[   bbox_column_namepcs        r   r   r   a  s    !"23N),779,G.tFF	i	 	0	<	G$ XX~s+,Q7xx-.$q'9;xx-.$q'9; xx-.$q'9;	
 D
 	
r    c                     SS K Jn  UR                  US45      U S   :  UR                  US45      U S   :  -  UR                  US45      U S   :  -  UR                  US45      U S   :  -  ) $ )	Nr   rR   r  rS   r   rT   rU   r   )r  r  r  )rQ   r  r  s      r   r  r  y  s      
#V,	-Q	788%v./$q'9	;88%v./$q'9	; 88%v./$q'9	; r    c                 >    U S   nSU S   U   R                  5       ;   $ )Nr[   rW   r\   )r   r   r[   s     r   r   r     s+    !"23Ni0@EEGGGr    c                 4    U S   nU S   U   S   S   S   S   $ )Nr[   r\   rW   rQ   rR   r   rH   r  s     r   r  r    s1    !"23N	">2:>vFvNqQQr    c                 `    [        U5      nU R                  nX#;   a  UR                  U5        U$ r   )r  r   r>   )r   r   r  r\   s       r   r   r     s.    5lCllG"'(Nr    c                 J    [        SSS9nUc  U $ UR                  U 5      nX-  $ )Nr   r   r   )r	   filters_to_expression)kwarg_filtersr  r   filters_expressions       r   r  r    s:    (!KG  66}E++r    )NNF)Nr   NN)Nsnappyr   NF)NNN)NN)NNNN)6rx   r   packaging.versionr   typingr   r   numpyri   pandasr   r   r7   rX   r   geopandas._compatr	   geopandas.arrayr
   r   filer   r`   SUPPORTED_VERSIONS_LITERALr'   ra   r   r   PARQUET_GEOMETRY_ENCODINGSr   r&   r@   rE   ru   r|   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r  r   r  r   r  )	geom_types   0r   <module>r(     sc     % $  $   " 8 2  $%WX (#=>?   g 22 $%67 <'&	  ;OP;OiT);OP P I  JOWt04">6ASL 33r <H~&JRF/R>0 "H 	~FBAIH
0H
R
,k Qs   8C,