class_docstr: cuspatial.GeoSeries enables GPU-backed storage and computation of
  shapely-like objects. Our goal is to give feature parity with GeoPandas.
  At this time, only from_geopandas and to_geopandas are directly supported.
  cuspatial GIS, indexing, and trajectory functions depend on the arrays
  stored in the `GeoArrowBuffers` object, accessible with the `points`,
  `multipoints`, `lines`, and `polygons` accessors.
  
  Examples
  --------
  
  >>> from shapely.geometry import Point
      import geopandas
      import cuspatial
      cuseries = cuspatial.GeoSeries(geopandas.GeoSeries(Point(-1, 0)))
      cuseries.points.xy
      0   -1.0
      1    0.0
      dtype: float64
class_docstr_tok: ["cuspatial.GeoSeries","enables","GPU-backed","storage","and","computation","of","shapely-like","objects",".","Our","goal","is","to","give","feature","parity","with","GeoPandas",".","At","this","time",",","only","from_geopandas","and","to_geopandas","are","directly","supported",".","cuspatial","GIS",",","indexing",",","and","trajectory","functions","depend","on","the","arrays","stored","in","the","`","GeoArrowBuffers","`","object",",","accessible","with","the","`","points","`",",","`","multipoints","`",",","`","lines","`",",","and","`","polygons","`","accessors",".","Examples","--","--","--","--",">",">",">","from","shapely.geometry","import","Point","import","geopandas","import","cuspatial","cuseries","=","cuspatial.GeoSeries","(","geopandas.GeoSeries","(","Point","(","-1",",","0",")",")",")","cuseries.points.xy","0","-1.0","1","0.0","dtype",":","float64"]
docstr: Align the rows of two GeoSeries using outer join.
  
  `align` rearranges two GeoSeries so that their indices match.
  If one GeoSeries is longer than the other, the shorter GeoSeries
  will be increased in length and missing index values will be added,
  inserting `None` when an empty row is created.
  
  Alignment involves matching the length of the indices, sorting them,
  and inserting into the right GeoSeries extra index values that are
  present in the left GeoSeries.
  
  Parameters
  ----------
  other: GeoSeries
  
  Returns
  -------
  (left, right) : GeoSeries
      Pair of aligned GeoSeries
  
  Examples
  --------
  >>> points = gpd.GeoSeries([
      Point((-8, -8)),
      Point((-2, -2)),
  ])
  >>> point = gpd.GeoSeries(points[0])
  >>> print(points.align(point))
  
  (0    POINT (-8.00000 -8.00000)
  1    POINT (-2.00000 -2.00000)
  dtype: geometry, 0    POINT (-8.00000 -8.00000)
  1                         None
  dtype: geometry)
  
  >>> points_right = gpd.GeoSeries([
      Point((-2, -2)),
      Point((-8, -8)),
  ], index=[1,0])
  >>> print(points.align(points_right))
  
  (0    POINT (-8.00000 -8.00000)
  1    POINT (-2.00000 -2.00000)
  dtype: geometry, 0    POINT (-8.00000 -8.00000)
  1    POINT (-2.00000 -2.00000)
  dtype: geometry)
  
  >>> points_alpha = gpd.GeoSeries([
      Point((-1, 1)),
      Point((1, -1)),
  ], index=['a', 'b'])
  >>> print(points.align(points_alpha))
  
  (0    POINT (-8.00000 -8.00000)
  1    POINT (-2.00000 -2.00000)
  a                         None
  b                         None
  dtype: geometry, 0                        None
  1                        None
  a    POINT (-1.00000 1.00000)
  b    POINT (1.00000 -1.00000)
  dtype: geometry)
