a
    1$ef                    @   s   d dl mZ d dl Z d dlZd dlZd dlmZmZ d dlm	Z	m
Z
 d dlmZ ddlmZ ddlmZmZmZ d	d
 Zdd Zdd Zdd Zdd Zdd ZG dd deZdd ZG dd deZdS )    )warnN)	DataFrameSeries)box
MultiPoint)BaseGeometry   )_compat)GeometryArrayGeometryDtypepoints_from_xyc                 C   s   t t| ddtrdS dS dS )zh
    Check if the data is of geometry dtype.

    Does not include object array of shapely scalars.
    dtypeNTF)
isinstancegetattrr   )data r   J/var/www/html/django/DPS/env/lib/python3.9/site-packages/geopandas/base.pyis_geometry_type   s    r   c                 O   s   |j }t|tr\|r@|j|js@tddd ||j \}}n|j }t|j}t|j}n(t|t	rrt|j}nt
t|t|t|| |g|R i |}||jfS )Nz/The indices of the two GeoSeries are different.   
stacklevel)geometryr   GeoPandasBaseindexequalsr   alignr
   valuesr   	TypeErrortyper   )opthisotherr   argskwargsa_thisr   r   r   r   _delegate_binary_method   s     


r%   c                 C   s.   ddl m} t| |||\}}||||jdS )z>Binary operation on GeoSeries objects that returns a GeoSeriesr   	GeoSeriesr   crs)	geoseriesr'   r%   r)   )r   r    r!   r   r'   Zgeomsr   r   r   r   _binary_geo3   s    r+   c                 O   s,   t | |||g|R i |\}}t||dS )z;Binary operation on GeoSeries objects that returns a Seriesr   )r%   r   )r   r    r!   r   r"   r#   r   r   r   r   r   
_binary_op<   s     r-   c                 C   sP   t |jj}t|| }t|t r>ddlm} |||j|jdS t	||jdS d S )Nr   r&   r(   r,   )
r
   r   r   r   r   r*   r'   r   r)   r   )r   r    r$   r   r'   r   r   r   _delegate_propertyC   s    

r.   c                 O   s>   ddl m} t|jj}t|| |i |}|||j|jdS )z(Unary operation that returns a GeoSeriesr   r&   r(   )r*   r'   r
   r   r   r   r   r)   )r   r    r"   r#   r'   r$   r   r   r   r   _delegate_geo_methodO   s    r/   c                   @   s  e Zd Zedd Zedd Zejdd Zedd Zedd	 Zed
