
    ph                        S SK r S SKrS SKrS SKrS SKJr  S SKrS SKr	S SK
JrJrJr  S SKrS SKrS SKrS SKrS SKrS SKJr  SSKJrJrJrJrJrJr  SSKJr  \(       a  S SKJr  \" \R@                  5      r!SSS	S
SSSSSSS.
r"SS1r#1 Skr$S	S1r%\RL                   V s0 s H  o RN                  \"U RP                     _M     sn r)\*" \)RW                  5       5      r,\RZ                  " \*" \)R]                  5       5      \/S9r0 " S S\5      r1\" \15        S%S jr2S&S jr3S r4S r5S'S jr6S r7S(S jr8S%S jr9S(S jr:S r;S)S  jr< " S! S"\5      r=S# r>S$ r?gs  sn f )*    N)	lru_cache)ExtensionArrayExtensionDtyperegister_extension_dtype)BaseGeometry   )GEOS_GE_312
HAS_PYPROJPANDAS_GE_21PANDAS_GE_22SHAPELY_GE_21requires_pyproj)SpatialIndex)TransformerPoint
LineString
LinearRingPolygon
MultiPointMultiLineStringMultiPolygonGeometryCollection)
MISSINGNAGPOINT
LINESTRING
LINEARRINGPOLYGON
MULTIPOINTMULTILINESTRINGMULTIPOLYGONGEOMETRYCOLLECTION>   r   r   r   dtypec                   @    \ rS rSr\rSrSr\S 5       r	\S 5       r
Srg)GeometryDtype;   geometryNc                     [        U[        5      (       d  [        S[        U5       35      eXR                  :X  a  U " 5       $ [        SU R
                   SU S35      e)Nz.'construct_from_string' expects a string, got zCannot construct a 'z' from '')
isinstancestr	TypeErrortypename__name__)clsstrings     gC:\Users\julio\OneDrive\Documentos\Trabajo\IdeasFrscas\Cabanna\env\Lib\site-packages\geopandas/array.pyconstruct_from_string#GeometryDtype.construct_from_string@   s]    &#&&@fO  xx5L23<<.PQRSS    c                     [         $ N)GeometryArray)r1   s    r3   construct_array_type"GeometryDtype.construct_array_typeK   s    r6    )r0   
__module____qualname____firstlineno__r   r.   r/   na_valueclassmethodr4   r:   __static_attributes__r<   r6   r3   r&   r&   ;   s9    DDHT T  r6   r&   c                     U(       a#  U R                   (       a  UR                   (       d  gU R                   UR                   :X  d  gg)zo
Check if the projection of both arrays is the same.

If allow_none is True, empty CRS is treated as the same.
TFcrs)leftright
allow_nones      r3   
_check_crsrI   S   s-     xxuyy88uyy r6   c                    U R                   (       aB  U R                   R                  5       n[        U5      S::  a  UOSR                  USS S/5      nOSnUR                   (       aB  UR                   R                  5       n[        U5      S::  a  UOSR                  USS S/5      nOSn[        R
                  " SU SU S3[        US9  g)	zFRaise a CRS mismatch warning with the information on the assigned CRS.2    Nz...zCRS mismatch between the CRS of left geometries and the CRS of right geometries.
Use `to_crs()` to reproject one of the input geometries to match the CRS of the other.

Left CRS: z
Right CRS: 

stacklevel)rE   	to_stringlenjoinwarningswarnUserWarning)rF   rG   rO   left_srs	right_srss        r3   _crs_mismatch_warnrX   a   s    xx88%%'"8}28(3B-QVAW8XyyII'')	Y2-I388Ys^U<S3T 	 	MM	 J [	$ 		r6   c                     U c  g[        U [        5      (       a  [        R                  " U 5      (       a  gU [        R
                  L a  gg)z
Check if scalar value is NA-like (None, np.nan or pd.NA).

Custom version that only works for scalars (returning True or False),
as `pd.isna` also works for array-like input returning a boolean array.
TF)r+   floatnpisnanpdNA)values    r3   isnar`   }   s9     }	E5	!	!bhhuoo	"%%r6   c                 "    [        U [        5      $ r8   )r+   r   )geoms    r3   _is_scalar_geometryrc      s    dL))r6   c                    [        U [        R                  5      (       d'  [        R                  " [	        U 5      [
        S9nXSS& O7[	        U 5      S:X  a&  U R                  S:X  a  U R                  [
        5      nOU n[        R                  " U5      R                  5       (       d  / nU  H  n[        U[        5      (       a  UR                  U5        M+  [        US5      (       a2  [        R                  R                  U5      nUR                  U5        Mn  [!        U5      (       a  UR                  S5        M  [#        SU 35      e   [        R$                  " U[
        S9n['        X!S9$ )a  
Convert a list or array of shapely objects to a GeometryArray.

Validates the elements.

Parameters
----------
data : array-like
    list or array of shapely objects
crs : value, optional
    Coordinate Reference System of the geometry objects. Can be anything accepted by
    :meth:`pyproj.CRS.from_user_input() <pyproj.crs.CRS.from_user_input>`,
    such as an authority string (eg "EPSG:4326") or a WKT string.

r#   Nr   float64__geo_interface__z&Input must be valid geometry objects: rD   )r+   r[   ndarrayemptyrQ   objectr$   astypeshapelyis_valid_inputallr   appendhasattrr(   shaper`   r-   arrayr9   )datarE   arroutrb   s        r3   from_shapelyru      s     dBJJ''hhs4y/A	TaDJJ)3kk&!!!#&**,,D$--

4 233''--d3

4 d