docstr_tok: ["Align","the","rows","of","two","GeoSeries","using","outer","join",".","`","align","`","rearranges","two","GeoSeries","so","that","their","indices","match",".","If","one","GeoSeries","is","longer","than","the","other",",","the","shorter","GeoSeries","will","be","increased","in","length","and","missing","index","values","will","be","added",",","inserting","`","None","`","when","an","empty","row","is","created",".","Alignment","involves","matching","the","length","of","the","indices",",","sorting","them",",","and","inserting","into","the","right","GeoSeries","extra","index","values","that","are","present","in","the","left","GeoSeries",".","Parameters","--","--","--","--","--","other",":","GeoSeries","Returns","--","--","--","-","(","left",",","right",")",":","GeoSeries","Pair","of","aligned","GeoSeries","Examples","--","--","--","--",">",">",">","points","=","gpd.GeoSeries","(","[","Point","(","(","-8",",","-8",")",")",",","Point","(","(","-2",",","-2",")",")",",","]",")",">",">",">","point","=","gpd.GeoSeries","(","points","[","0","]",")",">",">",">","print","(","points.align","(","point",")",")","(","0","POINT","(","-8.00000","-8.00000",")","1","POINT","(","-2.00000","-2.00000",")","dtype",":","geometry",",","0","POINT","(","-8.00000","-8.00000",")","1","None","dtype",":","geometry",")",">",">",">","points_right","=","gpd.GeoSeries","(","[","Point","(","(","-2",",","-2",")",")",",","Point","(","(","-8",",","-8",")",")",",","]",",","index=","[","1,0","]",")",">",">",">","print","(","points.align","(","points_right",")",")","(","0","POINT","(","-8.00000","-8.00000",")","1","POINT","(","-2.00000","-2.00000",")","dtype",":","geometry",",","0","POINT","(","-8.00000","-8.00000",")","1","POINT","(","-2.00000","-2.00000",")","dtype",":","geometry",")",">",">",">","points_alpha","=","gpd.GeoSeries","(","[","Point","(","(","-1",",","1",")",")",",","Point","(","(","1",",","-1",")",")",",","]",",","index=","[","'","a","'",",","'","b","'","]",")",">",">",">","print","(","points.align","(","points_alpha",")",")","(","0","POINT","(","-8.00000","-8.00000",")","1","POINT","(","-2.00000","-2.00000",")","a","None","b","None","dtype",":","geometry",",","0","None","1","None","a","POINT","(","-1.00000","1.00000",")","b","POINT","(","1.00000","-1.00000",")","dtype",":","geometry",")"]
code: def align(self, other):
      """Align the rows of two GeoSeries using outer join.
  
      `align` rearranges two GeoSeries so that their indices match.
      If one GeoSeries is longer than the other, the shorter GeoSeries
      will be increased in length and missing index values will be added,
      inserting `None` when an empty row is created.
  
      Alignment involves matching the length of the indices, sorting them,
      and inserting into the right GeoSeries extra index values that are
      present in the left GeoSeries.
  
      Parameters
      ----------
      other: GeoSeries
  
      Returns
      -------
      (left, right) : GeoSeries
          Pair of aligned GeoSeries
  
      Examples
      --------
      >>> points = gpd.GeoSeries([
          Point((-8, -8)),
          Point((-2, -2)),
      ])
      >>> point = gpd.GeoSeries(points[0])
      >>> print(points.align(point))
  
      (0    POINT (-8.00000 -8.00000)
      1    POINT (-2.00000 -2.00000)
      dtype: geometry, 0    POINT (-8.00000 -8.00000)
      1                         None
      dtype: geometry)
  
      >>> points_right = gpd.GeoSeries([
          Point((-2, -2)),
          Point((-8, -8)),
      ], index=[1,0])
      >>> print(points.align(points_right))
  
      (0    POINT (-8.00000 -8.00000)
      1    POINT (-2.00000 -2.00000)
      dtype: geometry, 0    POINT (-8.00000 -8.00000)
      1    POINT (-2.00000 -2.00000)
      dtype: geometry)
  
      >>> points_alpha = gpd.GeoSeries([
          Point((-1, 1)),
          Point((1, -1)),
      ], index=['a', 'b'])
      >>> print(points.align(points_alpha))
  
      (0    POINT (-8.00000 -8.00000)
      1    POINT (-2.00000 -2.00000)
      a                         None
      b                         None
      dtype: geometry, 0                        None
      1                        None
      a    POINT (-1.00000 1.00000)
      b    POINT (1.00000 -1.00000)
      dtype: geometry)
  
      """
  
      # Merge the two indices and sort them
      if (
          len(self.index) == len(other.index)
          and (self.index == other.index).all()
      ):
          return self, other
  
      idx1 = cudf.DataFrame({"idx": self.index})
      idx2 = cudf.DataFrame({"idx": other.index})
      index = idx1.merge(idx2, how="outer").sort_values("idx")["idx"]
      index.name = None
  
      # Align the two GeoSeries
      aligned_left = self._align_to_index(index)
      aligned_right = other._align_to_index(index)
  
      # If the two GeoSeries have the same length, keep the original index
      # Otherwise, use the union of the two indices
      if len(other) == len(aligned_right):
          aligned_right.index = other.index
      else:
          aligned_right.index = index
      if len(self) == len(aligned_left):
          aligned_left.index = self.index
      else:
          aligned_left.index = index
  
      # Aligned GeoSeries are sorted by index
      aligned_right = aligned_right.sort_index()
      aligned_left = aligned_left.sort_index()
      return (
          aligned_left,
          aligned_right,
      )
  
imports: from functools import cached_property
  from numbers import Integral
  from typing import Optional, Tuple, TypeVar, Union
  import cupy
  import geopandas
  import numpy
  import pandas
  import pyarrow
  from geopandas.geoseries import GeoSeries
  from shapely.geometry import LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon
  from shapely.geometry.base import BaseGeometry, BaseMultipartGeometry
  import cudf
  from cudf._typing import ColumnLike
  from cudf.core.column.column import as_column
  from cudf.core.copy_types import GatherMap
  import cuspatial.io.pygeoarrow
  from cuspatial.core._column.geocolumn import ColumnType, GeoColumn
  from cuspatial.core._column.geometa import Feature_Enum, GeoMeta
  from cuspatial.core.binops.distance_dispatch import DistanceDispatch
  from cuspatial.core.binpreds.binpred_dispatch import CONTAINS_DISPATCH, CONTAINS_PROPERLY_DISPATCH, COVERS_DISPATCH, CROSSES_DISPATCH, DISJOINT_DISPATCH, EQUALS_DISPATCH, INTERSECTS_DISPATCH, OVERLAPS_DISPATCH, TOUCHES_DISPATCH, WITHIN_DISPATCH
  from cuspatial.utils.column_utils import contains_only_linestrings, contains_only_multipoints, contains_only_points, contains_only_polygons
label_desc: Use image node_id 27 for calling the GeoSeries obj's underlying member method code with example usage: obj.align(other) and returns: aligned_left,  aligned_right, self,  other