d Z	edd Z
edd Zedd Zedd Zedd Zedd Zedd ZdddZedd Zdd d!Zed"d# Zd$d% Zed&d' Zd(d) Zdd-d.Zed/d0 Zdd1d2Zd3d4 Zd5d6 Zd7d8 Zd9d: Zd;d< Zd=d> Z d?d@ Z!edAdB Z"edCdD Z#ddFdGZ$ddHdIZ%ddKdLZ&ddMdNZ'ddOdPZ(ddQdRZ)ddSdTZ*ddUdVZ+ddWdXZ,ddYdZZ-dd[d\Z.dd]d^Z/dd_d`Z0ddbdcZ1ddddeZ2ddfdgZ3ddhdiZ4ddjdkZ5ddldmZ6dndo Z7ddpdqZ8edrds Z9edtdu Z:edvdw Z;edxdy Z<dd{d|Z=d}d~ Z>dddZ?dddZ@dddZAdd ZBdddZCdddZDdddZEdddZFedd ZGdddZHdddZIdddZJdaS )r   c                 C   s
   t d| S )a  Returns a ``Series`` containing the area of each geometry in the
        ``GeoSeries`` expressed in the units of the CRS.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         Polygon([(10, 0), (10, 5), (0, 0)]),
        ...         Polygon([(0, 0), (2, 2), (2, 0)]),
        ...         LineString([(0, 0), (1, 1), (0, 1)]),
        ...         Point(0, 1)
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    POLYGON ((10.00000 0.00000, 10.00000 5.00000, ...
        2    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 2....
        3    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s.area
        0     0.5
        1    25.0
        2     2.0
        3     0.0
        4     0.0
        dtype: float64

        See also
        --------
        GeoSeries.length : measure length

        Notes
        -----
        Area may be invalid for a geographic CRS using degrees as units;
        use :meth:`GeoSeries.to_crs` to project geometries to a planar
        CRS before using this function.

        Every operation in GeoPandas is planar, i.e. the potential third
        dimension is not taken into account.
        arear.   selfr   r   r   r0   Z   s    /zGeoPandasBase.areac                 C   s
   | j jjS )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
        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
        --------

        >>> s.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

        See also
        --------
        GeoSeries.set_crs : assign CRS
        GeoSeries.to_crs : re-project to another CRS
        r   r   r)   r2   r   r   r   r)      s    !zGeoPandasBase.crsc                 C   s   || j j_dS )zSets the value of the crsNr4   )r3   valuer   r   r   r)      s    c                 C   s
   t d| S )a  
        Returns a ``Series`` of strings specifying the `Geometry Type` of each
        object.

        Examples
        --------
        >>> from shapely.geometry import Point, Polygon, LineString
        >>> d = {'geometry': [Point(2, 1), Polygon([(0, 0), (1, 1), (1, 0)]),
        ... LineString([(0, 0), (1, 1)])]}
        >>> gdf = geopandas.GeoDataFrame(d, crs="EPSG:4326")
        >>> gdf.geom_type
        0         Point
        1       Polygon
        2    LineString
        dtype: object
        	geom_typer1   r2   r   r   r   r6      s    zGeoPandasBase.geom_typec                 C   s   | j S )z:Return the geometry type of each geometry in the GeoSeries)r6   r2   r   r   r   r      s    zGeoPandasBase.typec                 C   s
   t d| S )a1  Returns a ``Series`` containing the length of each geometry
        expressed in the units of the CRS.

        In the case of a (Multi)Polygon it measures the length
        of its exterior (i.e. perimeter).

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, MultiLineString, Point, GeometryCollection
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         LineString([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(10, 0), (10, 5), (0, 0)]),
        ...         MultiLineString([((0, 0), (1, 0)), ((-1, 0), (1, 0))]),
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         Point(0, 1),
        ...         GeometryCollection([Point(1, 0), LineString([(10, 0), (10, 5), (0, 0)])])
        ...     ]
        ... )
        >>> s
        0    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        1    LINESTRING (10.00000 0.00000, 10.00000 5.00000...
        2    MULTILINESTRING ((0.00000 0.00000, 1.00000 0.0...
        3    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        4                              POINT (0.00000 1.00000)
        5    GEOMETRYCOLLECTION (POINT (1.00000 0.00000), L...
        dtype: geometry

        >>> s.length
        0     2.414214
        1    16.180340
        2     3.000000
        3     3.414214
        4     0.000000
        5    16.180340
        dtype: float64

        See also
        --------
        GeoSeries.area : measure area of a polygon

        Notes
        -----
        Length may be invalid for a geographic CRS using degrees as units;
        use :meth:`GeoSeries.to_crs` to project geometries to a planar
        CRS before using this function.

        Every operation in GeoPandas is planar, i.e. the potential third
        dimension is not taken into account.

        lengthr1   r2   r   r   r   r7      s    8zGeoPandasBase.lengthc                 C   s
   t d| S )a  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        geometries that are valid.

        Examples
        --------

        An example with one invalid polygon (a bowtie geometry crossing itself)
        and one missing geometry:

        >>> from shapely.geometry import Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         Polygon([(0,0), (1, 1), (1, 0), (0, 1)]),  # bowtie geometry
        ...         Polygon([(0, 0), (2, 2), (2, 0)]),
        ...         None
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 1....
        2    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 2....
        3                                                 None
        dtype: geometry

        >>> s.is_valid
        0     True
        1    False
        2     True
        3    False
        dtype: bool

        is_validr1   r2   r   r   r   r8     s    #zGeoPandasBase.is_validc                 C   s
   t d| S )a  
        Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        empty geometries.

        Examples
        --------
        An example of a GeoDataFrame with one empty point, one point and one missing
        value:

        >>> from shapely.geometry import Point
        >>> d = {'geometry': [Point(), Point(2, 1), None]}
        >>> gdf = geopandas.GeoDataFrame(d, crs="EPSG:4326")
        >>> gdf
                           geometry
        0               POINT EMPTY
        1   POINT (2.00000 1.00000)
        2                      None
        >>> gdf.is_empty
        0     True
        1    False
        2    False
        dtype: bool

        See Also
        --------
        GeoSeries.isna : detect missing values
        is_emptyr1   r2   r   r   r   r9   +  s    zGeoPandasBase.is_emptyc                 C   s
   t d| S )a  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        geometries that do not cross themselves.

        This is meaningful only for `LineStrings` and `LinearRings`.

        Examples
        --------
        >>> from shapely.geometry import LineString
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         LineString([(0, 0), (1, 1), (1, -1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, -1)]),
        ...     ]
        ... )
        >>> s
        0    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        dtype: geometry

        >>> s.is_simple
        0    False
        1     True
        dtype: bool
        	is_simpler1   r2   r   r   r   r:   J  s    zGeoPandasBase.is_simplec                 C   s
   t d| S )a8  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        features that are closed.

        When constructing a LinearRing, the sequence of coordinates may be
        explicitly closed by passing identical values in the first and last indices.
        Otherwise, the sequence will be implicitly closed by copying the first tuple
        to the last index.

        Examples
        --------
        >>> from shapely.geometry import LineString, LinearRing
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         LineString([(0, 0), (1, 1), (1, -1)]),
        ...         LineString([(0, 0), (1, 1), (1, -1), (0, 0)]),
        ...         LinearRing([(0, 0), (1, 1), (1, -1)]),
        ...     ]
        ... )
        >>> s
        0    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2    LINEARRING (0.00000 0.00000, 1.00000 1.00000, ...
        dtype: geometry

        >>> s.is_ring
        0    False
        1     True
        2     True
        dtype: bool

        is_ringr1   r2   r   r   r   r;   f  s    !zGeoPandasBase.is_ringc                 C   s
   t d| S )a  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        features that have a z-component.

        Notes
        -----
        Every operation in GeoPandas is planar, i.e. the potential third
        dimension is not taken into account.

        Examples
        --------
        >>> from shapely.geometry import Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(0, 1),
        ...         Point(0, 1, 2),
        ...     ]
        ... )
        >>> s
        0              POINT (0.00000 1.00000)
        1    POINT Z (0.00000 1.00000 2.00000)
        dtype: geometry

        >>> s.has_z
        0    False
        1     True
        dtype: bool
        has_zr1   r2   r   r   r   r<     s    zGeoPandasBase.has_zc                 C   s
   t d| S )a  Returns a ``GeoSeries`` of lower dimensional objects representing
        each geometry's set-theoretic `boundary`.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.boundary
        0    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        1        MULTIPOINT (0.00000 0.00000, 1.00000 0.00000)
        2                             GEOMETRYCOLLECTION EMPTY
        dtype: geometry

        See also
        --------
        GeoSeries.exterior : outer boundary (without interior rings)

        boundaryr1   r2   r   r   r   r=     s    !zGeoPandasBase.boundaryc                 C   s
   t d| S )a  Returns a ``GeoSeries`` of points representing the centroid of each
        geometry.

        Note that centroid does not have to be on or within original geometry.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.centroid
        0    POINT (0.33333 0.66667)
        1    POINT (0.70711 0.50000)
        2    POINT (0.00000 0.00000)
        dtype: geometry

        See also
        --------
        GeoSeries.representative_point : point guaranteed to be within each geometry
        centroidr1   r2   r   r   r   r>     s    "zGeoPandasBase.centroid        Fc                 C   s   t d| ||dS )a	  Returns a ``GeoSeries`` of geometries representing the concave hull
        of each geometry.

        The concave hull of a geometry is the smallest concave `Polygon`
        containing all the points in each geometry, unless the number of points
        in the geometric object is less than three. For two points, the concave
        hull collapses to a `LineString`; for 1, a `Point`.

        The hull is constructed by removing border triangles of the Delaunay
        Triangulation of the points as long as their "size" is larger than the
        maximum edge length ratio and optionally allowing holes. The edge length factor
        is a fraction of the length difference between the longest and shortest edges
        in the Delaunay Triangulation of the input points. For further information
        on the algorithm used, see
        https://libgeos.org/doxygen/classgeos_1_1algorithm_1_1hull_1_1ConcaveHull.html

        Parameters
        ----------
        ratio : float, (optional, default 0.0)
            Number in the range [0, 1]. Higher numbers will include fewer vertices
            in the hull.
        allow_holes : bool, (optional, default False)
            If set to True, the concave hull may have holes.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point, MultiPoint
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         MultiPoint([(0, 0), (1, 1), (0, 1), (1, 0), (0.5, 0.5)]),
        ...         MultiPoint([(0, 0), (1, 1)]),
        ...         Point(0, 0),
        ...     ],
        ...     crs=3857
        ... )
        >>> s
        0    POLYGON ((0.000 0.000, 1.000 1.000, 0.000 1.00...
        1    LINESTRING (0.000 0.000, 1.000 1.000, 1.000 0....
        2    MULTIPOINT (0.000 0.000, 1.000 1.000, 0.000 1....
        3                MULTIPOINT (0.000 0.000, 1.000 1.000)
        4                                  POINT (0.000 0.000)
        dtype: geometry

        >>> s.concave_hull()
        0    POLYGON ((0.000 1.000, 1.000 1.000, 0.000 0.00...
        1    POLYGON ((0.000 0.000, 1.000 1.000, 1.000 0.00...
        2    POLYGON ((0.500 0.500, 0.000 1.000, 1.000 1.00...
        3                LINESTRING (0.000 0.000, 1.000 1.000)
        4                                  POINT (0.000 0.000)
        dtype: geometry

        See also
        --------
        GeoSeries.convex_hull : convex hull geometry

        concave_hull)ratioallow_holesr/   )r3   rA   rB   r   r   r   r@     s    <zGeoPandasBase.concave_hullc                 C   s
   t d| S )a  Returns a ``GeoSeries`` of geometries representing the convex hull
        of each geometry.

        The convex hull of a geometry is the smallest convex `Polygon`
        containing all the points in each geometry, unless the number of points
        in the geometric object is less than three. For two points, the convex
        hull collapses to a `LineString`; for 1, a `Point`.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point, MultiPoint
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         MultiPoint([(0, 0), (1, 1), (0, 1), (1, 0), (0.5, 0.5)]),
        ...         MultiPoint([(0, 0), (1, 1)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2    MULTIPOINT (0.00000 0.00000, 1.00000 1.00000, ...
        3        MULTIPOINT (0.00000 0.00000, 1.00000 1.00000)
        4                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.convex_hull
        0    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 1....
        2    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
        3        LINESTRING (0.00000 0.00000, 1.00000 1.00000)
        4                              POINT (0.00000 0.00000)
        dtype: geometry

        See also
        --------
        GeoSeries.concave_hull : concave hull geometry
        GeoSeries.envelope : bounding rectangle geometry

        convex_hullr1   r2   r   r   r   rD   3  s    -zGeoPandasBase.convex_hullc                 C   s   t d| ||S )aR  Returns a ``GeoSeries`` consisting of objects representing
        the computed Delaunay triangulation around the vertices of
        an input geometry.

        The output is a ``GeometryCollection`` containing polygons
        (default) or linestrings (see only_edges).

        Returns an empty GeometryCollection if an input geometry
        contains less than 3 vertices.

        Parameters
        ----------
        tolerance : float | array-like, default 0.0
            Snap input vertices together if their distance is less than this value.
        only_edges : bool | array_like, (optional, default False)
            If set to True, the triangulation will return a collection of
            linestrings instead of polygons.

        Examples
        --------

        >>> from shapely import LineString, MultiPoint, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         MultiPoint([(50, 30), (60, 30), (100, 100)]),
        ...         Polygon([(50, 30), (60, 30), (100, 100), (50, 30)]),
        ...         LineString([(50, 30), (60, 30), (100, 100)]),
        ...     ]
        ... )
        >>> s
        0   MULTIPOINT (50.000 30.000, 60.000 30.000, 100....
        1   POLYGON ((50.000 30.000, 60.000 30.000, 100.00...
        2   LINESTRING (50.000 30.000, 60.000 30.000, 100....
        dtype: geometry

        >>> s.delaunay_triangles()
        0    GEOMETRYCOLLECTION (POLYGON ((50.000 30.000, 6...
        1    GEOMETRYCOLLECTION (POLYGON ((50.000 30.000, 6...
        2    GEOMETRYCOLLECTION (POLYGON ((50.000 30.000, 6...
        dtype: geometry

        >>> s.delaunay_triangles(only_edges=True)
        0    MULTILINESTRING ((50.000 30.000, 100.000 100.0...
        1    MULTILINESTRING ((50.000 30.000, 100.000 100.0...
        2    MULTILINESTRING ((50.000 30.000, 100.000 100.0...
        dtype: geometry
        delaunay_trianglesrC   )r3   	toleranceZ
only_edgesr   r   r   rE   b  s    0z GeoPandasBase.delaunay_trianglesc                 C   s
   t d| S )ab  Returns a ``GeoSeries`` of geometries representing the envelope of
        each geometry.

        The envelope of a geometry is the bounding rectangle. That is, the
        point or smallest rectangular polygon (with sides parallel to the
        coordinate axes) that contains the geometry.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point, MultiPoint
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         MultiPoint([(0, 0), (1, 1)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2        MULTIPOINT (0.00000 0.00000, 1.00000 1.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.envelope
        0    POLYGON ((0.00000 0.00000, 1.00000 0.00000, 1....
        1    POLYGON ((0.00000 0.00000, 1.00000 0.00000, 1....
        2    POLYGON ((0.00000 0.00000, 1.00000 0.00000, 1....
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        See also
        --------
        GeoSeries.convex_hull : convex hull geometry
        enveloper1   r2   r   r   r   rG     s    'zGeoPandasBase.envelopec                 C   s
   t d| S )a  Returns a ``GeoSeries`` of the general minimum bounding rectangle
        that contains the object.

        Unlike envelope this rectangle is not constrained to be parallel
        to the coordinate axes. If the convex hull of the object is a
        degenerate (line or point) this degenerate is returned.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point, MultiPoint
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         MultiPoint([(0, 0), (1, 1)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2        MULTIPOINT (0.00000 0.00000, 1.00000 1.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.minimum_rotated_rectangle()
        0    POLYGON ((1.00000 1.00000, 0.50000 1.50000, -0...
        1    POLYGON ((0.00000 0.00000, 0.50000 -0.50000, 1...
        2        LINESTRING (0.00000 0.00000, 1.00000 1.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        See also
        --------
        GeoSeries.envelope : bounding rectangle
        minimum_rotated_rectanglerC   r2   r   r   r   rH     s    &z'GeoPandasBase.minimum_rotated_rectanglec                 C   s
   t d| S )a  Returns a ``GeoSeries`` of LinearRings representing the outer
        boundary of each polygon in the GeoSeries.

        Applies to GeoSeries containing only Polygons. Returns ``None``` for
        other geometry types.

        Examples
        --------

        >>> from shapely.geometry import Polygon, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         Polygon([(1, 0), (2, 1), (0, 0)]),
        ...         Point(0, 1)
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    POLYGON ((1.00000 0.00000, 2.00000 1.00000, 0....
        2                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s.exterior
        0    LINEARRING (0.00000 0.00000, 1.00000 1.00000, ...
        1    LINEARRING (1.00000 0.00000, 2.00000 1.00000, ...
        2                                                 None
        dtype: geometry

        See also
        --------
        GeoSeries.boundary : complete set-theoretic boundary
        GeoSeries.interiors : list of inner rings of each polygon
        exteriorr1   r2   r   r   r   rI     s    %zGeoPandasBase.exteriorc                 C   s
   t d| S )a~  Returns a ``GeoSeries`` of MultiPoints representing all
        distinct vertices of an input geometry.

        Examples
        --------

        >>> from shapely import LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         LineString([(0, 0), (0, 0), (1, 1), (1, 1)]),
        ...         Polygon([(0, 0), (0, 0), (1, 1), (1, 1)])
        ...     ],
        ...     crs=3857
        ... )
        >>> s
        0    LINESTRING (0.000 0.000, 0.000 0.000, 1.000 1....
        1    POLYGON ((0.000 0.000, 0.000 0.000, 1.000 1.00...
        dtype: geometry

        >>> s.extract_unique_points()
        0    MULTIPOINT (0.000 0.000, 1.000 1.000)
        1    MULTIPOINT (0.000 0.000, 1.000 1.000)
        dtype: geometry

        See also
        --------

        GeoSeries.get_coordinates : extract coordinates as a :class:`~pandas.DataFrame`
        extract_unique_pointsrC   r2   r   r   r   rJ     s    z#GeoPandasBase.extract_unique_points   round      @c                 C   s   t d| ||||dS )ar  Returns a ``LineString`` or ``MultiLineString`` geometry at a
        distance from the object on its right or its left side.
        Parameters
        ----------
        distance : float | array-like
            Specifies the offset distance from the input geometry. Negative
            for right side offset, positive for left side offset.
        quad_segs : int (optional, default 8)
            Specifies the number of linear segments in a quarter circle in the
            approximation of circular arcs.
        join_style : {'round', 'bevel', 'mitre'}, (optional, default 'round')
            Specifies the shape of outside corners. 'round' results in
            rounded shapes. 'bevel' results in a beveled edge that touches the
            original vertex. 'mitre' results in a single vertex that is beveled
            depending on the ``mitre_limit`` parameter.
        mitre_limit : float (optional, default 5.0)
            Crops of 'mitre'-style joins if the point is displaced from the
            buffered vertex by more than this limit.

        See http://shapely.readthedocs.io/en/latest/manual.html#object.offset_curve
        for details.

        Examples
        --------

        >>> from shapely.geometry import LineString
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         LineString([(0, 0), (0, 1), (1, 1)]),
        ...     ],
        ...     crs=3857
        ... )
        >>> s
        0    LINESTRING (0.000 0.000, 0.000 1.000, 1.000 1....
        dtype: geometry

        >>> s.offset_curve(1)
        0    LINESTRING (-1.000 0.000, -1.000 1.000, -0.981...
        dtype: geometry
        offset_curve)	quad_segs
join_stylemitre_limitrC   )r3   distancerO   rP   rQ   r   r   r   rN   ,  s    )zGeoPandasBase.offset_curvec                 C   s
   t d| S )ab  Returns a ``Series`` of List representing the
        inner rings of each polygon in the GeoSeries.

        Applies to GeoSeries containing only Polygons.

        Returns
        -------
        inner_rings: Series of List
            Inner rings of each polygon in the GeoSeries.

        Examples
        --------

        >>> from shapely.geometry import Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon(
        ...             [(0, 0), (0, 5), (5, 5), (5, 0)],
        ...             [[(1, 1), (2, 1), (1, 2)], [(1, 4), (2, 4), (2, 3)]],
        ...         ),
        ...         Polygon([(1, 0), (2, 1), (0, 0)]),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 0.00000 5.00000, 5....
        1    POLYGON ((1.00000 0.00000, 2.00000 1.00000, 0....
        dtype: geometry

        >>> s.interiors
        0    [LINEARRING (1 1, 2 1, 1 2, 1 1), LINEARRING (...
        1                                                   []
        dtype: object

        See also
        --------
        GeoSeries.exterior : outer boundary
        	interiorsr1   r2   r   r   r   rS   ^  s    'zGeoPandasBase.interiorsc                 C   s   t d| |dS )a  Returns a ``GeoSeries`` containing a copy of the input geometry
        with repeated points removed.

        From the start of the coordinate sequence, each next point within the
        tolerance is removed.

        Removing repeated points with a non-zero tolerance may result in an invalid
        geometry being returned.

        Parameters
        ----------
        tolerance : float, default 0.0
            Remove all points within this distance of each other. Use 0.0
            to remove only exactly repeated points (the default).

        Examples
        --------

        >>> from shapely import LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...        LineString([(0, 0), (0, 0), (1, 0)]),
        ...        Polygon([(0, 0), (0, 0.5), (0, 1), (0.5, 1), (0,0)]),
        ...     ],
        ...     crs=3857
        ... )
        >>> s
        0    LINESTRING (0.000 0.000, 0.000 0.000, 1.000 0....
        1    POLYGON ((0.000 0.000, 0.000 0.500, 0.000 1.00...
        dtype: geometry

        >>> s.remove_repeated_points(tolerance=0.0)
        0                LINESTRING (0.000 0.000, 1.000 0.000)
        1    POLYGON ((0.000 0.000, 0.000 0.500, 0.000 1.00...
        dtype: geometry
        remove_repeated_points)rF   rC   )r3   rF   r   r   r   rT     s    %z$GeoPandasBase.remove_repeated_pointsc                 C   s
   t d| S )a  Returns a ``GeoSeries`` of (cheaply computed) points that are
        guaranteed to be within each geometry.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.representative_point()
        0    POINT (0.25000 0.50000)
        1    POINT (1.00000 1.00000)
        2    POINT (0.00000 0.00000)
        dtype: geometry

        See also
        --------
        GeoSeries.centroid : geometric centroid
        representative_pointrC   r2   r   r   r   rU     s    z"GeoPandasBase.representative_pointc                 C   s
   t d| S )a  Returns a ``GeoSeries`` of geometries representing the minimum bounding
        circle that encloses each geometry.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1), (0, 0)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.minimum_bounding_circle()
        0    POLYGON ((1.20711 0.50000, 1.19352 0.36205, 1....
        1    POLYGON ((1.20711 0.50000, 1.19352 0.36205, 1....
        2                              POINT (0.00000 0.00000)
        dtype: geometry

        See also
        --------
        GeoSeries.convex_hull : convex hull geometry
        minimum_bounding_circlerC   r2   r   r   r   rV     s    z%GeoPandasBase.minimum_bounding_circlec                 C   s   t | jj | jdS )a  Returns a `Series` of the radii of the minimum bounding circles
        that enclose each geometry.

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1), (0, 0)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         Point(0,0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2                              POINT (0.00000 0.00000)
        dtype: geometry
        >>> s.minimum_bounding_radius()
        0    0.707107
        1    0.707107
        2    0.000000
        dtype: float64

        See also
        --------
        GeoSeries.minumum_bounding_circle : minimum bounding circle (geometry)

        r,   )r   r   r   minimum_bounding_radiusr   r2   r   r   r   rW     s    z%GeoPandasBase.minimum_bounding_radiusc                 C   s
   t d| S )a~  Returns a ``GeoSeries`` of normalized
        geometries to normal form (or canonical form).

        This method orders the coordinates, rings of a polygon and parts of
        multi geometries consistently. Typically useful for testing purposes
        (for example in combination with `equals_exact`).

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         Point(0, 0),
        ...     ],
        ...     crs='EPSG:3857'
        ... )
        >>> s
        0    POLYGON ((0.000 0.000, 1.000 1.000, 0.000 1.00...
        1    LINESTRING (0.000 0.000, 1.000 1.000, 1.000 0....
        2                                  POINT (0.000 0.000)
        dtype: geometry

        >>> s.normalize()
        0    POLYGON ((0.000 0.000, 0.000 1.000, 1.000 1.00...
        1    LINESTRING (0.000 0.000, 1.000 1.000, 1.000 0....
        2                                  POINT (0.000 0.000)
        dtype: geometry
        	normalizerC   r2   r   r   r   rX     s     zGeoPandasBase.normalizec                 C   s
   t d| S )a  
        Repairs invalid geometries.

        Returns a ``GeoSeries`` with valid geometries.
        If the input geometry is already valid, then it will be preserved.
        In many cases, in order to create a valid geometry, the input
        geometry must be split into multiple parts or multiple geometries.
        If the geometry must be split into multiple parts of the same type
        to be made valid, then a multi-part geometry will be returned
        (e.g. a MultiPolygon).
        If the geometry must be split into multiple parts of different types
        to be made valid, then a GeometryCollection will be returned.

        Examples
        --------
        >>> from shapely.geometry import MultiPolygon, Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (0, 2), (1, 1), (2, 2), (2, 0), (1, 1), (0, 0)]),
        ...         Polygon([(0, 2), (0, 1), (2, 0), (0, 0), (0, 2)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...     ],
        ...     crs='EPSG:3857',
        ... )
        >>> s
        0    POLYGON ((0.000 0.000, 0.000 2.000, 1.000 1.00...
        1    POLYGON ((0.000 2.000, 0.000 1.000, 2.000 0.00...
        2    LINESTRING (0.000 0.000, 1.000 1.000, 1.000 0....
        dtype: geometry

        >>> s.make_valid()
        0    MULTIPOLYGON (((1.000 1.000, 0.000 0.000, 0.00...
        1    GEOMETRYCOLLECTION (POLYGON ((2.000 0.000, 0.0...
        2    LINESTRING (0.000 0.000, 1.000 1.000, 1.000 0....
        dtype: geometry
        
make_validrC   r2   r   r   r   rY   2  s    %zGeoPandasBase.make_validc                 C   s
   t d| S )a  Returns a ``GeoSeries`` with the order of coordinates reversed.

        Examples
        --------

        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (1, 1), (1, 0)]),
        ...         Point(0, 0),
        ...     ]
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1    LINESTRING (0.00000 0.00000, 1.00000 1.00000, ...
        2                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s.reverse()
        0    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
        1    LINESTRING (1.00000 0.00000, 1.00000 1.00000, ...
        2    POINT (0.00000 0.00000)
        dtype: geometry

        See also
        --------
        GeoSeries.normalize : normalize order of coordinates
        reverserC   r2   r   r   r   rZ   Y  s    zGeoPandasBase.reversec                 C   s   t d| |S )a  Returns a ``GeoSeries`` with vertices added to line segments based on
        maximum segment length.

        Additional vertices will be added to every line segment in an input geometry so
        that segments are no longer than the provided maximum segment length. New
        vertices will evenly subdivide each segment. Only linear components of input
        geometries are densified; other geometries are returned unmodified.

        Parameters
        ----------
        max_segment_length : float | array-like
            Additional vertices will be added so that all line segments are no longer
            than this value. Must be greater than 0.

        Returns
        -------
        GeoSeries

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         LineString([(0, 0), (0, 10)]),
        ...         Polygon([(0, 0), (10, 0), (10, 10), (0, 10), (0, 0)]),
        ...     ],
        ...     crs=3857
        ... )
        >>> s
        0               LINESTRING (0.000 0.000, 0.000 10.000)
        1    POLYGON ((0.000 0.000, 10.000 0.000, 10.000 10...
        dtype: geometry

        >>> s.segmentize(max_segment_length=5)
        0    LINESTRING (0.000 0.000, 0.000 5.000, 0.000 10...
        1    POLYGON ((0.000 0.000, 5.000 0.000, 10.000 0.0...
        dtype: geometry
        
segmentizerC   )r3   Zmax_segment_lengthr   r   r   r[   y  s    'zGeoPandasBase.segmentizec                 C   s   t dtdd | jj S )z%Deprecated: use `unary_union` insteadzGThe 'cascaded_union' attribute is deprecated, use 'unary_union' instead   r   )r   FutureWarningr   r   unary_unionr2   r   r   r   cascaded_union  s    zGeoPandasBase.cascaded_unionc                 C   s   | j j S )a	  Returns a geometry containing the union of all geometries in the
        ``GeoSeries``.

        Examples
        --------

        >>> from shapely.geometry import box
        >>> s = geopandas.GeoSeries([box(0,0,1,1), box(0,0,2,2)])
        >>> s
        0    POLYGON ((1.00000 0.00000, 1.00000 1.00000, 0....
        1    POLYGON ((2.00000 0.00000, 2.00000 2.00000, 0....
        dtype: geometry

        >>> union = s.unary_union
        >>> print(union)
        POLYGON ((0 1, 0 2, 2 2, 2 0, 1 0, 0 0, 0 1))
        )r   r   r^   r2   r   r   r   r^     s    zGeoPandasBase.unary_unionTc                 C   s   t d| ||S )u  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry that contains `other`.

        An object is said to contain `other` if at least one point of `other` lies in
        the interior and no points of `other` lie in the exterior of the object.
        (Therefore, any given polygon does not contain its own boundary – there is not
        any point that lies in the interior.)
        If either object is empty, this operation returns ``False``.

        This is the inverse of :meth:`within` in the sense that the expression
        ``a.contains(b) == b.within(a)`` always evaluates to ``True``.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test if it
            is contained.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (0, 2)]),
        ...         LineString([(0, 0), (0, 1)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(0, 4),
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (1, 2), (0, 2)]),
        ...         LineString([(0, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        1        LINESTRING (0.00000 0.00000, 0.00000 2.00000)
        2        LINESTRING (0.00000 0.00000, 0.00000 1.00000)
        3                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2    POLYGON ((0.00000 0.00000, 1.00000 2.00000, 0....
        3        LINESTRING (0.00000 0.00000, 0.00000 2.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries contains a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> point = Point(0, 1)
        >>> s.contains(point)
        0    False
        1     True
        2    False
        3     True
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s2.contains(s, align=True)
        0    False
        1    False
        2    False
        3     True
        4    False
        dtype: bool

        >>> s2.contains(s, align=False)
        1     True
        2    False
        3     True
        4     True
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries ``contains`` *any* element of the other one.

        See also
        --------
        GeoSeries.within
        containsr-   r3   r!   r   r   r   r   r`     s    qzGeoPandasBase.containsc                 C   s   t d| ||S )aU  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry equal to `other`.

        An object is said to be equal to `other` if its set-theoretic
        `boundary`, `interior`, and `exterior` coincides with those of the
        other.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test for
            equality.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (1, 2), (0, 2)]),
        ...         LineString([(0, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (1, 2), (0, 2)]),
        ...         Point(0, 1),
        ...         LineString([(0, 0), (0, 2)]),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 1.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 0.00000 2.00000)
        3                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2    POLYGON ((0.00000 0.00000, 1.00000 2.00000, 0....
        3                              POINT (0.00000 1.00000)
        4        LINESTRING (0.00000 0.00000, 0.00000 2.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries contains a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> polygon = Polygon([(0, 0), (2, 2), (0, 2)])
        >>> s.geom_equals(polygon)
        0     True
        1    False
        2    False
        3    False
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.geom_equals(s2)
        0    False
        1    False
        2    False
        3     True
        4    False
        dtype: bool

        >>> s.geom_equals(s2, align=False)
        0     True
        1     True
        2    False
        3    False
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries is equal to *any* element of the other one.

        See also
        --------
        GeoSeries.geom_equals_exact

        geom_equalsra   rb   r   r   r   rc   <  s    lzGeoPandasBase.geom_equals   c                 C   s0   t jdtdd dd|   }td| |||dS )a8  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` if
        each aligned geometry is approximately equal to `other`.

        Approximate equality is tested at all points to the specified `decimal`
        place precision.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to compare to.
        decimal : int
            Decimal place precision used when testing for approximate equality.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(0, 1.1),
        ...         Point(0, 1.01),
        ...         Point(0, 1.001),
        ...     ],
        ... )

        >>> s
        0    POINT (0.00000 1.10000)
        1    POINT (0.00000 1.01000)
        2    POINT (0.00000 1.00100)
        dtype: geometry


        >>> s.geom_almost_equals(Point(0, 1), decimal=2)
        0    False
        1    False
        2     True
        dtype: bool

        >>> s.geom_almost_equals(Point(0, 1), decimal=1)
        0    False
        1     True
        2     True
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries is equal to *any* element of the other one.

        See also
        --------
        GeoSeries.geom_equals
        GeoSeries.geom_equals_exact

        zThe 'geom_almost_equals()' method is deprecated because the name is confusing. The 'geom_equals_exact()' method should be used instead.r\   r   g      ?
   geom_equals_exactrF   r   )warningsr   r]   r-   )r3   r!   decimalr   rF   r   r   r   geom_almost_equals  s    C
z GeoPandasBase.geom_almost_equalsc                 C   s   t d| |||dS )a  Return True for all geometries that equal aligned *other* to a given
        tolerance, else False.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to compare to.
        tolerance : float
            Decimal place precision used when testing for approximate equality.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(0, 1.1),
        ...         Point(0, 1.0),
        ...         Point(0, 1.2),
        ...     ]
        ... )

        >>> s
        0    POINT (0.00000 1.10000)
        1    POINT (0.00000 1.00000)
        2    POINT (0.00000 1.20000)
        dtype: geometry


        >>> s.geom_equals_exact(Point(0, 1), tolerance=0.1)
        0    False
        1     True
        2    False
        dtype: bool

        >>> s.geom_equals_exact(Point(0, 1), tolerance=0.15)
        0     True
        1     True
        2    False
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries is equal to *any* element of the other one.

        See also
        --------
        GeoSeries.geom_equals
        rf   rg   ra   )r3   r!   rF   r   r   r   r   rf     s    >
zGeoPandasBase.geom_equals_exactc                 C   s   t d| ||S )a  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry that cross `other`.

        An object is said to cross `other` if its `interior` intersects the
        `interior` of the other but does not contain it, and the dimension of
        the intersection is less than the dimension of the one or the other.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test if is
            crossed.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         LineString([(1, 0), (1, 3)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(1, 1),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        2        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        3                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    LINESTRING (1.00000 0.00000, 1.00000 3.00000)
        2    LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        3                          POINT (1.00000 1.00000)
        4                          POINT (0.00000 1.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries crosses a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> line = LineString([(-1, 1), (3, 1)])
        >>> s.crosses(line)
        0     True
        1     True
        2     True
        3    False
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.crosses(s2, align=True)
        0    False
        1     True
        2    False
        3    False
        4    False
        dtype: bool

        >>> s.crosses(s2, align=False)
        0     True
        1     True
        2    False
        3    False
        dtype: bool

        Notice that a line does not cross a point that it contains.

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries ``crosses`` *any* element of the other one.

        See also
        --------
        GeoSeries.disjoint
        GeoSeries.intersects

        crossesra   rb   r   r   r   rk   :  s    ozGeoPandasBase.crossesc                 C   s   t d| ||S )a=  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry disjoint to `other`.

        An object is said to be disjoint to `other` if its `boundary` and
        `interior` does not intersect at all with those of the other.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test if is
            disjoint.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(-1, 0), (-1, 2), (0, -2)]),
        ...         LineString([(0, 0), (0, 1)]),
        ...         Point(1, 1),
        ...         Point(0, 0),
        ...     ],
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        2        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        3                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        0    POLYGON ((-1.00000 0.00000, -1.00000 2.00000, ...
        1        LINESTRING (0.00000 0.00000, 0.00000 1.00000)
        2                              POINT (1.00000 1.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        We can check each geometry of GeoSeries to a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> line = LineString([(0, 0), (2, 0)])
        >>> s.disjoint(line)
        0    False
        1    False
        2    False
        3     True
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.disjoint(s2)
        0     True
        1    False
        2    False
        3     True
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries is equal to *any* element of the other one.

        See also
        --------
        GeoSeries.intersects
        GeoSeries.touches

        disjointra   rb   r   r   r   rl     s    czGeoPandasBase.disjointc                 C   s   t d| ||S )aW  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry that intersects `other`.

        An object is said to intersect `other` if its `boundary` and `interior`
        intersects in any way with those of the other.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test if is
            intersected.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         LineString([(1, 0), (1, 3)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(1, 1),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        2        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        3                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    LINESTRING (1.00000 0.00000, 1.00000 3.00000)
        2    LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        3                          POINT (1.00000 1.00000)
        4                          POINT (0.00000 1.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries crosses a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> line = LineString([(-1, 1), (3, 1)])
        >>> s.intersects(line)
        0    True
        1    True
        2    True
        3    True
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.intersects(s2, align=True)
        0    False
        1     True
        2     True
        3    False
        4    False
        dtype: bool

        >>> s.intersects(s2, align=False)
        0    True
        1    True
        2    True
        3    True
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries ``crosses`` *any* element of the other one.

        See also
        --------
        GeoSeries.disjoint
        GeoSeries.crosses
        GeoSeries.touches
        GeoSeries.intersection
        
intersectsra   rb   r   r   r   rm     s    mzGeoPandasBase.intersectsc                 C   s   t d| ||S )a  Returns True for all aligned geometries that overlap *other*, else False.

        Geometries overlaps if they have more than one but not all
        points in common, have the same dimension, and the intersection of the
        interiors of the geometries has the same dimension as the geometries
        themselves.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test if
            overlaps.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, MultiPoint, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         MultiPoint([(0, 0), (0, 1)]),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 0), (0, 2)]),
        ...         LineString([(0, 1), (1, 1)]),
        ...         LineString([(1, 1), (3, 3)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3        MULTIPOINT (0.00000 0.00000, 0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 2.00000 0.00000, 0....
        2        LINESTRING (0.00000 1.00000, 1.00000 1.00000)
        3        LINESTRING (1.00000 1.00000, 3.00000 3.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries overlaps a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> polygon = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
        >>> s.overlaps(polygon)
        0     True
        1     True
        2    False
        3    False
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.overlaps(s2)
        0    False
        1     True
        2    False
        3    False
        4    False
        dtype: bool

        >>> s.overlaps(s2, align=False)
        0     True
        1    False
        2     True
        3    False
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries ``overlaps`` *any* element of the other one.

        See also
        --------
        GeoSeries.crosses
        GeoSeries.intersects

        overlapsra   rb   r   r   r   rn     s    mzGeoPandasBase.overlapsc                 C   s   t d| ||S )a  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry that touches `other`.

        An object is said to touch `other` if it has at least one point in
        common with `other` and its interior does not intersect with any part
        of the other. Overlapping features therefore do not touch.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test if is
            touched.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, MultiPoint, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         MultiPoint([(0, 0), (0, 1)]),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (-2, 0), (0, -2)]),
        ...         LineString([(0, 1), (1, 1)]),
        ...         LineString([(1, 1), (3, 0)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3        MULTIPOINT (0.00000 0.00000, 0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, -2.00000 0.00000, 0...
        2        LINESTRING (0.00000 1.00000, 1.00000 1.00000)
        3        LINESTRING (1.00000 1.00000, 3.00000 0.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries touches a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center


        >>> line = LineString([(0, 0), (-1, -2)])
        >>> s.touches(line)
        0    True
        1    True
        2    True
        3    True
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.touches(s2, align=True)
        0    False
        1     True
        2     True
        3    False
        4    False
        dtype: bool

        >>> s.touches(s2, align=False)
        0     True
        1    False
        2     True
        3    False
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries ``touches`` *any* element of the other one.

        See also
        --------
        GeoSeries.overlaps
        GeoSeries.intersects

        touchesra   rb   r   r   r   ro     s    nzGeoPandasBase.touchesc                 C   s   t d| ||S )aA  Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry that is within `other`.

        An object is said to be within `other` if at least one of its points is located
        in the `interior` and no points are located in the `exterior` of the other.
        If either object is empty, this operation returns ``False``.

        This is the inverse of :meth:`contains` in the sense that the
        expression ``a.within(b) == b.contains(a)`` always evaluates to
        ``True``.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The GeoSeries (elementwise) or geometric object to test if each
            geometry is within.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)


        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (1, 2), (0, 2)]),
        ...         LineString([(0, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(0, 0), (0, 2)]),
        ...         LineString([(0, 0), (0, 1)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 1.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 0.00000 2.00000)
        3                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        2        LINESTRING (0.00000 0.00000, 0.00000 2.00000)
        3        LINESTRING (0.00000 0.00000, 0.00000 1.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries is within a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> polygon = Polygon([(0, 0), (2, 2), (0, 2)])
        >>> s.within(polygon)
        0     True
        1     True
        2    False
        3    False
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s2.within(s)
        0    False
        1    False
        2     True
        3    False
        4    False
        dtype: bool

        >>> s2.within(s, align=False)
        1     True
        2    False
        3     True
        4     True
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries is ``within`` *any* element of the other one.

        See also
        --------
        GeoSeries.contains
        withinra   rb   r   r   r   rp   ^  s    pzGeoPandasBase.withinc                 C   s   t d| ||S )a3  
        Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry that is entirely covering `other`.

        An object A is said to cover another object B if no points of B lie
        in the exterior of A.
        If either object is empty, this operation returns ``False``.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        See
        https://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html
        for reference.

        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to check is being covered.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         Point(0, 0),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0.5, 0.5), (1.5, 0.5), (1.5, 1.5), (0.5, 1.5)]),
        ...         Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]),
        ...         LineString([(1, 1), (1.5, 1.5)]),
        ...         Point(0, 0),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 0.00000, 2....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.50000 0.50000, 1.50000 0.50000, 1....
        2    POLYGON ((0.00000 0.00000, 2.00000 0.00000, 2....
        3        LINESTRING (1.00000 1.00000, 1.50000 1.50000)
        4                              POINT (0.00000 0.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries covers a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> poly = Polygon([(0, 0), (2, 0), (2, 2), (0, 2)])
        >>> s.covers(poly)
        0     True
        1    False
        2    False
        3    False
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.covers(s2, align=True)
        0    False
        1    False
        2    False
        3    False
        4    False
        dtype: bool

        >>> s.covers(s2, align=False)
        0     True
        1    False
        2     True
        3     True
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries ``covers`` *any* element of the other one.

        See also
        --------
        GeoSeries.covered_by
        GeoSeries.overlaps
        coversra   rb   r   r   r   rq     s    pzGeoPandasBase.coversc                 C   s   t d| ||S )a  
        Returns a ``Series`` of ``dtype('bool')`` with value ``True`` for
        each aligned geometry that is entirely covered by `other`.

        An object A is said to cover another object B if no points of B lie
        in the exterior of A.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        See
        https://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html
        for reference.

        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to check is being covered.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series (bool)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0.5, 0.5), (1.5, 0.5), (1.5, 1.5), (0.5, 1.5)]),
        ...         Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]),
        ...         LineString([(1, 1), (1.5, 1.5)]),
        ...         Point(0, 0),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         Point(0, 0),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.50000 0.50000, 1.50000 0.50000, 1....
        1    POLYGON ((0.00000 0.00000, 2.00000 0.00000, 2....
        2        LINESTRING (1.00000 1.00000, 1.50000 1.50000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 2.00000 0.00000, 2....
        2    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        3        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        4                              POINT (0.00000 0.00000)
        dtype: geometry

        We can check if each geometry of GeoSeries is covered by a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> poly = Polygon([(0, 0), (2, 0), (2, 2), (0, 2)])
        >>> s.covered_by(poly)
        0    True
        1    True
        2    True
        3    True
        dtype: bool

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.covered_by(s2, align=True)
        0    False
        1     True
        2     True
        3     True
        4    False
        dtype: bool

        >>> s.covered_by(s2, align=False)
        0     True
        1    False
        2     True
        3     True
        dtype: bool

        Notes
        -----
        This method works in a row-wise manner. It does not check if an element
        of one GeoSeries is ``covered_by`` *any* element of the other one.

        See also
        --------
        GeoSeries.covers
        GeoSeries.overlaps
        
covered_byra   rb   r   r   r   rr   B	  s    ozGeoPandasBase.covered_byc                 C   s   t d| ||S )a  Returns a ``Series`` containing the distance to aligned `other`.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to find the
            distance to.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.


        Returns
        -------
        Series (float)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 0), (1, 1)]),
        ...         Polygon([(0, 0), (-1, 0), (-1, 1)]),
        ...         LineString([(1, 1), (0, 0)]),
        ...         Point(0, 0),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0.5, 0.5), (1.5, 0.5), (1.5, 1.5), (0.5, 1.5)]),
        ...         Point(3, 1),
        ...         LineString([(1, 0), (2, 0)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 0.00000, 1....
        1    POLYGON ((0.00000 0.00000, -1.00000 0.00000, -...
        2        LINESTRING (1.00000 1.00000, 0.00000 0.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.50000 0.50000, 1.50000 0.50000, 1....
        2                              POINT (3.00000 1.00000)
        3        LINESTRING (1.00000 0.00000, 2.00000 0.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can check the distance of each geometry of GeoSeries to a single
        geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> point = Point(-1, 0)
        >>> s.distance(point)
        0    1.0
        1    0.0
        2    1.0
        3    1.0
        dtype: float64

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and use elements with the same index using
        ``align=True`` or ignore index and use elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.distance(s2, align=True)
        0         NaN
        1    0.707107
        2    2.000000
        3    1.000000
        4         NaN
        dtype: float64

        >>> s.distance(s2, align=False)
        0    0.000000
        1    3.162278
        2    0.707107
        3    1.000000
        dtype: float64
        rR   ra   rb   r   r   r   rR   	  s    ^zGeoPandasBase.distanceNc                 C   s   t d| |||dS )a  Returns a ``Series`` containing the Hausdorff distance to aligned `other`.

        The Hausdorff distance is the largest distance consisting of any point in `self`
        with the nearest point in `other`.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The Geoseries (elementwise) or geometric object to find the
            distance to.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.
        densify : float (default None)
            A value between 0 and 1, that splits each subsegment of a line string
            into equal length segments, making the approximation less coarse.
            A densify value of 0.5 will add a point halfway between each pair of
            points. A densify value of 0.25 will add a point a quarter of the way
            between each pair of points.


        Returns
        -------
        Series (float)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 0), (1, 1)]),
        ...         Polygon([(0, 0), (-1, 0), (-1, 1)]),
        ...         LineString([(1, 1), (0, 0)]),
        ...         Point(0, 0),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0.5, 0.5), (1.5, 0.5), (1.5, 1.5), (0.5, 1.5)]),
        ...         Point(3, 1),
        ...         LineString([(1, 0), (2, 0)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 0.00000, 1....
        1    POLYGON ((0.00000 0.00000, -1.00000 0.00000, -...
        2        LINESTRING (1.00000 1.00000, 0.00000 0.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.50000 0.50000, 1.50000 0.50000, 1....
        2                              POINT (3.00000 1.00000)
        3        LINESTRING (1.00000 0.00000, 2.00000 0.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can check the hausdorff distance of each geometry of GeoSeries
        to a single geometry:

        >>> point = Point(-1, 0)
        >>> s.hausdorff_distance(point)
        0    2.236068
        1    1.000000
        2    2.236068
        3    1.000000
        dtype: float64

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and use elements with the same index using
        ``align=True`` or ignore index and use elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.hausdorff_distance(s2, align=True)
        0         NaN
        1    2.121320
        2    3.162278
        3    2.000000
        4         NaN
        dtype: float64

        >>> s.hausdorff_distance(s2, align=False)
        0    0.707107
        1    4.123106
        2    1.414214
        3    1.000000
        dtype: float64

        We can also set a densify value, which is a float between 0 and 1 and
        signifies the fraction of the distance between each pair of points that will
        be used as the distance between the points when densifying.

        >>> l1 = geopandas.GeoSeries([LineString([(130, 0), (0, 0), (0, 150)])])
        >>> l2 = geopandas.GeoSeries([LineString([(10, 10), (10, 150), (130, 10)])])
        >>> l1.hausdorff_distance(l2)
        0    14.142136
        dtype: float64
        >>> l1.hausdorff_distance(l2, densify=0.25)
        0    70.0
        dtype: float64
        hausdorff_distancedensifyra   r3   r!   r   ru   r   r   r   rs   
  s    qz GeoPandasBase.hausdorff_distancec                 C   s   t d| |||dS )u  Returns a ``Series`` containing the Frechet distance to aligned `other`.

        The Fréchet distance is a measure of similarity: it is the greatest distance
        between any point in A and the closest point in B. The discrete distance is an
        approximation of this metric: only vertices are considered. The parameter
        ``densify`` makes this approximation less coarse by splitting the line segments
        between vertices before computing the distance.

        Fréchet distance sweep continuously along their respective curves and the
        direction of curves is significant. This makes it a better measure of similarity
        than Hausdorff distance for curve or surface matching.

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : GeoSeries or geometric object
            The Geoseries (elementwise) or geometric object to find the
            distance to.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.
        densify : float (default None)
            A value between 0 and 1, that splits each subsegment of a line string
            into equal length segments, making the approximation less coarse.
            A densify value of 0.5 will add a point halfway between each pair of
            points. A densify value of 0.25 will add a point every quarter of the way
            between each pair of points.

        Returns
        -------
        Series (float)

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 0), (1, 1)]),
        ...         Polygon([(0, 0), (-1, 0), (-1, 1)]),
        ...         LineString([(1, 1), (0, 0)]),
        ...         Point(0, 0),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0.5, 0.5), (1.5, 0.5), (1.5, 1.5), (0.5, 1.5)]),
        ...         Point(3, 1),
        ...         LineString([(1, 0), (2, 0)]),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 5),
        ... )
        >>> s
        0    POLYGON ((0.00000 0.00000, 1.00000 0.00000, 1....
        1    POLYGON ((0.00000 0.00000, -1.00000 0.00000, -...
        2        LINESTRING (1.00000 1.00000, 0.00000 0.00000)
        3                              POINT (0.00000 0.00000)
        dtype: geometry
        >>> s2
        1    POLYGON ((0.50000 0.50000, 1.50000 0.50000, 1....
        2                              POINT (3.00000 1.00000)
        3        LINESTRING (1.00000 0.00000, 2.00000 0.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can check the frechet distance of each geometry of GeoSeries
        to a single geometry:

        >>> point = Point(-1, 0)
        >>> s.frechet_distance(point)
        0    2.236068
        1    1.000000
        2    2.236068
        3    1.000000
        dtype: float64

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and use elements with the same index using
        ``align=True`` or ignore index and use elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.frechet_distance(s2, align=True)
        0         NaN
        1    2.121320
        2    3.162278
        3    2.000000
        4         NaN
        dtype: float64
        >>> s.frechet_distance(s2, align=False)
        0    0.707107
        1    4.123106
        2    2.000000
        3    1.000000
        dtype: float64

        We can also set a ``densify`` value, which is a float between 0 and 1 and
        signifies the fraction of the distance between each pair of points that will
        be used as the distance between the points when densifying.

        >>> l1 = geopandas.GeoSeries([LineString([(0, 0), (10, 0), (0, 15)])])
        >>> l2 = geopandas.GeoSeries([LineString([(0, 0), (20, 15), (9, 11)])])
        >>> l1.frechet_distance(l2)
        0    18.027756
        dtype: float64
        >>> l1.frechet_distance(l2, densify=0.25)
        0    16.77051
        dtype: float64
        frechet_distancert   ra   rv   r   r   r   rw   
  s    tzGeoPandasBase.frechet_distancec                 C   s   t d| ||S )a=  Returns a ``GeoSeries`` of the points in each aligned geometry that
        are not in `other`.

        .. image:: ../../../_static/binary_geo-difference.svg
           :align: center

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to find the
            difference to.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        GeoSeries

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(1, 0), (1, 3)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(1, 1),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 6),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        2        LINESTRING (1.00000 0.00000, 1.00000 3.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (1.00000 1.00000)
        5                              POINT (0.00000 1.00000)
        dtype: geometry

        We can do difference of each geometry and a single
        shapely geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> s.difference(Polygon([(0, 0), (1, 1), (0, 1)]))
        0    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        1    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        2        LINESTRING (1.00000 1.00000, 2.00000 2.00000)
        3    MULTILINESTRING ((2.00000 0.00000, 1.00000 1.0...
        4                                          POINT EMPTY
        dtype: geometry

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.difference(s2, align=True)
        0                                                 None
        1    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        2    MULTILINESTRING ((0.00000 0.00000, 1.00000 1.0...
        3                                   LINESTRING Z EMPTY
        4                              POINT (0.00000 1.00000)
        5                                                 None
        dtype: geometry

        >>> s.difference(s2, align=False)
        0    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        1    POLYGON ((0.00000 0.00000, 0.00000 2.00000, 1....
        2    MULTILINESTRING ((0.00000 0.00000, 1.00000 1.0...
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                                          POINT EMPTY
        dtype: geometry

        See Also
        --------
        GeoSeries.symmetric_difference
        GeoSeries.union
        GeoSeries.intersection
        
differencer+   rb   r   r   r   rx      s    mzGeoPandasBase.differencec                 C   s   t d| ||S )a  Returns a ``GeoSeries`` of the symmetric difference of points in
        each aligned geometry with `other`.

        For each geometry, the symmetric difference consists of points in the
        geometry not in `other`, and points in `other` not in the geometry.

        .. image:: ../../../_static/binary_geo-symm_diff.svg
           :align: center

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center


        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to find the
            symmetric difference to.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        GeoSeries

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(1, 0), (1, 3)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(1, 1),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 6),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        2        LINESTRING (1.00000 0.00000, 1.00000 3.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (1.00000 1.00000)
        5                              POINT (0.00000 1.00000)
        dtype: geometry

        We can do symmetric difference of each geometry and a single
        shapely geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> s.symmetric_difference(Polygon([(0, 0), (1, 1), (0, 1)]))
        0    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        1    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        2    GEOMETRYCOLLECTION (POLYGON ((0.00000 0.00000,...
        3    GEOMETRYCOLLECTION (POLYGON ((0.00000 0.00000,...
        4    POLYGON ((0.00000 1.00000, 1.00000 1.00000, 0....
        dtype: geometry

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.symmetric_difference(s2, align=True)
        0                                                 None
        1    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        2    MULTILINESTRING ((0.00000 0.00000, 1.00000 1.0...
        3                                   LINESTRING Z EMPTY
        4        MULTIPOINT (0.00000 1.00000, 1.00000 1.00000)
        5                                                 None
        dtype: geometry

        >>> s.symmetric_difference(s2, align=False)
        0    POLYGON ((0.00000 2.00000, 2.00000 2.00000, 1....
        1    GEOMETRYCOLLECTION (POLYGON ((0.00000 0.00000,...
        2    MULTILINESTRING ((0.00000 0.00000, 1.00000 1.0...
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                                          POINT EMPTY
        dtype: geometry

        See Also
        --------
        GeoSeries.difference
        GeoSeries.union
        GeoSeries.intersection
        symmetric_differencery   rb   r   r   r   rz   o  s    qz"GeoPandasBase.symmetric_differencec                 C   s   t d| ||S )a&  Returns a ``GeoSeries`` of the union of points in each aligned geometry with
        `other`.

        .. image:: ../../../_static/binary_geo-union.svg
           :align: center

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center


        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to find the union
            with.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        GeoSeries

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(1, 0), (1, 3)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(1, 1),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 6),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        2        LINESTRING (1.00000 0.00000, 1.00000 3.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (1.00000 1.00000)
        5                              POINT (0.00000 1.00000)
        dtype: geometry

        We can do union of each geometry and a single
        shapely geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> s.union(Polygon([(0, 0), (1, 1), (0, 1)]))
        0    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 0....
        1    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 0....
        2    GEOMETRYCOLLECTION (POLYGON ((0.00000 0.00000,...
        3    GEOMETRYCOLLECTION (POLYGON ((0.00000 0.00000,...
        4    POLYGON ((0.00000 1.00000, 1.00000 1.00000, 0....
        dtype: geometry

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.union(s2, align=True)
        0                                                 None
        1    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 0....
        2    MULTILINESTRING ((0.00000 0.00000, 1.00000 1.0...
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4        MULTIPOINT (0.00000 1.00000, 1.00000 1.00000)
        5                                                 None
        dtype: geometry

        >>> s.union(s2, align=False)
        0    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 0....
        1    GEOMETRYCOLLECTION (POLYGON ((0.00000 0.00000,...
        2    MULTILINESTRING ((0.00000 0.00000, 1.00000 1.0...
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry


        See Also
        --------
        GeoSeries.symmetric_difference
        GeoSeries.difference
        GeoSeries.intersection
        unionry   rb   r   r   r   r{     s    ozGeoPandasBase.unionc                 C   s   t d| ||S )aU  Returns a ``GeoSeries`` of the intersection of points in each
        aligned geometry with `other`.

        .. image:: ../../../_static/binary_geo-intersection.svg
           :align: center

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center


        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to find the
            intersection with.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        GeoSeries

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(1, 0), (1, 3)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(1, 1),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 6),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        2        LINESTRING (1.00000 0.00000, 1.00000 3.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (1.00000 1.00000)
        5                              POINT (0.00000 1.00000)
        dtype: geometry

        We can also do intersection of each geometry and a single
        shapely geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> s.intersection(Polygon([(0, 0), (1, 1), (0, 1)]))
        0    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
        1    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
        2        LINESTRING (0.00000 0.00000, 1.00000 1.00000)
        3                              POINT (1.00000 1.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.intersection(s2, align=True)
        0                                                 None
        1    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
        2                              POINT (1.00000 1.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                                          POINT EMPTY
        5                                                 None
        dtype: geometry

        >>> s.intersection(s2, align=False)
        0    POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
        1        LINESTRING (1.00000 1.00000, 1.00000 2.00000)
        2                              POINT (1.00000 1.00000)
        3                              POINT (1.00000 1.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry


        See Also
        --------
        GeoSeries.difference
        GeoSeries.symmetric_difference
        GeoSeries.union
        intersectionry   rb   r   r   r   r|   S  s    ozGeoPandasBase.intersectionc                 C   s:   ddl m} t| jj}|||||}||| j| jdS )a	  Returns a ``GeoSeries`` of the portions of geometry within the given
        rectangle.

        Note that the results are not exactly equal to
        :meth:`~GeoSeries.intersection()`. E.g. in edge cases,
        :meth:`~GeoSeries.clip_by_rect()` will not return a point just touching the
        rectangle. Check the examples section below for some of these exceptions.

        The geometry is clipped in a fast but possibly dirty way. The output is not
        guaranteed to be valid. No exceptions will be raised for topological errors.

        Note: empty geometries or geometries that do not overlap with the specified
        bounds will result in ``GEOMETRYCOLLECTION EMPTY``.

        Parameters
        ----------
        xmin: float
            Minimum x value of the rectangle
        ymin: float
            Minimum y value of the rectangle
        xmax: float
            Maximum x value of the rectangle
        ymax: float
            Maximum y value of the rectangle

        Returns
        -------
        GeoSeries

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ...     crs=3857,
        ... )
        >>> bounds = (0, 0, 1, 1)
        >>> s
        0    POLYGON ((0.000 0.000, 2.000 2.000, 0.000 2.00...
        1    POLYGON ((0.000 0.000, 2.000 2.000, 0.000 2.00...
        2                LINESTRING (0.000 0.000, 2.000 2.000)
        3                LINESTRING (2.000 0.000, 0.000 2.000)
        4                                  POINT (0.000 1.000)
        dtype: geometry
        >>> s.clip_by_rect(*bounds)
        0    POLYGON ((0.000 0.000, 0.000 1.000, 1.000 1.00...
        1    POLYGON ((0.000 0.000, 0.000 1.000, 1.000 1.00...
        2                LINESTRING (0.000 0.000, 1.000 1.000)
        3                             GEOMETRYCOLLECTION EMPTY
        4                             GEOMETRYCOLLECTION EMPTY
        dtype: geometry

        See also
        --------
        GeoSeries.intersection
        r   r&   r(   )r*   r'   r
   r   r   clip_by_rectr   r)   )r3   xminyminxmaxymaxr'   Zgeometry_arrayZclipped_geometryr   r   r   r}     s    ?zGeoPandasBase.clip_by_rectc                 C   s   t d| ||S )a  
        Returns the shortest two-point line between two geometries.

        The resulting line consists of two points, representing the nearest points
        between the geometry pair. The line always starts in the first geometry a
        and ends in he second geometry b. The endpoints of the line will not
        necessarily be existing vertices of the input geometries a and b, but
        can also be a point along a line segment.


        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
        :align: center

        Parameters
        ----------
        other : Geoseries or geometric object
            The Geoseries (elementwise) or geometric object to find the
            shortest line with.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        GeoSeries

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ...     crs=5514
        ... )
        >>> s
        0    POLYGON ((0.000 0.000, 2.000 2.000, 0.000 2.00...
        1    POLYGON ((0.000 0.000, 2.000 2.000, 0.000 2.00...
        2                LINESTRING (0.000 0.000, 2.000 2.000)
        3                LINESTRING (2.000 0.000, 0.000 2.000)
        4                                  POINT (0.000 1.000)
        dtype: geometry

        We can also do intersection of each geometry and a single
        shapely geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> p = Point(3, 3)
        >>> s.shortest_line(p)
        0    LINESTRING (2.000 2.000, 3.000 3.000)
        1    LINESTRING (2.000 2.000, 3.000 3.000)
        2    LINESTRING (2.000 2.000, 3.000 3.000)
        3    LINESTRING (1.000 1.000, 3.000 3.000)
        4    LINESTRING (0.000 1.000, 3.000 3.000)
        dtype: geometry

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices than the one below. We can either
        align both GeoSeries based on index values and compare elements with the same
        index using ``align=True`` or ignore index and compare elements based on their
        matching order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0.5, 0.5), (1.5, 0.5), (1.5, 1.5), (0.5, 1.5)]),
        ...         Point(3, 1),
        ...         LineString([(1, 0), (2, 0)]),
        ...         Point(10, 15),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 6),
        ...     crs=5514,
        ... )
        >>> s.shortest_line(s2, align=True)
        0                                       None
        1      LINESTRING (0.500 0.500, 0.500 0.500)
        2      LINESTRING (2.000 2.000, 3.000 1.000)
        3      LINESTRING (2.000 0.000, 2.000 0.000)
        4    LINESTRING (0.000 1.000, 10.000 15.000)
        5                                       None
        dtype: geometry

        >>> s.shortest_line(s2, align=False)
        0      LINESTRING (0.500 0.500, 0.500 0.500)
        1      LINESTRING (2.000 2.000, 3.000 1.000)
        2      LINESTRING (0.500 0.500, 1.000 0.000)
        3    LINESTRING (0.000 2.000, 10.000 15.000)
        4      LINESTRING (0.000 1.000, 0.000 1.000)
        dtype: geometry
        shortest_linery   rb   r   r   r   r   	  s    ezGeoPandasBase.shortest_linec                 C   s"   t | jjj}t|g d| jdS )a  Returns a ``DataFrame`` with columns ``minx``, ``miny``, ``maxx``,
        ``maxy`` values containing the bounds for each geometry.

        See ``GeoSeries.total_bounds`` for the limits of the entire series.

        Examples
        --------
        >>> from shapely.geometry import Point, Polygon, LineString
        >>> d = {'geometry': [Point(2, 1), Polygon([(0, 0), (1, 1), (1, 0)]),
        ... LineString([(0, 1), (1, 2)])]}
        >>> gdf = geopandas.GeoDataFrame(d, crs="EPSG:4326")
        >>> gdf.bounds
           minx  miny  maxx  maxy
        0   2.0   1.0   2.0   1.0
        1   0.0   0.0   1.0   1.0
        2   0.0   1.0   1.0   2.0

        You can assign the bounds to the ``GeoDataFrame`` as:

        >>> import pandas as pd
        >>> gdf = pd.concat([gdf, gdf.bounds], axis=1)
        >>> gdf
                                                    geometry  minx  miny  maxx  maxy
        0                            POINT (2.00000 1.00000)   2.0   1.0   2.0   1.0
        1  POLYGON ((0.00000 0.00000, 1.00000 1.00000, 1....   0.0   0.0   1.0   1.0
        2      LINESTRING (0.00000 1.00000, 1.00000 2.00000)   0.0   1.0   1.0   2.0
        )ZminxZminyZmaxxZmaxy)columnsr   )r
   r   r   boundsr   r   )r3   r   r   r   r   r   t  s    zGeoPandasBase.boundsc                 C   s   t | jjjS )aE  Returns a tuple containing ``minx``, ``miny``, ``maxx``, ``maxy``
        values for the bounds of the series as a whole.

        See ``GeoSeries.bounds`` for the bounds of the geometries contained in
        the series.

        Examples
        --------
        >>> from shapely.geometry import Point, Polygon, LineString
        >>> d = {'geometry': [Point(3, -1), Polygon([(0, 0), (1, 1), (1, 0)]),
        ... LineString([(0, 1), (1, 2)])]}
        >>> gdf = geopandas.GeoDataFrame(d, crs="EPSG:4326")
        >>> gdf.total_bounds
        array([ 0., -1.,  3.,  2.])
        )r
   r   r   total_boundsr2   r   r   r   r     s    zGeoPandasBase.total_boundsc                 C   s
   | j jjS )a  Generate the spatial index

        Creates R-tree spatial index based on ``pygeos.STRtree`` or
        ``rtree.index.Index``.

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

        Examples
        --------
        >>> from shapely.geometry import box
        >>> s = geopandas.GeoSeries(geopandas.points_from_xy(range(5), range(5)))
        >>> s
        0    POINT (0.00000 0.00000)
        1    POINT (1.00000 1.00000)
        2    POINT (2.00000 2.00000)
        3    POINT (3.00000 3.00000)
        4    POINT (4.00000 4.00000)
        dtype: geometry

        Query the spatial index with a single geometry based on the bounding box:

        >>> s.sindex.query(box(1, 1, 3, 3))
        array([1, 2, 3])

        Query the spatial index with a single geometry based on the predicate:

        >>> s.sindex.query(box(1, 1, 3, 3), predicate="contains")
        array([2])

        Query the spatial index with an array of geometries based on the bounding
        box:

        >>> s2 = geopandas.GeoSeries([box(1, 1, 3, 3), box(4, 4, 5, 5)])
        >>> s2
        0    POLYGON ((3.00000 1.00000, 3.00000 3.00000, 1....
        1    POLYGON ((5.00000 4.00000, 5.00000 5.00000, 4....
        dtype: geometry

        >>> s.sindex.query(s2)
        array([[0, 0, 0, 1],
               [1, 2, 3, 4]])

        Query the spatial index with an array of geometries based on the predicate:

        >>> s.sindex.query(s2, predicate="contains")
        array([[0],
               [2]])
        )r   r   sindexr2   r   r   r   r     s    3zGeoPandasBase.sindexc                 C   s
   | j jjS )aC  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.

        Examples
        --------

        >>> from shapely.geometry import Point
        >>> d = {'geometry': [Point(1, 2), Point(2, 1)]}
        >>> gdf = geopandas.GeoDataFrame(d)
        >>> gdf.has_sindex
        False
        >>> index = gdf.sindex
        >>> gdf.has_sindex
        True

        Returns
        -------
        bool
            `True` if the spatial index has been generated or
            `False` if not.
        )r   r   
has_sindexr2   r   r   r   r     s    zGeoPandasBase.has_sindex   c                 K   sD   t |tjr,| j|js"tdt|}td| |fd|i|S )a  Returns a ``GeoSeries`` of geometries representing all points within
        a given ``distance`` of each geometric object.

        See http://shapely.readthedocs.io/en/latest/manual.html#object.buffer
        for details.

        Parameters
        ----------
        distance : float, np.array, pd.Series
            The radius of the buffer. If np.array or pd.Series are used
            then it must have same length as the GeoSeries.
        resolution : int (optional, default 16)
            The resolution of the buffer around each vertex.

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(0, 0),
        ...         LineString([(1, -1), (1, 0), (2, 0), (2, 1)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )
        >>> s
        0                              POINT (0.00000 0.00000)
        1    LINESTRING (1.00000 -1.00000, 1.00000 0.00000,...
        2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
        dtype: geometry

        >>> s.buffer(0.2)
        0    POLYGON ((0.20000 0.00000, 0.19904 -0.01960, 0...
        1    POLYGON ((0.80000 0.00000, 0.80096 0.01960, 0....
        2    POLYGON ((2.80000 -1.00000, 2.80000 1.00000, 2...
        dtype: geometry

        ``**kwargs`` accept further specification as ``join_style`` and ``cap_style``.
        See the following illustration of different options.

        .. plot:: _static/code/buffer.py

        NIndex values of distance sequence does not match index values of the GeoSeriesbuffer
resolution	r   pdr   r   r   
ValueErrornpZasarrayr/   )r3   rR   r   r#   r   r   r   r     s    ,
zGeoPandasBase.bufferc                 O   s   t d| g|R i |S )u  Returns a ``GeoSeries`` containing a simplified representation of
        each geometry.

        The algorithm (Douglas-Peucker) recursively splits the original line
        into smaller parts and connects these parts’ endpoints
        by a straight line. Then, it removes all points whose distance
        to the straight line is smaller than `tolerance`. It does not
        move any points and it always preserves endpoints of
        the original line or polygon.
        See http://shapely.readthedocs.io/en/latest/manual.html#object.simplify
        for details

        Parameters
        ----------
        tolerance : float
            All parts of a simplified geometry will be no more than
            `tolerance` distance from the original. It has the same units
            as the coordinate reference system of the GeoSeries.
            For example, using `tolerance=100` in a projected CRS with meters
            as units means a distance of 100 meters in reality.
        preserve_topology: bool (default True)
            False uses a quicker algorithm, but may produce self-intersecting
            or otherwise invalid geometries.

        Notes
        -----
        Invalid geometric objects may result from simplification that does not
        preserve topology and simplification may be sensitive to the order of
        coordinates: two geometries differing only in order of coordinates may be
        simplified differently.

        Examples
        --------
        >>> from shapely.geometry import Point, LineString
        >>> s = geopandas.GeoSeries(
        ...     [Point(0, 0).buffer(1), LineString([(0, 0), (1, 10), (0, 20)])]
        ... )
        >>> s
        0    POLYGON ((1.00000 0.00000, 0.99518 -0.09802, 0...
        1    LINESTRING (0.00000 0.00000, 1.00000 10.00000,...
        dtype: geometry

        >>> s.simplify(1)
        0    POLYGON ((1.00000 0.00000, 0.00000 -1.00000, -...
        1       LINESTRING (0.00000 0.00000, 0.00000 20.00000)
        dtype: geometry
        simplifyrC   )r3   r"   r#   r   r   r   r   6  s    0zGeoPandasBase.simplifyc                 C   s   t d| ||S )a4  
        Returns the DE-9IM intersection matrices for the geometries

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        Parameters
        ----------
        other : BaseGeometry or GeoSeries
            The other geometry to computed
            the DE-9IM intersection matrices from.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        spatial_relations: Series of strings
            The DE-9IM intersection matrices which describe
            the spatial relations of the other geometry.

        Examples
        --------
        >>> from shapely.geometry import Polygon, LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         Polygon([(0, 0), (2, 2), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(0, 1),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(0, 0), (1, 1), (0, 1)]),
        ...         LineString([(1, 0), (1, 3)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...         Point(1, 1),
        ...         Point(0, 1),
        ...     ],
        ...     index=range(1, 6),
        ... )

        >>> s
        0    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        1    POLYGON ((0.00000 0.00000, 2.00000 2.00000, 0....
        2        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (0.00000 1.00000)
        dtype: geometry

        >>> s2
        1    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
        2        LINESTRING (1.00000 0.00000, 1.00000 3.00000)
        3        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        4                              POINT (1.00000 1.00000)
        5                              POINT (0.00000 1.00000)
        dtype: geometry

        We can relate each geometry and a single
        shapely geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> s.relate(Polygon([(0, 0), (1, 1), (0, 1)]))
        0    212F11FF2
        1    212F11FF2
        2    F11F00212
        3    F01FF0212
        4    F0FFFF212
        dtype: object

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and compare elements with the same index using
        ``align=True`` or ignore index and compare elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.relate(s2, align=True)
        0         None
        1    212F11FF2
        2    0F1FF0102
        3    1FFF0FFF2
        4    FF0FFF0F2
        5         None
        dtype: object

        >>> s.relate(s2, align=False)
        0    212F11FF2
        1    1F20F1102
        2    0F1FF0102
        3    0F1FF0FF2
        4    0FFFFFFF2
        dtype: object

        relatera   rb   r   r   r   r   h  s    gzGeoPandasBase.relatec                 C   s   t d| |||dS )a
  
        Return the distance along each geometry nearest to *other*

        The operation works on a 1-to-1 row-wise manner:

        .. image:: ../../../_static/binary_op-01.svg
           :align: center

        The project method is the inverse of interpolate.


        Parameters
        ----------
        other : BaseGeometry or GeoSeries
            The *other* geometry to computed projected point from.
        normalized : boolean
            If normalized is True, return the distance normalized to
            the length of the object.
        align : bool (default True)
            If True, automatically aligns GeoSeries based on their indices.
            If False, the order of elements is preserved.

        Returns
        -------
        Series

        Examples
        --------
        >>> from shapely.geometry import LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         LineString([(0, 0), (2, 0), (0, 2)]),
        ...         LineString([(0, 0), (2, 2)]),
        ...         LineString([(2, 0), (0, 2)]),
        ...     ],
        ... )
        >>> s2 = geopandas.GeoSeries(
        ...     [
        ...         Point(1, 0),
        ...         Point(1, 0),
        ...         Point(2, 1),
        ...     ],
        ...     index=range(1, 4),
        ... )

        >>> s
        0    LINESTRING (0.00000 0.00000, 2.00000 0.00000, ...
        1        LINESTRING (0.00000 0.00000, 2.00000 2.00000)
        2        LINESTRING (2.00000 0.00000, 0.00000 2.00000)
        dtype: geometry

        >>> s2
        1    POINT (1.00000 0.00000)
        2    POINT (1.00000 0.00000)
        3    POINT (2.00000 1.00000)
        dtype: geometry

        We can project each geometry on a single
        shapely geometry:

        .. image:: ../../../_static/binary_op-03.svg
           :align: center

        >>> s.project(Point(1, 0))
        0    1.000000
        1    0.707107
        2    0.707107
        dtype: float64

        We can also check two GeoSeries against each other, row by row.
        The GeoSeries above have different indices. We can either align both GeoSeries
        based on index values and project elements with the same index using
        ``align=True`` or ignore index and project elements based on their matching
        order using ``align=False``:

        .. image:: ../../../_static/binary_op-02.svg

        >>> s.project(s2, align=True)
        0         NaN
        1    0.707107
        2    0.707107
        3         NaN
        dtype: float64

        >>> s.project(s2, align=False)
        0    1.000000
        1    0.707107
        2    0.707107
        dtype: float64

        See also
        --------
        GeoSeries.interpolate
        project)
normalizedr   ra   )r3   r!   r   r   r   r   r   r     s    _zGeoPandasBase.projectc                 C   s<   t |tjr,| j|js"tdt|}td| ||dS )a  
        Return a point at the specified distance along each geometry

        Parameters
        ----------
        distance : float or Series of floats
            Distance(s) along the geometries at which a point should be
            returned. If np.array or pd.Series are used then it must have
            same length as the GeoSeries.
        normalized : boolean
            If normalized is True, distance will be interpreted as a fraction
            of the geometric object's length.
        r   interpolate)r   r   )r3   rR   r   r   r   r   r   2  s    
zGeoPandasBase.interpolatec                 C   s   t d| |S )ah  Return a ``GeoSeries`` with translated geometries.

        See http://shapely.readthedocs.io/en/stable/manual.html#shapely.affinity.affine_transform
        for details.

        Parameters
        ----------
        matrix: List or tuple
            6 or 12 items for 2D or 3D transformations respectively.

            For 2D affine transformations,
            the 6 parameter matrix is ``[a, b, d, e, xoff, yoff]``

            For 3D affine transformations,
            the 12 parameter matrix is ``[a, b, c, d, e, f, g, h, i, xoff, yoff, zoff]``

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(1, 1),
        ...         LineString([(1, -1), (1, 0)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )
        >>> s
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (1.00000 -1.00000, 1.00000 0.00000)
        2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
        dtype: geometry

        >>> s.affine_transform([2, 3, 2, 4, 5, 2])
        0                             POINT (10.00000 8.00000)
        1        LINESTRING (4.00000 0.00000, 7.00000 4.00000)
        2    POLYGON ((8.00000 4.00000, 13.00000 10.00000, ...
        dtype: geometry

        affine_transformrC   )r3   matrixr   r   r   r   K  s    (zGeoPandasBase.affine_transformc                 C   s   t d| |||S )a  Returns a ``GeoSeries`` with translated geometries.

        See http://shapely.readthedocs.io/en/latest/manual.html#shapely.affinity.translate
        for details.

        Parameters
        ----------
        xoff, yoff, zoff : float, float, float
            Amount of offset along each dimension.
            xoff, yoff, and zoff for translation along the x, y, and z
            dimensions respectively.

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(1, 1),
        ...         LineString([(1, -1), (1, 0)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )
        >>> s
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (1.00000 -1.00000, 1.00000 0.00000)
        2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
        dtype: geometry

        >>> s.translate(2, 3)
        0                              POINT (3.00000 4.00000)
        1        LINESTRING (3.00000 2.00000, 3.00000 3.00000)
        2    POLYGON ((5.00000 2.00000, 6.00000 3.00000, 5....
        dtype: geometry

        	translaterC   )r3   ZxoffZyoffZzoffr   r   r   r   u  s    $zGeoPandasBase.translatecenterc                 C   s   t d| |||dS )aC  Returns a ``GeoSeries`` with rotated geometries.

        See http://shapely.readthedocs.io/en/latest/manual.html#shapely.affinity.rotate
        for details.

        Parameters
        ----------
        angle : float
            The angle of rotation can be specified in either degrees (default)
            or radians by setting use_radians=True. Positive angles are
            counter-clockwise and negative are clockwise rotations.
        origin : string, Point, or tuple (x, y)
            The point of origin can be a keyword 'center' for the bounding box
            center (default), 'centroid' for the geometry's centroid, a Point
            object or a coordinate tuple (x, y).
        use_radians : boolean
            Whether to interpret the angle of rotation as degrees or radians

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(1, 1),
        ...         LineString([(1, -1), (1, 0)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )
        >>> s
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (1.00000 -1.00000, 1.00000 0.00000)
        2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
        dtype: geometry

        >>> s.rotate(90)
        0                              POINT (1.00000 1.00000)
        1      LINESTRING (1.50000 -0.50000, 0.50000 -0.50000)
        2    POLYGON ((4.50000 -0.50000, 3.50000 0.50000, 2...
        dtype: geometry

        >>> s.rotate(90, origin=(0, 0))
        0                             POINT (-1.00000 1.00000)
        1        LINESTRING (1.00000 1.00000, 0.00000 1.00000)
        2    POLYGON ((1.00000 3.00000, 0.00000 4.00000, -1...
        dtype: geometry

        rotateoriginuse_radiansrC   )r3   Zangler   r   r   r   r   r     s    0
zGeoPandasBase.rotate      ?c                 C   s   t d| ||||dS )a  Returns a ``GeoSeries`` with scaled geometries.

        The geometries can be scaled by different factors along each
        dimension. Negative scale factors will mirror or reflect coordinates.

        See http://shapely.readthedocs.io/en/latest/manual.html#shapely.affinity.scale
        for details.

        Parameters
        ----------
        xfact, yfact, zfact : float, float, float
            Scaling factors for the x, y, and z dimensions respectively.
        origin : string, Point, or tuple
            The point of origin can be a keyword 'center' for the 2D bounding
            box center (default), 'centroid' for the geometry's 2D centroid, a
            Point object or a coordinate tuple (x, y, z).

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(1, 1),
        ...         LineString([(1, -1), (1, 0)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )
        >>> s
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (1.00000 -1.00000, 1.00000 0.00000)
        2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
        dtype: geometry

        >>> s.scale(2, 3)
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (1.00000 -2.00000, 1.00000 1.00000)
        2    POLYGON ((2.50000 -3.00000, 4.50000 0.00000, 2...
        dtype: geometry

        >>> s.scale(2, 3, origin=(0, 0))
        0                              POINT (2.00000 3.00000)
        1       LINESTRING (2.00000 -3.00000, 2.00000 0.00000)
        2    POLYGON ((6.00000 -3.00000, 8.00000 0.00000, 6...
        dtype: geometry
        scale)r   rC   )r3   ZxfactZyfactZzfactr   r   r   r   r     s    .zGeoPandasBase.scalec                 C   s   t d| ||||dS )an  Returns a ``GeoSeries`` with skewed geometries.

        The geometries are sheared by angles along the x and y dimensions.

        See http://shapely.readthedocs.io/en/latest/manual.html#shapely.affinity.skew
        for details.

        Parameters
        ----------
        xs, ys : float, float
            The shear angle(s) for the x and y axes respectively. These can be
            specified in either degrees (default) or radians by setting
            use_radians=True.
        origin : string, Point, or tuple (x, y)
            The point of origin can be a keyword 'center' for the bounding box
            center (default), 'centroid' for the geometry's centroid, a Point
            object or a coordinate tuple (x, y).
        use_radians : boolean
            Whether to interpret the shear angle(s) as degrees or radians

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(1, 1),
        ...         LineString([(1, -1), (1, 0)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )
        >>> s
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (1.00000 -1.00000, 1.00000 0.00000)
        2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
        dtype: geometry

        >>> s.skew(45, 30)
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (0.50000 -1.00000, 1.50000 0.00000)
        2    POLYGON ((2.00000 -1.28868, 4.00000 0.28868, 4...
        dtype: geometry

        >>> s.skew(45, 30, origin=(0, 0))
        0                              POINT (2.00000 1.57735)
        1       LINESTRING (0.00000 -0.42265, 1.00000 0.57735)
        2    POLYGON ((2.00000 0.73205, 4.00000 2.30940, 4....
        dtype: geometry
        skewr   rC   )r3   xsysr   r   r   r   r   r     s    1zGeoPandasBase.skewc                 C   s   t | S )a  
        Coordinate based indexer to select by intersection with bounding box.

        Format of input should be ``.cx[xmin:xmax, ymin:ymax]``. Any of
        ``xmin``, ``xmax``, ``ymin``, and ``ymax`` can be provided, but input
        must include a comma separating x and y slices. That is, ``.cx[:, :]``
        will return the full series/frame, but ``.cx[:]`` is not implemented.

        Examples
        --------
        >>> from shapely.geometry import LineString, Point
        >>> s = geopandas.GeoSeries(
        ...     [Point(0, 0), Point(1, 2), Point(3, 3), LineString([(0, 0), (3, 3)])]
        ... )
        >>> s
        0                          POINT (0.00000 0.00000)
        1                          POINT (1.00000 2.00000)
        2                          POINT (3.00000 3.00000)
        3    LINESTRING (0.00000 0.00000, 3.00000 3.00000)
        dtype: geometry

        >>> s.cx[0:1, 0:1]
        0                          POINT (0.00000 0.00000)
        3    LINESTRING (0.00000 0.00000, 3.00000 3.00000)
        dtype: geometry

        >>> s.cx[:, 1:]
        1                          POINT (1.00000 2.00000)
        2                          POINT (3.00000 3.00000)
        3    LINESTRING (0.00000 0.00000, 3.00000 3.00000)
        dtype: geometry

        )_CoordinateIndexerr2   r   r   r   cx4  s    #zGeoPandasBase.cxc           
      C   s   t jr*ddl}|j| jjj|dd\}}nDt jrTddl}|j| jjj|dd\}}nddl}t	d|j
 dddg}|r|d	 t| j|||d
}	tj||	|dS )u  Gets coordinates from a :class:`GeoSeries` as a :class:`~pandas.DataFrame` of
        floats.

        The shape of the returned :class:`~pandas.DataFrame` is (N, 2), with N being the
        number of coordinate pairs. With the default of ``include_z=False``,
        three-dimensional data is ignored. When specifying ``include_z=True``, the shape
        of the returned :class:`~pandas.DataFrame` is (N, 3).

        Parameters
        ----------
        include_z : bool, default False
            Include Z coordinates
        ignore_index : bool, default False
            If True, the resulting index will be labelled 0, 1, …, n - 1, ignoring
            ``index_parts``.
        index_parts : bool, default False
           If True, the resulting index will be a :class:`~pandas.MultiIndex` (original
           index with an additional level indicating the ordering of the coordinate
           pairs: a new zero-based index for each geometry in the original GeoSeries).

        Returns
        -------
        pandas.DataFrame

        Examples
        --------
        >>> from shapely.geometry import Point, LineString, Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Point(1, 1),
        ...         LineString([(1, -1), (1, 0)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )
        >>> s
        0                              POINT (1.00000 1.00000)
        1       LINESTRING (1.00000 -1.00000, 1.00000 0.00000)
        2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
        dtype: geometry

        >>> s.get_coordinates()
             x    y
        0  1.0  1.0
        1  1.0 -1.0
        1  1.0  0.0
        2  3.0 -1.0
        2  4.0  0.0
        2  3.0  1.0
        2  3.0 -1.0

        >>> s.get_coordinates(ignore_index=True)
             x    y
        0  1.0  1.0
        1  1.0 -1.0
        2  1.0  0.0
        3  3.0 -1.0
        4  4.0  0.0
        5  3.0  1.0
        6  3.0 -1.0

        >>> s.get_coordinates(index_parts=True)
               x    y
        0 0  1.0  1.0
        1 0  1.0 -1.0
          1  1.0  0.0
        2 0  3.0 -1.0
          1  4.0  0.0
          2  3.0  1.0
          3  3.0 -1.0
        r   NT)	include_zZreturn_indexz/shapely >= 2.0 or PyGEOS are required, version z is installed.xyz)ignore_indexindex_parts)r   r   )compatZUSE_SHAPELY_20shapelyget_coordinatesr   r   _dataZ
USE_PYGEOSpygeosNotImplementedError__version__append_get_index_for_partsr   r   r   )
r3   r   r   r   r   Zcoords	outer_idxr   Zcolumn_namesr   r   r   r   r   Y  s4    G
zGeoPandasBase.get_coordinatesc                 C   s0   ddl m} || jj||d}tj|| jddS )a  
        Calculate the distance along a Hilbert curve.

        The distances are calculated for the midpoints of the geometries in the
        GeoDataFrame, and using the total bounds of the GeoDataFrame.

        The Hilbert distance can be used to spatially sort GeoPandas
        objects, by mapping two dimensional geometries along the Hilbert curve.

        Parameters
        ----------
        total_bounds : 4-element array, optional
            The spatial extent in which the curve is constructed (used to
            rescale the geometry midpoints). By default, the total bounds
            of the full GeoDataFrame or GeoSeries will be computed. If known,
            you can pass the total bounds to avoid this extra computation.
        level : int (1 - 16), default 16
            Determines the precision of the curve (points on the curve will
            have coordinates in the range [0, 2^level - 1]).

        Returns
        -------
        Series
            Series containing distance along the curve for geometry
        r   )_hilbert_distance)r   levelhilbert_distance)r   name)Zgeopandas.tools.hilbert_curver   r   r   r   r   r   )r3   r   r   r   Z	distancesr   r   r   r     s
    
zGeoPandasBase.hilbert_distanceuniformc           	         s   ddl m} ddlm |dur2tdtdd ||dkrztjj	rffd	d
t
| jD }q| jjd}nTtdd| d}t|j|std| dt|j|| j fdd}||d| j| jdS )a
  
        Sample points from each geometry.

        Generate a MultiPoint per each geometry containing points sampled from the
        geometry. You can either sample randomly from a uniform distribution or use an
        advanced sampling algorithm from the ``pointpats`` package.

        For polygons, this samples within the area of the polygon. For lines,
        this samples along the length of the linestring. For multi-part
        geometries, the weights of each part are selected according to their relevant
        attribute (area for Polygons, length for LineStrings), and then points are
        sampled from each part.

        Any other geometry type (e.g. Point, GeometryCollection) is ignored, and an
        empty MultiPoint geometry is returned.

        Parameters
        ----------
        size : int | array-like
            The size of the sample requested. Indicates the number of samples to draw
            from each geometry.  If an array of the same length as a GeoSeries is
            passed, it denotes the size of a sample per geometry.
        method : str, default "uniform"
            The sampling method. ``uniform`` samples uniformly at random from a
            geometry using ``numpy.random.uniform``. Other allowed strings
            (e.g. ``"cluster_poisson"``) denote sampling function name from the
            ``pointpats.random`` module (see
            http://pysal.org/pointpats/api.html#random-distributions). Pointpats methods
            are implemented for (Multi)Polygons only and will return an empty MultiPoint
            for other geometry types.
        rng : {None, int, array_like[ints], SeedSequence, BitGenerator, Generator}, optional
            A random generator or seed to initialize the numpy BitGenerator. If None, then fresh,
            unpredictable entropy will be pulled from the OS.
        **kwargs : dict
            Options for the pointpats sampling algorithms.

        Returns
        -------
        GeoSeries
            Points sampled within (or along) each geometry.

        Examples
        --------
        >>> from shapely.geometry import Polygon
        >>> s = geopandas.GeoSeries(
        ...     [
        ...         Polygon([(1, -1), (1, 0), (0, 0)]),
        ...         Polygon([(3, -1), (4, 0), (3, 1)]),
        ...     ]
        ... )

        >>> s.sample_points(size=10)  # doctest: +SKIP
        0    MULTIPOINT (0.04783 -0.04244, 0.24196 -0.09052...
        1    MULTIPOINT (3.00672 -0.52390, 3.01776 0.30065,...
        Name: sampled_points, dtype: geometry
        r   r&   )r   Nz4The 'seed' keyword is deprecated. Use 'rng' instead.r\   r   r   c                    s   g | ]\}}|| qS r   r   ).0Zgeoms)rngr   r   r   
<listcomp>*      z/GeoPandasBase.sample_points.<locals>.<listcomp>)sizer   	pointpatszXFor complex sampling methods, the pointpats module is required. Your requested method, 'zS' was not a supported option and the pointpats package was not able to be imported.z/pointpats.random module has no sampling method zY.Consult the pointpats.random module documentation for available random sampling methods.c                    s<   | j s6| d u s6d| jvs6t| fdi j  S t S )NZPolygonr   )r9   r6   r   Tr^   r   )r   )r#   sample_functionr   r   r   <lambda>>  s    z-GeoPandasBase.sample_points.<locals>.<lambda>Zsampled_points)r   r)   r   )r*   r'   Ztools._randomr   r   r]   r   apitypesZis_list_likezipr   applyr   Zimport_optional_dependencyhasattrrandomAttributeErrorr   r)   r   )	r3   r   methodseedr   r#   r'   resultr   r   )r#   r   r   r   r   r   sample_points  s8    9
zGeoPandasBase.sample_points)r?   F)r?   F)rK   rL   rM   )r?   )T)T)rd   T)T)T)T)T)T)T)T)T)T)T)TN)TN)T)T)T)T)T)r   )T)FT)F)r?   r?   r?   )r   F)r   r   r   r   )r?   r?   r   F)FFF)Nr   )r   NN)K__name__
__module____qualname__propertyr0   r)   setterr6   r   r7   r8   r9   r:   r;   r<   r=   r>   r@   rD   rE   rG   rH   rI   rJ   rN   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r_   r^   r`   rc   rj   rf   rk   rl   rm   rn   ro   rp   rq   rr   rR   rs   rw   rx   rz   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   Y   s   
0
"



9
$


"
"
"
#
@
.
2
((
& 
2
(
'!! "' -
	

s
n
N
B
q
e
o
o
p
r
r
q
`
s
z
o
s
q
qE
k
!

4

82
i
a
*
&
4
0
5
$
i
"r   c           
         s   |rdS t |rztjd|dd |dd kf }ttjt|d t |f }| j|jd}|t|| |8 }ng }| | |r̈ j	} fddt
|D }|| tjj|| jdg d	}	n }	|	S )
a  Helper to handle index when geometries get exploded to parts.

    Used in get_coordinates and explode.

    Parameters
    ----------
    orig_idx : pandas.Index
        original index
    outer_idx : array
        the index of each returned geometry as a separate ndarray of integers
    ignore_index : bool
    index_parts : bool

    Returns
    -------
    pandas.Index
        index or multiindex
    NTr   r   )r   c                    s   g | ]}  |qS r   )Zget_level_values)r   ZlvlZouter_indexr   r   r   r  r   z(_get_index_for_parts.<locals>.<listcomp>)names)lenr   Zr_diffZnonzeroZcumsumr   repeattakenlevelsranger   r   Z
MultiIndexZfrom_arraysr   )
Zorig_idxr   r   r   Z	run_startcountsZinner_indexr   Zindex_arraysr   r   r   r   r   H  s$    ""

r   c                   @   s   e Zd Zdd Zdd ZdS )r   c                 C   s
   || _ d S )N)obj)r3   r   r   r   r   __init__  s    z_CoordinateIndexer.__init__c                 C   s   | j }|\}}t|tur$t||}t|tur:t||}|jd usN|jd urZtddd |jd u s|jd u s|jd u s|jd u r|j\}}}}t|jd ur|jn||jd ur|jn||jd ur|jn||jd ur|jn|}	|	|	}
||
 S )Nz&Ignoring step - full interval is used.r\   r   )
r   r   slicestepr   startstopr   r   rm   )r3   keyr   r   r   r~   r   r   r   Zbboxidxr   r   r   __getitem__  s*    

(
z_CoordinateIndexer.__getitem__N)r   r   r   r   r   r   r   r   r   r     s   r   )rh   r   numpyr   Zpandasr   r   r   Zshapely.geometryr   r   Zshapely.geometry.baser    r	   r   arrayr
   r   r   r   r%   r+   r-   r.   r/   objectr   r   r   r   r   r   r   <module>   sf   	
                                  7