4 "H OPP  hhs&)&&r6   c                 Z    [        U [        5      (       d  [        S5      eU R                  $ )z?Convert GeometryArray to numpy object array of shapely objects.'geoms' must be a GeometryArray)r+   r9   
ValueError_data)geomss    r3   
to_shapelyr{      s%    e]++:;;;;r6   c                 :    [        [        R                  " XS9US9$ )a  
Convert a list or array of WKB objects to a GeometryArray.

Parameters
----------
data : array-like
    list or array of WKB objects
crs : value, optional
    Coordinate Reference System of the geometry objects. Can be anything accepted by
    :meth:`pyproj.CRS.from_user_input() <pyproj.crs.CRS.from_user_input>`,
    such as an authority string (eg "EPSG:4326") or a WKT string.
on_invalid: {"raise", "warn", "ignore"}, default "raise"
    - raise: an exception will be raised if a WKB input geometry is invalid.
    - warn: a warning will be raised and invalid WKB geometries will be returned as
      None.
    - ignore: invalid WKB geometries will be returned as None without a warning.
    - fix: an effort is made to fix invalid input geometries (e.g. close
      unclosed rings). If this is not possible, they are returned as ``None``
      without a warning. Requires GEOS >= 3.11 and shapely >= 2.1.


on_invalidrD   )r9   rk   from_wkbrr   rE   r~   s      r3   r   r          , ))$FCPPr6   c                 t    [        U [        5      (       d  [        S5      e[        R                  " U 4SU0UD6$ )z=Convert GeometryArray to a numpy object array of WKB objects.rw   hex)r+   r9   rx   rk   to_wkb)rz   r   kwargss      r3   r   r      s4    e]++:;;>>%3S3F33r6   c                 :    [        [        R                  " XS9US9$ )a  
Convert a list or array of WKT objects to a GeometryArray.

Parameters
----------
data : array-like
    list or array of WKT objects
crs : value, optional
    Coordinate Reference System of the geometry objects. Can be anything accepted by
    :meth:`pyproj.CRS.from_user_input() <pyproj.crs.CRS.from_user_input>`,
    such as an authority string (eg "EPSG:4326") or a WKT string.
on_invalid : {"raise", "warn", "ignore"}, default "raise"
    - raise: an exception will be raised if a WKT input geometry is invalid.
    - warn: a warning will be raised and invalid WKT geometries will be
      returned as ``None``.
    - ignore: invalid WKT geometries will be returned as ``None`` without a warning.
    - fix: an effort is made to fix invalid input geometries (e.g. close
      unclosed rings). If this is not possible, they are returned as ``None``
      without a warning. Requires GEOS >= 3.11 and shapely >= 2.1.

r}   rD   )r9   rk   from_wktr   s      r3   r   r      r   r6   c                 p    [        U [        5      (       d  [        S5      e[        R                  " U 40 UD6$ )z=Convert GeometryArray to a numpy object array of WKT objects.rw   )r+   r9   rx   rk   to_wkt)rz   r   s     r3   r   r     s/    e]++:;;>>%*6**r6   c                     [         R                  " U SS9n [         R                  " USS9nUb  [         R                  " USS9n[        [        R                  " XU5      US9$ )a  
Generate GeometryArray of shapely Point geometries from x, y(, z) coordinates.

In case of geographic coordinates, it is assumed that longitude is captured by
``x`` coordinates and latitude by ``y``.

Parameters
----------
x, y, z : iterable
crs : value, optional
    Coordinate Reference System of the geometry objects. Can be anything accepted by
    :meth:`pyproj.CRS.from_user_input() <pyproj.crs.CRS.from_user_input>`,
    such as an authority string (eg "EPSG:4326") or a WKT string.

Examples
--------
>>> import pandas as pd
>>> df = pd.DataFrame({'x': [0, 1, 2], 'y': [0, 1, 2], 'z': [0, 1, 2]})
>>> df
   x  y  z
0  0  0  0
1  1  1  1
2  2  2  2
>>> geometry = geopandas.points_from_xy(x=[1, 0], y=[0, 1])
>>> geometry = geopandas.points_from_xy(df['x'], df['y'], df['z'])
>>> gdf = geopandas.GeoDataFrame(
...     df, geometry=geopandas.points_from_xy(df['x'], df['y']))

Having geographic coordinates:

>>> df = pd.DataFrame({'longitude': [-140, 0, 123], 'latitude': [-65, 1, 48]})
>>> df
   longitude  latitude
0       -140       -65
1          0         1
2        123        48
>>> geometry = geopandas.points_from_xy(df.longitude, df.latitude, crs="EPSG:4326")

Returns
-------
output : GeometryArray
re   r#   rD   )r[   asarrayr9   rk   points)xyzrE   s       r3   points_from_xyr     sR    V 	

1I&A


1I&A}JJq	*a0c::r6   c                     ^  \ rS rSrSr\" 5       rSS jr\S 5       r	\S 5       r
\S 5       r\R                  S 5       rS	 r\S
 5       rS rS rS rS rS r\S 5       rS rSS jrSS jr\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r \S 5       r!S r"S r#S  r$S! r%S" r&\S# 5       r'\S$ 5       r(S% r)S& r*\S' 5       r+\S( 5       r,S) r-\S* 5       r.S+ r/SS, jr0\S- 5       r1SS. jr2S/ r3S0 r4S1 r5S2 r6S3 r7S4 r8S5 r9SS7 jr:SS8 jr;S9 r<S: r=S; r>SS< jr?SS= jr@SS> jrASS? jrB\CS@ 5       rDSA rESB rFSC rGSD rHSE rISF rJSG rKSH rLSI rMSJ rNSK rOSL rPSM rQSN rRSO rSSP rTSQ rUSR rVSS rWST rXSU rYSV rZSW r[SX r\SY r]SSZ jr^SS[ jr_SS\ jr`SS] jraSS^ jrbS_ rcS` rdSa reSSb jrfSc rg\CSd 5       rhSe riSSf jrjSSg jrkSSh jrlSSi jrm\nSSj j5       ro\nSSk j5       rp\Sl 5       rq\Sm 5       rr\Sn 5       rs\So 5       rt\Sp 5       ru\Sq 5       rv\Sr 5       rw\Ss 5       rx\St 5       rySu rzSSv jr{ SU 4Sw jjr|SSx jr}SSy jr~Sz r SS{\4S| jjrS} r\S~ 5       rSU 4S jjr\SS j5       r\SS6S.S j5       rS r\S 5       rS rSS\S\4S jjrSS\S\4S jjrSS jr\S 5       rSS jrSS jrS rS rS rS rSrU =r$ )r9   i;  zaClass wrapping a numpy array of Shapely objects.

It also holds the array-based implementations.
Nc                 6   [        XR                  5      (       a   U(       d  UR                  nUR                  nOE[        U[        R
                  5      (       d  [        S5      eUR                  S:X  d  [        S5      eXl        S U l	        X l        S U l
        g )Nzx'data' should be array of geometry objects. Use from_shapely, from_wkb, from_wkt functions to construct a GeometryArray.r   z;'data' should be a 1-dimensional array of geometry objects.)r+   	__class__rE   ry   r[   rg   r-   ndimrx   _crs_sindex)selfrr   rE   s      r3   __init__GeometryArray.__init__C  s    dNN++hh::DD"**--M  aM  
	r6   c                 h    U R                   c  [        U R                  5      U l         U R                   $ )z/Spatial index for the geometries in this array.)r   r   ry   r   s    r3   sindexGeometryArray.sindexW  s(     <<'

3DL||r6   c                     U R                   SL$ )a  Check the existence of the spatial index without generating it.

Use the `.sindex` attribute on a GeoDataFrame or GeoSeries
to generate a spatial index if it does not yet exist,
which may take considerable time based on the underlying index
implementation.

Note that the underlying spatial index may not be fully
initialized until the first use.

See Also
--------
GeoDataFrame.has_sindex

Returns
-------
bool
    `True` if the spatial index has been generated or
    `False` if not.
N)r   r   s    r3   
has_sindexGeometryArray.has_sindex^  s    , ||4''r6   c                     U R                   $ )a  The Coordinate Reference System (CRS) represented as a ``pyproj.CRS`` object.

Returns None if the CRS is not set, and to set the value it
:getter: Returns a ``pyproj.CRS`` or None. When setting, the value
Coordinate Reference System of the geometry objects. Can be anything accepted by
:meth:`pyproj.CRS.from_user_input() <pyproj.crs.CRS.from_user_input>`,
such as an authority string (eg "EPSG:4326") or a WKT string.
)r   r   s    r3   rE   GeometryArray.crsv  s     yyr6   c                     [         (       a&  SSKJn  U(       d  SOUR                  U5      U l        gUb  [
        R                  " S[        SS9  SU l        g)zSet the value of the crs.r   CRSNzCannot set the CRS, falling back to None. The CRS support requires the 'pyproj' package, but it is not installed or does not import correctly. The functions depending on CRS will raise an error or may produce unexpected results.   rN   )r
   pyprojr   from_user_inputr   rS   rT   rU   )r   r_   r   s      r3   rE   r     sJ     :"$)s/B/B5/IDI 7    DIr6   c                     U R                   (       a[  U R                   R                  (       a?  [        R                  " S[        R
                  " 5       S   R                   S3[        US9  ggg)zGCheck CRS and warn if the planar operation is done in a geographic CRS.z/Geometry is in a geographic CRS. Results from 'r   zt' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
rN   N)rE   is_geographicrS   rT   inspectstackfunctionrU   )r   rO   s     r3   check_geographic_crs"GeometryArray.check_geographic_crs  sV    88..MMMMOA&//0 199 % /8r6   c                     U R                   $ r8   )_dtyper   s    r3   r$   GeometryArray.dtype  s    {{r6   c                      U R                   S   $ )Nr   )rp   r   s    r3   __len__GeometryArray.__len__  s    zz!}r6   c                     [        U[        R                  5      (       a  U R                  U   $ [        R
                  R                  R                  X5      n[        U R                  U   U R                  S9$ NrD   )
r+   numbersIntegralry   r]   apiindexerscheck_array_indexerr9   rE   )r   idxs     r3   __getitem__GeometryArray.__getitem__  sV    c7++,,::c?" ffoo11$<TZZ_$((;;r6   c                    [         R                  R                  R                  X5      n[	        U[         R
                  5      (       a  UR                  n[	        U[         R                  5      (       a  UR                  R                  5       n[	        U[        [        R                  -  5      (       a  [        U5      n[	        U[        5      (       aD  [	        U[        R                  5      (       a  [!        S5      eUR"                  U R"                  U'   O[	        U[$        5      (       d  ['        U5      (       a  ['        U5      (       a  S nO:[	        U[$        5      (       a  [        U/5      R"                  S   nO[)        S5      e[	        U[*        [        -  [        R                  -  5      (       a.  [        R,                  " S[.        S9nU/US S & X0R"                  U'   OX R"                  U'   O[)        SU< 35      eS U l        g )Nz)cannot set a single element with an arrayr   zshould be valid geometryr   r#   z3Value should be either a BaseGeometry or None, got )r]   r   r   r   r+   Seriesvalues	DataFrameflattenlistr[   rg   ru   r9   r   r   rx   ry   r   r`   r-   slicerh   ri   r   )r   keyr_   value_arrays       r3   __setitem__GeometryArray.__setitem__  sv    ffoo11$<eRYY''LLEeR\\**LL((*EeTBJJ.// 'Ee]++#w//00 !LMM#kkDJJsO|,,UE{{ E<00$eW-33A6 :;;#ut|bjj899 hhq7"'A"-

3"'

3EeYO 
 r6   c                 Z    [         R                  " U R                  5      U R                  4$ r8   )rk   r   ry   r   r   s    r3   __getstate__GeometryArray.__getstate__  s    tzz*DII66r6   c                    [        U[        5      (       d8  [        R                  " US   5      nUS   U l        S U l        X l        S U l        g SU;   a  UR                  S5      US'   SU;  a  S US'   U R                  R                  U5        g )Nr   r   rr   ry   r   )r+   dictrk   r   r   r   ry   basepop__dict__update)r   staterz   s      r3   __setstate__GeometryArray.__setstate__  s}    %&&$$U1X.EaDIDLJDI!&6!2gU" $fMM  'r6   c                 B    [         R                  " U R                  5      $ r8   )rk   is_validry   r   s    r3   r   GeometryArray.is_valid      

++r6   c                 B    [         R                  " U R                  5      $ r8   )rk   is_valid_reasonry   r   s    r3   r   GeometryArray.is_valid_reason  s    &&tzz22r6   c                     [         (       a  [        (       d  [        S5      e[        [        R
                  " U R                  US95      $ )Nz@Method 'is_valid_coverage' requires shapely>=2.1 and GEOS>=3.12.	gap_width)r   r	   ImportErrorboolrk   coverage_is_validry   r   r   s     r3   is_valid_coverageGeometryArray.is_valid_coverage  s9    ++R  G--djjINOOr6   c                     [         (       a  [        (       d  [        S5      e[        R                  " U R
                  US9$ )NzEMethod 'invalid_coverage_edges' requires shapely>=2.1 and GEOS>=3.12.r   )r   r	   r   rk   coverage_invalid_edgesry   r   s     r3   invalid_coverage_edges$GeometryArray.invalid_coverage_edges  s4    ++W  --djjINNr6   c                 B    [         R                  " U R                  5      $ r8   )rk   is_emptyry   r   s    r3   r   GeometryArray.is_empty	  r   r6   c                 B    [         R                  " U R                  5      $ r8   )rk   	is_simplery   r   s    r3   r   GeometryArray.is_simple        ,,r6   c                 B    [         R                  " U R                  5      $ r8   )rk   is_ringry   r   s    r3   r   GeometryArray.is_ring  s    tzz**r6   c                 B    [         R                  " U R                  5      $ r8   )rk   	is_closedry   r   s    r3   r   GeometryArray.is_closed  r   r6   c                 B    [         R                  " U R                  5      $ r8   )rk   is_ccwry   r   s    r3   r   GeometryArray.is_ccw      ~~djj))r6   c                 B    [         R                  " U R                  5      $ r8   )rk   has_zry   r   s    r3   r   GeometryArray.has_z  s    }}TZZ((r6   c                 n    [         (       d  [        S5      e[        R                  " U R                  5      $ )Nz'has_m' requires shapely>=2.1.)r   r   rk   has_mry   r   s    r3   r   GeometryArray.has_m!  s&    }>??}}TZZ((r6   c                     [         R                  " U R                  5      n[        [        R
                  " [        U5         $ r8   )rk   get_type_idry   geometry_type_valuesr[   searchsortedgeometry_type_ids)r   ress     r3   	geom_typeGeometryArray.geom_type(  s-    !!$**-#BOO4Es$KLLr6   c                 `    U R                  SS9  [        R                  " U R                  5      $ )a  Return the area of the geometries in this array.

Raises a UserWarning if the CRS is geographic, as the area
calculation is not accurate in that case.

Note that the area is calculated in the units of the CRS.

Returns
-------
np.ndarray of float
    Area of the geometries.
   rN   )r   rk   areary   r   s    r3   r  GeometryArray.area-  s(     	!!Q!/||DJJ''r6   c                 `    U R                  SS9  [        R                  " U R                  5      $ )Nr  rN   )r   rk   lengthry   r   s    r3   r  GeometryArray.length>  s&    !!Q!/~~djj))r6   c                 B    [         R                  " U R                  5      $ r8   )rk   get_num_coordinatesry   r   s    r3   count_coordinatesGeometryArray.count_coordinatesC  s    **4::66r6   c                 B    [         R                  " U R                  5      $ r8   )rk   get_num_geometriesry   r   s    r3   count_geometriesGeometryArray.count_geometriesF  s    ))$**55r6   c                 B    [         R                  " U R                  5      $ r8   )rk   get_num_interior_ringsry   r   s    r3   count_interior_rings"GeometryArray.count_interior_ringsI  s    --djj99r6   c                 B    [         R                  " U R                  5      $ r8   )rk   get_precisionry   r   s    r3   r  GeometryArray.get_precisionL  s    $$TZZ00r6   c                 @    [         R                  " U R                  US9$ )N)index)rk   get_geometryry   )r   r!  s     r3   r"  GeometryArray.get_geometryO  s    ##DJJe<<r6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   boundaryry   rE   r   s    r3   r%  GeometryArray.boundaryV  s"    W--djj9txxHHr6   c                     U R                  SS9  [        [        R                  " U R                  5      U R
                  S9$ )Nr  rN   rD   )r   r9   rk   centroidry   rE   r   s    r3   r(  GeometryArray.centroidZ  s3    !!Q!/W--djj9txxHHr6   c                 @    [         R                  " U R                  XS9$ )N)ratioallow_holes)rk   concave_hullry   )r   r+  r,  s      r3   r-  GeometryArray.concave_hull_  s    ##DJJeUUr6   c                     [         (       d  [        S5      e[        [        R                  " U R
                  5      U R                  S9$ )Nz7'constrained_delaunay_triangles' requires shapely>=2.1.rD   )r   r   r9   rk   constrained_delaunay_trianglesry   rE   r   s    r3   r0  ,GeometryArray.constrained_delaunay_trianglesb  s8    }WXX224::>DHH
 	
r6   c                 f    [        [        R                  " U R                  5      U R                  S9$ )z7Return the convex hull of the geometries in this array.rD   )r9   rk   convex_hullry   rE   r   s    r3   r3  GeometryArray.convex_hullj  s$     W00<$((KKr6   c                 f    [        [        R                  " U R                  5      U R                  S9$ )z4Return the envelope of the geometries in this array.rD   )r9   rk   envelopery   rE   r   s    r3   r6  GeometryArray.envelopeo  s$     W--djj9txxHHr6   c                 f    [        [        R                  " U R                  5      U R                  S9$ )zEReturn the minimum rotated rectangle of the geometries in this array.rD   )r9   rk   oriented_envelopery   rE   r   s    r3   minimum_rotated_rectangle'GeometryArray.minimum_rotated_rectanglet  "    W66tzzBQQr6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   get_exterior_ringry   rE   r   s    r3   exteriorGeometryArray.exteriorx  r<  r6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   extract_unique_pointsry   rE   r   s    r3   rB  #GeometryArray.extract_unique_points|  s"    W::4::FDHHUUr6   c           
      j    [        [        R                  " U R                  UUUUS9U R                  S9$ )N)	quad_segs
join_stylemitre_limitrD   )r9   rk   offset_curvery   rE   )r   distancerE  rF  rG  s        r3   rH  GeometryArray.offset_curve  s9      

#%' 	
 		
r6   c                 6   Sn/ nU R                    HB  n[        USS 5      nUb  UR                  [        U5      5        M/  SnUR                  S 5        MD     U(       a  [        R
                  " SSS9  [        R                  " [        U5      [        S9nX%S S & U$ )NF	interiorsTzUOnly Polygon objects have interior rings. For other geometry types, None is returned.r   rN   r#   )
ry   getattrrn   r   rS   rT   r[   rh   rQ   ri   )r   has_non_polyinner_ringsrb   interior_ring_seqrr   s         r3   rL  GeometryArray.interiors  s     JJD 'k4 @ ,""4(9#:;  $""4(  MM4 xxK(7Qr6   c                 d    [        [        R                  " U R                  US9U R                  S9$ )N	tolerancerD   )r9   rk   remove_repeated_pointsry   rE   r   rT  s     r3   rU  $GeometryArray.remove_repeated_points  s*    **4::K
 	
r6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   point_on_surfacery   rE   r   s    r3   representative_point"GeometryArray.representative_point  s"    W55djjAtxxPPr6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   minimum_bounding_circlery   rE   r   s    r3   r]  %GeometryArray.minimum_bounding_circle  s"    W<<TZZHdhhWWr6   c                     [         (       d  [        S5      e[        [        R                  " U R
                  US9U R                  S9$ )Nz1'maximum_inscribed_circle' requires shapely>=2.1.rS  rD   )r   r   r9   rk   maximum_inscribed_circlery   rE   rV  s     r3   r`  &GeometryArray.maximum_inscribed_circle  s;    }QRR,,TZZ9M
 	
r6   c                 B    [         R                  " U R                  5      $ r8   )rk   minimum_bounding_radiusry   r   s    r3   rc  %GeometryArray.minimum_bounding_radius  s    ..tzz::r6   c                 B    [         R                  " U R                  5      $ r8   )rk   minimum_clearancery   r   s    r3   rf  GeometryArray.minimum_clearance  s    ((44r6   c                     [         (       d  [        S5      e[        [        R                  " U R
                  5      U R                  S9$ )Nz/'minimum_clearance_line' requires shapely>=2.1.rD   )r   r   r9   rk   minimum_clearance_linery   rE   r   s    r3   ri  $GeometryArray.minimum_clearance_line  s3    }OPPW;;DJJGTXXVVr6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   	normalizery   rE   r   s    r3   rl  GeometryArray.normalize  s"    W..tzz:IIr6   Fc                     [         (       d  [        S5      e[        [        R                  " U R
                  US9U R                  S9$ )Nz('orient_polygons' requires shapely>=2.1.)exterior_cwrD   )r   r   r9   rk   orient_polygonsry   rE   )r   ro  s     r3   rp  GeometryArray.orient_polygons  s:    }HII##DJJKHdhh
 	
r6   c                     0 n[         (       a	  XS'   X#S'   OUS:w  a  [        S5      e[        [        R                  " U R
                  40 UD6U R                  S9$ )Nmethodkeep_collapsedlineworkz:Only the 'linework' method is supported for shapely < 2.1.rD   )r   rx   r9   rk   
make_validry   rE   )r   rs  rt  r   s       r3   rv  GeometryArray.make_valid  s\    =%8'5#$# P  W//

EfE488TTr6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   reversery   rE   r   s    r3   ry  GeometryArray.reverse  s     W__TZZ8dhhGGr6   c                 h    [        [        R                  " U R                  U5      U R                  S9$ r   )r9   rk   
segmentizery   rE   )r   max_segment_lengths     r3   r|  GeometryArray.segmentize  s+    tzz+=>
 	
r6   c                 f    [        [        R                  " U R                  5      U R                  S9$ r   )r9   rk   force_2dry   rE   r   s    r3   r  GeometryArray.force_2d  s"    W--djj9txxHHr6   c                 d    [        [        R                  " U R                  US9U R                  S9$ )N)r   rD   )r9   rk   force_3dry   rE   )r   r   s     r3   r  GeometryArray.force_3d  s$    W--djjA>DHHMMr6   c                 d    [        [        R                  " U R                  XS9U R                  S9$ )N	include_zrD   )r9   rk   	transformry   rE   )r   transformationr  s      r3   r  GeometryArray.transform  s*    djj.N
 	
r6   c                 d    [        [        R                  " U R                  US9U R                  S9$ )N)directedrD   )r9   rk   
line_mergery   rE   )r   r  s     r3   r  GeometryArray.line_merge  s)    tzzH=488
 	
r6   c                 d    [        [        R                  " U R                  XS9U R                  S9$ )N)	grid_sizemoderD   )r9   rk   set_precisionry   rE   )r   r  r  s      r3   r  GeometryArray.set_precision  s*    !!$**	M
 	
r6   c                 6   [        U[        5      (       ac  [        U5      [        U5      :w  a%  S[        U5       S[        U5       3n[        U5      e[	        X5      (       d
  [        XSS9  UR                  n[        [        U 5      " UR                  U40 UD6$ )Nz&Lengths of inputs do not match. Left: z	, Right:    rN   )	r+   r9   rQ   rx   rI   rX   ry   rM  rk   )oprF   rG   r   msgs        r3   _binary_methodGeometryArray._binary_method  s    e]++4yCJ& YKyU>  !o%d**"41=KKEw#DJJ@@@r6   c                 &    U R                  SX5      $ )Ncoversr  r   others     r3   r  GeometryArray.covers      ""8T99r6   c                 &    U R                  SX5      $ )N
covered_byr  r  s     r3   r  GeometryArray.covered_by      ""<==r6   c                 &    U R                  SX5      $ )Ncontainsr  r  s     r3   r  GeometryArray.contains      "":t;;r6   c                 &    U R                  SX5      $ )Ncontains_properlyr  r  s     r3   r  GeometryArray.contains_properly  s    ""#6DDr6   c                 &    U R                  SX5      $ )Ncrossesr  r  s     r3   r  GeometryArray.crosses      ""9d::r6   c                 &    U R                  SX5      $ )Ndisjointr  r  s     r3   r  GeometryArray.disjoint  r  r6   c                 &    U R                  SX5      $ )Nequalsr  r  s     r3   geom_equalsGeometryArray.geom_equals   r  r6   c                 &    U R                  SX5      $ )N
intersectsr  r  s     r3   r  GeometryArray.intersects#  r  r6   c                 &    U R                  SX5      $ )Noverlapsr  r  s     r3   r  GeometryArray.overlaps&  r  r6   c                 &    U R                  SX5      $ )Ntouchesr  r  s     r3   r  GeometryArray.touches)  r  r6   c                 &    U R                  SX5      $ )Nwithinr  r  s     r3   r  GeometryArray.within,  r  r6   c                 B    U R                  SS9  U R                  SXUS9$ )N   rN   dwithin)rI  r   r  )r   r  rI  s      r3   r  GeometryArray.dwithin/  s+    !!Q!/""9dH"MMr6   c                 $    U R                  SXUS9$ )Nequals_exactrS  r  r   r  rT  s      r3   geom_equals_exactGeometryArray.geom_equals_exact3  s    "">4)"TTr6   c                 R    [         (       d  [        S5      eU R                  SX5      $ )Nz.'geom_equals_identical' requires shapely>=2.1.equals_identical)r   r   r  r  s     r3   geom_equals_identical#GeometryArray.geom_equals_identical6  s'    }NOO""#5tCCr6   c           	      j    [        [        R                  " U R                  XX45      U R                  S9$ r   )r9   rk   clip_by_rectry   rE   )r   xminyminxmaxymaxs        r3   r  GeometryArray.clip_by_rect?  s+      TD$((
 	
r6   c                 J    [        U R                  SX5      U R                  S9$ )N
differencerD   r9   r  rE   r  s     r3   r  GeometryArray.differenceD  s%    d:
 	
r6   c                 J    [        U R                  SX5      U R                  S9$ )NintersectionrD   r  r  s     r3   r  GeometryArray.intersectionI  %    <$((
 	
r6   c                 J    [        U R                  SX5      U R                  S9$ )Nsymmetric_differencerD   r  r  s     r3   r  "GeometryArray.symmetric_differenceN  s&     6D$((
 	
r6   c                 J    [        U R                  SX5      U R                  S9$ )NunionrD   r  r  s     r3   r  GeometryArray.unionS  s     T00$FDHHUUr6   c                 J    [        U R                  SX5      U R                  S9$ )Nshortest_linerD   r  r  s     r3   r  GeometryArray.shortest_lineV  s%    =488
 	
r6   c           	      H    [        U R                  SXUS9U R                  S9$ )NsnaprS  rD   r  r  s      r3   r  GeometryArray.snap[  s*    yItxx
 	
r6   c                 J    [        U R                  SX5      U R                  S9$ )Nshared_pathsrD   r  r  s     r3   r  GeometryArray.shared_paths`  r  r6   c                 D    U R                  SS9  U R                  SX5      $ )Nr  rN   rI  r  r  s     r3   rI  GeometryArray.distancei  s&    !!Q!/"":t;;r6   c                 H    U R                  SS9  U R                  " SX40 UD6$ )Nr  rN   hausdorff_distancer  r   r  r   s      r3   r   GeometryArray.hausdorff_distancem  s,    !!Q!/""#7OOOr6   c                 H    U R                  SS9  U R                  " SX40 UD6$ )Nr  rN   frechet_distancer  r  s      r3   r  GeometryArray.frechet_distanceq  s,    !!Q!/""#5tMfMMr6   c                     [        U[        [        -  5      (       a  US:X  d  U R                  SS9  [	        [
        R                  " U R                  U4SU0UD6U R                  S9$ )Nr   r  rN   rE  rD   )	r+   intrZ   r   r9   rk   bufferry   rE   )r   rI  
resolutionr   s       r3   r  GeometryArray.bufferu  sZ    8S5[11h!m%%%3NN4::xP:PP
 	
r6   c                     U R                  SS9  [        [        R                  " U R                  XS9U R
                  S9$ )Nr  rN   
normalizedrD   )r   r9   rk   line_interpolate_pointry   rE   )r   rI  r  s      r3   interpolateGeometryArray.interpolate}  s;    !!Q!/**4::xW
 	
r6   c                 d    [        [        R                  " U R                  XS9U R                  S9$ )N)preserve_topologyrD   )r9   rk   simplifyry   rE   )r   rT  r  s      r3   r  GeometryArray.simplify  s/    

I 	
 	
r6   c                     [         (       a  [        (       d  [        S5      e[        [        R
                  " U R                  XS9U R                  S9$ )Nz9'simplify_coverage' requires shapely>=2.1 and GEOS>=3.12.)simplify_boundaryrD   )r   r	   r   r9   rk   coverage_simplifyry   rE   )r   rT  r  s      r3   simplify_coverageGeometryArray.simplify_coverage  sJ    ++K  %%

I 	
 	
r6   c                     [        U[        5      (       a  UR                  n[        R                  " U R                  XS9$ )Nr  )r+   r9   ry   rk   line_locate_point)r   r  r  s      r3   projectGeometryArray.project  s/    e]++KKE((URRr6   c                     [        U[        5      (       a  UR                  n[        R                  " U R                  U5      $ r8   )r+   r9   ry   rk   relater  s     r3   r  GeometryArray.relate  s-    e]++KKE~~djj%00r6   c                     [        U[        5      (       a  UR                  n[        R                  " U R                  X5      $ r8   )r+   r9   ry   rk   relate_pattern)r   r  patterns      r3   r  GeometryArray.relate_pattern  s/    e]++KKE%%djj%AAr6   c                 V    [         R                  " S[        SS9  U R                  5       $ )NzNThe 'unary_union' attribute is deprecated, use the 'union_all' method instead.r   rN   )rS   rT   DeprecationWarning	union_allr   s    r3   unary_unionGeometryArray.unary_union  s(    2		
 ~~r6   c                 t   US:w  a  Ub  [        SU S35      eUS:X  a   [        R                  " U R                  5      $ US:X  a  [        R                  " U R                  US9$ US:X  aA  [
        (       a  [        (       d  [        S5      e[        R                  " U R                  5      $ [        SU S	35      e)
Nunaryz'grid_size is not supported for method 'z'.coverage)r  disjoint_subsetz=Method 'disjoin_subset' requires shapely>=2.1 and GEOS>=3.12.zMethod 'z?' not recognized. Use 'coverage', 'unary' or 'disjoint_subset'.)	rx   rk   coverage_union_allry   r  r   r	   r   disjoint_subset_union_all)r   rs  r  s      r3   r  GeometryArray.union_all  s    W!6FvhbQRRZ--djj99w$$TZZ9EE((!Mkk!S  44TZZ@@6( #% % r6   c                 B    [         R                  " U R                  5      $ r8   )rk   intersection_allry   r   s    r3   r$  GeometryArray.intersection_all  s    ''

33r6   c                     / nU HO  nUb  UR                   (       a  UnO$[        [        R                  U 5      " U/UQ70 UD6nUR	                  U5        MQ     [
        R                  " [        U5      [        S9nXGS S & U$ )Nr#   )	r   rM  rk   affinityrn   r[   rh   rQ   ri   )r  rF   argsr   rt   rb   r  rr   s           r3   _affinity_methodGeometryArray._affinity_method  sq     D|t}}g..3DJ4J6JJJsO  xxD	0Qr6   c                 `    [        U R                  SU R                  U5      U R                  S9$ )Naffine_transformrD   r9   r)  ry   rE   )r   matrixs     r3   r,  GeometryArray.affine_transform  s-    !!"4djj&I
 	
r6   c           	      b    [        U R                  SU R                  XU5      U R                  S9$ )N	translaterD   r-  )r   xoffyoffzoffs       r3   r1  GeometryArray.translate  s.    !!+tzz4tL
 	
r6   c           
      ^    [        U R                  SU R                  XUS9U R                  S9$ )Nrotateoriginuse_radiansrD   r-  )r   angler9  r:  s       r3   r7  GeometryArray.rotate  s8    !!$**e "  	
 	
r6   c                 ^    [        U R                  SU R                  XX4S9U R                  S9$ )Nscale)r9  rD   r-  )r   xfactyfactzfactr9  s        r3   r>  GeometryArray.scale  s8    !!U5 "  	
 	
r6   c                 ^    [        U R                  SU R                  XX4S9U R                  S9$ )Nskewr8  rD   r-  )r   xsysr9  r:  s        r3   rD  GeometryArray.skew  s8    !!

B6 "  	
 	
r6   c                 h   SSK Jn  U R                  c  [        S5      eUb  UR	                  U5      nO Ub  UR                  U5      nO[        S5      eU R                  R                  U5      (       a  U $ [        U R                  USS9n[        U R                  UR                  5      n[        XQS9$ )u  Transform all geometries to a different coordinate reference system.

Transform all geometries in a GeometryArray to a different coordinate
reference system.  The ``crs`` attribute on the current GeometryArray must
be set.  Either ``crs`` or ``epsg`` may be specified for output.

This method will transform all points in all objects.  It has no notion
of projecting entire geometries.  All segments joining points are
assumed to be lines in the current projection, not geodesics.  Objects
crossing the dateline (or other projection boundary) will have
undesirable behavior.

Parameters
----------
crs : pyproj.CRS, optional if `epsg` is specified
    The value can be anything accepted
    by :meth:`pyproj.CRS.from_user_input() <pyproj.crs.CRS.from_user_input>`,
    such as an authority string (eg "EPSG:4326") or a WKT string.
epsg : int, optional if `crs` is specified
    EPSG code specifying output projection.

Returns
-------
GeometryArray

Examples
--------
>>> from shapely.geometry import Point
>>> from geopandas.array import from_shapely, to_wkt
>>> a = from_shapely([Point(1, 1), Point(2, 2), Point(3, 3)], crs=4326)
>>> to_wkt(a)
array(['POINT (1 1)', 'POINT (2 2)', 'POINT (3 3)'], dtype=object)
>>> a.crs  # doctest: +SKIP
<Geographic 2D CRS: EPSG:4326>
Name: WGS 84
Axis Info [ellipsoidal]:
- Lat[north]: Geodetic latitude (degree)
- Lon[east]: Geodetic longitude (degree)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich

>>> a = a.to_crs(3857)
>>> to_wkt(a)
array(['POINT (111319.490793 111325.142866)',
       'POINT (222638.981587 222684.208506)',
       'POINT (333958.47238 334111.171402)'], dtype=object)
>>> a.crs  # doctest: +SKIP
<Projected CRS: EPSG:3857>
Name: WGS 84 / Pseudo-Mercator
Axis Info [cartesian]:
- X[east]: Easting (metre)
- Y[north]: Northing (metre)
Area of Use:
- name: World - 85°S to 85°N
- bounds: (-180.0, -85.06, 180.0, 85.06)
Coordinate Operation:
- name: Popular Visualisation Pseudo-Mercator
- method: Popular Visualisation Pseudo Mercator
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich

r   r   zICannot transform naive geometries.  Please set a crs on the object first.zMust pass either crs or epsg.T	always_xyrD   )r   r   rE   rx   r   	from_epsgis_exact_sameTransformerFromCRSr  ry   r9   )r   rE   epsgr   transformernew_datas         r3   to_crsGeometryArray.to_crs  s    J 	888  ?%%c*C--%C<== 88!!#&&K(3$GTZZ)>)>?X//r6   c           
         SSK Jn  SSKJn  SSKJn  U R                  (       d  [        S5      eU R                  u  pVpxU R                  R                  (       a/  [        R                  " XW/5      n	[        R                  " Xh/5      n
O[        U R                  SSS9nUR                  XVXx5      u  pVpx[        R                  " Xh/5      n
XW:  a(  US	-  n[        R                  " XW/5      n	U	S
-   S	-  S
-
  n	O[        R                  " XW/5      n	U" UU" U	U
U	U
S9S9n UR                  US   R                  5      $ ! [          a    [        S5      ef = f)u}  Return the estimated UTM CRS based on the bounds of the dataset.

.. versionadded:: 0.9

.. note:: Requires pyproj 3+

Parameters
----------
datum_name : str, optional
    The name of the datum to use in the query. Default is WGS 84.

Returns
-------
pyproj.CRS

Examples
--------
>>> import geodatasets
>>> df = geopandas.read_file(
...     geodatasets.get_path("geoda.chicago_commpop")
... )
>>> df.geometry.values.estimate_utm_crs()  # doctest: +SKIP
<Derived Projected CRS: EPSG:32616>
Name: WGS 84 / UTM zone 16N
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: Between 90°W and 84°W, northern hemisphere between equator and 84°N,...
- bounds: (-90.0, 0.0, -84.0, 84.0)
Coordinate Operation:
- name: UTM zone 16N
- method: Transverse Mercator
Datum: World Geodetic System 1984 ensemble
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
r   r   )AreaOfInterest)query_utm_crs_infoz$crs must be set to estimate UTM CRS.z	EPSG:4326TrI  ih     )west_lon_degreesouth_lat_degreeeast_lon_degreenorth_lat_degree)
datum_namearea_of_interestzUnable to determine UTM CRS)r   r   
pyproj.aoirT  pyproj.databaserU  rE   RuntimeErrortotal_boundsr   r[   meanrM  transform_boundsrK  code
IndexError)r   r[  r   rT  rU  minxminymaxxmaxyx_centery_centerrO  utm_crs_lists                r3   estimate_utm_crsGeometryArray.estimate_utm_crs_  s;   N 	-6xxEFF!%!2!2D88!!ww|,Hww|,H -TXX{dSK%0%A%AD&"D ww|,H{ 77D<0%^s2c977D<0)!+ (!) (!)	
	>==a!5!566 	><==	>s   D: :Ec                    U R                   U R                  5       )    S:H  R                  5       (       a  U R                  nUR	                  5       (       aR  U) n[
        R                  " U[        [
        R                  S9n[        R                  " U R                  U   5      X2'   U$ [        R                  " U R                  5      $ Sn[        U5      e)z9Return the x location of point geometries in a GeoSeries.r   r$   
fill_valuez5x attribute access only provided for Point geometries)r  r`   rm   r   anyr[   	full_likerZ   nanrk   get_xry   rx   r   rh   nonemptycoordsmessages        r3   r   GeometryArray.x       NNDIIK<(G388::MMEyy{{!6heO#*==H1E#F }}TZZ00MGW%%r6   c                    U R                   U R                  5       )    S:H  R                  5       (       a  U R                  nUR	                  5       (       aR  U) n[
        R                  " U[        [
        R                  S9n[        R                  " U R                  U   5      X2'   U$ [        R                  " U R                  5      $ Sn[        U5      e)z9Return the y location of point geometries in a GeoSeries.r   ro  z5y attribute access only provided for Point geometries)r  r`   rm   r   rq  r[   rr  rZ   rs  rk   get_yry   rx   ru  s        r3   r   GeometryArray.y  rz  r6   c                    U R                   U R                  5       )    S:H  R                  5       (       a  U R                  nUR	                  5       (       aR  U) n[
        R                  " U[        [
        R                  S9n[        R                  " U R                  U   5      X2'   U$ [        R                  " U R                  5      $ Sn[        U5      e)z9Return the z location of point geometries in a GeoSeries.r   ro  z5z attribute access only provided for Point geometries)r  r`   rm   r   rq  r[   rr  rZ   rs  rk   get_zry   rx   ru  s        r3   r   GeometryArray.z  rz  r6   c                    [         (       d  [        S5      eU R                  U R                  5       )    S:H  R	                  5       (       a  U R
                  nUR                  5       (       aR  U) n[        R                  " U[        [        R                  S9n[        R                  " U R                  U   5      X2'   U$ [        R                  " U R                  5      $ Sn[        U5      e)z;Return the m coordinate of point geometries in a GeoSeries.z'm' requires shapely>=2.1.r   ro  z5m attribute access only provided for Point geometries)r   r   r  r`   rm   r   rq  r[   rr  rZ   rs  rk   get_mry   rx   ru  s        r3   mGeometryArray.m  s     }:;;NNDIIK<(G388::MMEyy{{!6heO#*==H1E#F }}TZZ00MGW%%r6   c                 B    [         R                  " U R                  5      $ r8   )rk   boundsry   r   s    r3   r  GeometryArray.bounds  r   r6   c                    [        U 5      S:X  aR  [        R                  " [        R                  [        R                  [        R                  [        R                  /5      $ U R                  n[
        R                  " 5          [
        R                  " SS[        5        [        R                  " [        R                  " US S 2S4   5      [        R                  " US S 2S4   5      [        R                  " US S 2S4   5      [        R                  " US S 2S4   5      45      sS S S 5        $ ! , (       d  f       g = f)Nr   ignorezAll-NaN slice encounteredr   r      )rQ   r[   rq   rs  r  rS   catch_warningsfilterwarningsRuntimeWarningnanminnanmax)r   bs     r3   r`  GeometryArray.total_bounds  s    t9> 88RVVRVVRVVRVV<==KK$$&##6 88IIa1g&IIa1g&IIa1g&IIa1g&	 '&&s   B"D//
D=c                 .    U R                   R                  $ r8   )ry   sizer   s    r3   r  GeometryArray.size  s    zzr6   c                     U R                   4$ r8   )r  r   s    r3   rp   GeometryArray.shape  s    		|r6   c                 ,    [        U R                  5      $ r8   )rQ   rp   r   s    r3   r   GeometryArray.ndim  s    4::r6   c                 Z    [        U R                  R                  5       U R                  S9$ r   )r9   ry   copyr   )r   r(  r   s      r3   r  GeometryArray.copy"  s    TZZ__.DII>>r6   c                 &   SSK Jn  U(       a<  Ub  [        R                  " U5      (       a  S nO[	        U5      (       d  [        S5      eU" U R                  XUS9nU(       a  Uc  S U[        R                  " U5      ) '   [        XPR                  S9$ )Nr   )takez&provide geometry or None as fill value)
allow_fillrp  rD   )pandas.api.extensionsr  r]   r`   rc   r-   ry   rk   rl   r9   rE   )r   indicesr  rp  r  results         r3   r  GeometryArray.take&  sy    .!RWWZ%8%8!
(44 HIIdjj'ZX*,6:FG**6223V22r6   c                 n   > [         (       a  [        (       d  Ub  X5S'   OX5S'   [        TU ]  " SXUS.UD6$ )N
limit_area)rs  limitr  r<   )r   r   super_pad_or_backfill)r   rs  r  r  r  r   r   s         r3   r  GeometryArray._pad_or_backfill5  sB     <% (2|$#-< w'XvXQWXXr6   c                 6   Ub  [        S5      eU R                  5       nU(       a  U R                  5       nOU nUR                  5       (       d  U$ Ub;  U[	        U 5      :  a,  UR                  5       U:  nUR                  5       (       a  SXW'   [        U5      (       a  S/nOP[        U5      (       a  U/nO<[        U[        5      (       a  X   nO"[        S[        U5      R                  < 35      e[        R                  " U[        S9nXR                  U'   U$ )a  
Fill NA values with geometry (or geometries) or using the specified method.

Parameters
----------
value : shapely geometry object or GeometryArray
    If a geometry value is passed it is used to fill all missing values.
    Alternatively, an GeometryArray 'value' can be given. It's expected
    that the GeometryArray has the same length as 'self'.

method : {'backfill', 'bfill', 'pad', 'ffill', None}, default None
    Method to use for filling holes in reindexed Series
    pad / ffill: propagate last valid observation forward to next valid
    backfill / bfill: use NEXT valid observation to fill gap

limit : int, default None
    The maximum number of entries where NA values will be filled.

copy : bool, default True
    Whether to make a copy of the data before filling. If False, then
    the original should be modified and no new memory should be allocated.

Returns
-------
GeometryArray
Nz)fillna with a method is not yet supportedFzT'value' parameter must be None, a scalar geometry, or a GeoSeries, but you passed a r#   )NotImplementedErrorr`   r  rq  rQ   cumsumrc   r+   r9   r-   r.   r0   r[   r   ri   ry   )	r   r_   rs  r  r  mask
new_valuesmodify	value_arrs	            r3   fillnaGeometryArray.fillnaA  s    6 %&QRRyy{JJxxzzT!2[[]U*Fzz||$;;FE ''GE}--KE$$(K$8$8#;=  JJuF3	!*r6   c                 d   [        U[        5      (       a  U(       a  U R                  5       $ U $ [        R                  R
                  R                  U5      (       a  [        R                  R
                  R                  U5      (       dw  [        U 5      n[        R                  R
                  R                  U5      n[        U[        R                  5      (       a  [        R                  " X4S9$ UR                  USS9$ U(       d  [        R                  " XS9$ [        R                  " XUS9$ )az  
Cast to a NumPy array with 'dtype'.

Parameters
----------
dtype : str or dtype
    Typecode or data-type to which the array is cast.
copy : bool, default True
    Whether to copy the data, even if not necessary. If False,
    a copy is made only if the old dtype does not match the
    new dtype.

Returns
-------
array : ndarray
    NumPy ndarray with 'dtype' for its dtype.
r#   F)r  r$   r  )r+   r&   r  r]   r   typesis_string_dtypeis_object_dtyper   pandas_dtypeStringDtyperq   rj   r[   r   )r   r$   r  string_valuespd_dtypes        r3   rj   GeometryArray.astype}  s    $ e]++yy{"VV\\))%009U9U:
 :
 #4LMvv||007H(BNN33xx>> ''E'::
 zz$44xx==r6   c                 B    [         R                  " U R                  5      $ )z8Boolean NumPy array indicating if each value is missing.)rk   
is_missingry   r   s    r3   r`   GeometryArray.isna  s    !!$**--r6   dropnac           	          [        U 5      nSSKJnJn  U" U5      R	                  US9nU" [        [        R                  " UR                  R                  5       SUR                  5      5      5      Ul        U$ )z
Compute a histogram of the counts of non-null values.

Parameters
----------
dropna : bool, default True
    Don't include counts of NaN

Returns
-------
pd.Series
r   )Indexr   )r  N)
r   pandasr  r   value_countsr   r[   wherer!  r`   )r   r  r   r  r   r  s         r3   r  GeometryArray.value_counts  sb    $ (,,F,;
 RXXfll//14FG
 r6   c                 &    SSK Jn  U" U 5      u  p#U$ )zWCompute the ExtensionArray of unique values.

Returns
-------
uniques : ExtensionArray
r   )	factorize)r  r  )r   r  _uniquess       r3   uniqueGeometryArray.unique  s     	%t_
r6   c                 .    U R                   R                  $ r8   )ry   nbytesr   s    r3   r  GeometryArray.nbytes  s    zz   r6   c                 H   > [         TU ]  X5      nU R                  Ul        U$ )a  
Shift values by desired number.

Newly introduced missing values are filled with
``self.dtype.na_value``.

Parameters
----------
periods : int, default 1
    The number of periods to shift. Negative values are allowed
    for shifting backwards.

fill_value : object, optional (default None)
    The scalar value to use for newly introduced missing values.
    The default is ``self.dtype.na_value``.

Returns
-------
GeometryArray
    Shifted.

Notes
-----
If ``self`` is empty or ``periods`` is 0, a copy of ``self`` is
returned.

If ``periods > len(self)``, then an array of size
len(self) is returned, with all values filled with
``self.dtype.na_value``.
)r  shiftrE   )r   periodsrp  shiftedr   s       r3   r  GeometryArray.shift  s#    > '-4hhr6   c                 H    [        U[        5      (       a  U/n[        U5      $ )a  
Construct a new ExtensionArray from a sequence of scalars.

Parameters
----------
scalars : Sequence
    Each element will be an instance of the scalar type for this
    array, ``cls.dtype.type``.
dtype : dtype, optional
    Construct for this particular dtype. This should be a Dtype
    compatible with the ExtensionArray.
copy : boolean, default False
    If True, copy the underlying data.

Returns
-------
ExtensionArray
)r+   r   ru   )r1   scalarsr$   r  s       r3   _from_sequenceGeometryArray._from_sequence   s#    * g|,,iGG$$r6   r  c                    [        U5      $ )a  
Construct a new ExtensionArray from a sequence of strings.

Parameters
----------
strings : Sequence
    Each element will be an instance of the scalar type for this
    array, ``cls.dtype.type``.
dtype : dtype, optional
    Construct for this particular dtype. This should be a Dtype
    compatible with the ExtensionArray.
copy : bool, default False
    If True, copy the underlying data.

Returns
-------
ExtensionArray
)r   )r1   stringsr$   r  s       r3   _from_sequence_of_strings'GeometryArray._from_sequence_of_strings  s    *   r6   c                      [        U 5      nUS4$ )a  Return an array and missing value suitable for factorization.

Returns
-------
values : ndarray
    An array suitable for factorization. This should maintain order
    and be a supported dtype (Float64, Int64, UInt64, String, Object).
    By default, the extension array is cast to object dtype.
na_value : object
    The value in `values` to consider missing. This will be treated
    as NA in the factorization routines, so it will be coded as
    `na_sentinal` and not included in `uniques`. By default,
    ``np.nan`` is used.
N)r   )r   valss     r3   _values_for_factorize#GeometryArray._values_for_factorize0  s      d|Tzr6   c                 (    [        XR                  S9$ )a$  
Reconstruct an ExtensionArray after factorization.

Parameters
----------
values : ndarray
    An integer ndarray with the factorized values.
original : ExtensionArray
    The original ExtensionArray that factorize was called on.

See Also
--------
pandas.factorize
ExtensionArray.factorize
rD   )r   rE   )r1   r   originals      r3   _from_factorizedGeometryArray._from_factorizedC  s    " LL11r6   c                 z   SSK Jn  U R                  S:X  a  [        R                  " / SS9$ U R
                  nUR                  5       nU R                  5       U-  nUR                  5       (       ah  U R                  5       n[        R                  " U) 5      S   nUR                  (       a  XS      nO [        R                  R                  SS5      nXuU'   OU nU(       aG  UR                  nUS   US   -
  S-  n	US   US   -
  S-  n
U[        R                  " U	* U
* X/5      -  nOS	nU" XXS
9nU(       a  SX'   U$ )zReturn values for sorting.

Returns
-------
ndarray
    The transformed values should maintain the ordering between values
    within the array.

See Also
--------
ExtensionArray.argsort
r   )_hilbert_distanceuint32r#   r   g{Gz?r  r   N)r`  )geopandas.tools.hilbert_curver  r  r[   rq   r   rq  r`   r  nonzerork   r(   r   r`  )r   r  
mask_empty	has_emptyr  rz   r  rb   r`  r2  r3  	distancess               r3   _values_for_argsort!GeometryArray._values_for_argsortV  s-    	D99>88Bh//]]
NN$	yy{Z'88:: IIKEjj$'*G||AJ' ''--a3$KE !--L Ol1o5=D Ol1o5=DBHHtedUD%?@@LL%eG	 %&I!r6   skipnareturnc                     [        S5      eNz%geometries have no minimum or maximumr-   r   r  s     r3   argminGeometryArray.argmin      ?@@r6   c                     [        S5      er  r  r  s     r3   argmaxGeometryArray.argmax  r  r6   c                 (  ^ U(       a  SSK nUR                  R                  mTc  U R                  (       a!  U R                  R                  (       a  SmOSmO[
        R                  " 5          [
        R                  " S[        S9  X R                  5       )    SS R                  u  p4pVSSS5        SWs=::  a  S	::  a6  O  O3SWs=::  a  S	::  a&  O  O#S
Ws=::  a  S::  a  O  OS
Ws=::  a  S::  a  O  OSmOSmU4S j$ [        $ ! , (       d  f       N_= f)a  Return a formatting function for scalar values.

This is used in the default '__repr__'. The returned formatting
function receives instances of your scalar type.

Parameters
----------
boxed: bool, default False
    An indicated for whether or not your array is being printed
    within a Series, DataFrame, or Index (True), or just by
    itself (False). This may be useful if you want scalar values
    to appear differently within a Series versus on its own (e.g.
    quoted or not).

Returns
-------
Callable[[Any], str]
    A callable that gets instances of the scalar type and
    returns a string. By default, :func:`repr` is used
    when ``boxed=False`` and :func:`str` is used when
    ``boxed=True``.
r   Nr  r  r  )category
   iLrV  iZ   c                 .   > [         R                  " U TS9$ )N)rounding_precision)rk   r   )rb   	precisions    r3   <lambda>*GeometryArray._formatter.<locals>.<lambda>  s    t	 Rr6   )	geopandasoptionsdisplay_precisionrE   is_projectedrS   r  simplefilterr  r`   r`  repr)r   boxedr  r  r  r  r  r   s          @r3   
_formatterGeometryArray._formatter  s    . !));;I 88xx,,$%	$%	
 "002 --hP15yy{l1CCR1H1U1U.D 3 ,,!T0S0 D.B. D.B. %&	 %&	RR! 32s   -=D
Dc                     [         R                  " U Vs/ s H  o"R                  PM     sn5      n[        U[	        U5      S9$ s  snf )zuConcatenate multiple array.

Parameters
----------
to_concat : sequence of this type

Returns
-------
ExtensionArray
rD   )r[   concatenatery   r9   _get_common_crs)r1   	to_concatgarr   s       r3   _concat_same_typeGeometryArray._concat_same_type  s:     ~~)<)Bxx)<=Ty'ABB =s   Ac           	          US;   a  [        U R                  U5      " US9$ [        S[        U 5      R                   SU R
                   SU S35      e)N)rq  rm   )keepdimsr*   z' with dtype z does not support reduction ')rM  ry   r-   r.   r0   r$   )r   r/   r  r  r   s        r3   _reduceGeometryArray._reduce  s\     >!4::t,h??T
##$M$** >++/&3
 	
r6   c                     U(       a7  Ub  U[         R                  " S5      :X  a  U R                  R                  5       $ U R                  $ )zlReturn the data as a numpy array.

This is the numpy array interface.

Returns
-------
values : numpy array
ri   )r[   r$   ry   r  )r   r$   r  s      r3   	__array__GeometryArray.__array__  s6     U]erxx/A&A::??$$zzr6   c                   ^  U 4S jn[        U[        R                  [        R                  -  [        R                  -  5      (       a  [
        $ T nU" U5      n[        U5      [        U5      :w  a  [        S5      e[        XE5       VVs/ s H  u  pgU" Xg5      PM     nnn[        R                  " U[        S9nU$ s  snnf )Nc                    > [        U 5      (       dG  [        U [        5      (       d.  [        R                  R
                  R                  U 5      (       a  U nU$ U /[        T5      -  nU$ r8   )rc   r+   r   r]   r   r  is_list_likerQ   )paramovaluesr   s     r3   convert_values,GeometryArray._binop.<locals>.convert_values  sV    &u--5.11RVV\\5N5Nu5U5U N !'CI-Nr6   zLengths must match to comparer#   )r+   r]   r   r  r   NotImplementedrQ   rx   zipr[   r   r   )	r   r  r  r  lvaluesrvaluesar  r  s	   `        r3   _binopGeometryArray._binop  s    	 eRYY1BLL@AA!! 'w<3w<'<== '*'&;<&;FQr!x&;<jjD)
 =s   
B<c                 B    U R                  U[        R                  5      $ r8   )r&  operatoreqr  s     r3   __eq__GeometryArray.__eq__      {{5(++..r6   c                 B    U R                  U[        R                  5      $ r8   )r&  r)  ner  s     r3   __ne__GeometryArray.__ne__  r-  r6   c                    [        U5      (       a^  XR                  R                  L d'  [        XR                  R                  5      (       d  Uc  U R                  5       R                  5       $ gX:H  R                  5       $ )zReturn for `item in self`.F)r`   r$   r@   r+   r.   rq  )r   items     r3   __contains__GeometryArray.__contains__  sZ    ::

+++dJJOO44<yy{((!!##r6   )r   ry   r   r   rE   r8   )        )   roundg      @F)ru  T)r   )valid_output)   )T)r  N)r6  r6  r6  )centerF)      ?r=  r=  r<  )r6  r6  r<  FNN)zWGS 84)FN)NNT)NNNT)r   N)NF)TF)r0   r=   r>   r?   __doc__r&   r   r   propertyr   r   rE   setterr   r$   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r"  r%  r(  r-  r0  r3  r6  r:  r?  rB  rH  rL  rU  rZ  r]  r`  rc  rf  ri  rl  rp  rv  ry  r|  r  r  r  r  r  staticmethodr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rI  r  r  r  r  r  r
  r  r  r  r  r  r$  r)  r,  r1  r7  r>  rD  r   rQ  rl  r   r   r   r  r  r`  r  rp   r   r  r  r  r  rj   r`   r   r  r  r  r  rA   r  r  r  r  r  r  r  r  r
  r  r  r  r&  r+  r0  r4  rB   __classcell__)r   s   @r3   r9   r9   ;  s   
 _F(   ( (. 	 	 	ZZ $
  <#Z7(& , ,3PO , , - - + + - - * * ) ) ) ) M M ( (  * *76:1= I I I IV
 L L I IR R RV

  0
QX
;5W
J
UH
IN



 A A:><E;<:><;:NUD







V




<PN




S
1
B &4   




 Y0 Y0v P> P>l & & & & & & & &$ * *  0      ?3  9=
Y:x'>R. >
 ! !!N % %0 9=E ! !,& 2 2$9vAT AS AAT AS A5n C C
6//$ $r6   r9   c                 4   U  Vs/ s H6  oR                  5       R                  5       (       a  UR                  c  M4  UPM8     n n/ nU  H0  nUR                  U;  d  M  UR                  UR                  5        M2     U Vs/ s H	  oDc  M  UPM     nnU Vs/ s H  oDR                  PM     nn[        U5      S:X  a  g [        U5      S:X  a0  [        U5      S:w  a  [        R                  " SUS    S3SS9  US   $ [        SU S35      es  snf s  snf s  snf )	Nr   r   zJCRS not set for some of the concatenation inputs. Setting output's CRS as z$ (the single non-null crs provided).r   rN   z:Cannot determine common CRS for concatenation inputs, got zH. Use `to_crs()` to transform geometries to the same CRS before merging.)	r`   rm   rE   rn   r/   rQ   rS   rT   rx   )arr_seqr  
unique_crsrs   rE   crs_not_nonenamess          r3   r  r  #  s    $PGbGGIMMOOrGGP J77*$cgg&  $.A:CC:LA!-.#XXE.
<A
<Az?aMM++08* 566 	 A

DUG LQ 	Q / Q B.s   3DD D
DDc                 H   [         R                  " U 5      n[        R                  " U 5      n[         R                  " X)    SS9nU" US S 2S4   US S 2S4   5      n[         R
                  " X)    R                  5       [        R                  " U5      R                  5      X2) '   [         R                  " X   SS9nU" US S 2S4   US S 2S4   US S 2S4   5      n[         R
                  " X   R                  5       [        R                  " U5      R                  5      X2'   U$ )NFr  r   r   Tr   )	rk   r   r[   
empty_likeget_coordinatesset_coordinatesr  rq   T)rr   funcr   r  rw  new_coords_zcoords_zs          r3   r  r  C  s    MM$E]]4 F$$T&\UCFq!tfQTl3L,,VRXXl355F6N &&t{dCHAAAGL++BHH\244FM Mr6   r9  )r  r8   )Nraiser>  )@r   r   r)  rS   	functoolsr   numpyr[   r  r]   r  r   r   r   rk   shapely.affinityshapely.geometryshapely.opsshapely.wktshapely.geometry.baser   _compatr	   r
   r   r   r   r   r   r   r   r   from_crsrM  _namesPOLYGON_GEOM_TYPESLINE_GEOM_TYPESPOINT_GEOM_TYPESGeometryTyper_   r/   type_mappingr   keysr  rq   r   ri   r  r&   rI   rX   r`   rc   ru   r{   r   r   r   r   r   r9   r  r  )ps   0r3   <module>rc     sr                .  !"";#7#78 (".
  0 A\* 181E1EF1EA'1EF**,- xx\%8%8%: ;6J N *  '8,*''TQ24Q2+0;fe$N e$P/@[8 Gs   #E