@@ -17,6 +17,7 @@ from geopandas.sindex import SpatialIndex
1717
1818_ScalarType = TypeVar ("_ScalarType" , bound = np .generic )
1919_Array1D : TypeAlias = np .ndarray [tuple [int ], np .dtype [_ScalarType ]]
20+ _Array2D : TypeAlias = np .ndarray [tuple [int , int ], np .dtype [_ScalarType ]]
2021_ArrayOrGeom : TypeAlias = GeometryArray | ArrayLike | Geometry
2122
2223TransformerFromCRS = Transformer .from_crs
@@ -89,14 +90,14 @@ class GeometryArray(ExtensionArray):
8990 @property
9091 def has_z (self ) -> _Array1D [np .bool ]: ...
9192 @property
92- def geom_type (self ) -> _Array1D [np .int64 ]: ...
93+ def geom_type (self ) -> _Array1D [np .str_ ]: ...
9394 @property
9495 def area (self ) -> _Array1D [np .float64 ]: ...
9596 @property
9697 def length (self ) -> _Array1D [np .float64 ]: ...
97- def count_coordinates (self ) -> _Array1D [np .int64 ]: ...
98- def count_geometries (self ) -> _Array1D [np .int64 ]: ...
99- def count_interior_rings (self ) -> _Array1D [np .int64 ]: ...
98+ def count_coordinates (self ) -> _Array1D [np .int32 ]: ...
99+ def count_geometries (self ) -> _Array1D [np .int32 ]: ...
100+ def count_interior_rings (self ) -> _Array1D [np .int32 ]: ...
100101 def get_precision (self ) -> _Array1D [np .float64 ]: ...
101102 def get_geometry (self , index : SupportsIndex | ArrayLike ) -> _Array1D [np .object_ ]: ...
102103 @property
@@ -163,18 +164,19 @@ class GeometryArray(ExtensionArray):
163164 def snap (self , other : _ArrayOrGeom , tolerance : float | ArrayLike ) -> GeometryArray : ...
164165 def shared_paths (self , other : _ArrayOrGeom ) -> GeometryArray : ...
165166 def distance (self , other : _ArrayOrGeom ) -> _Array1D [np .float64 ]: ...
166- def hausdorff_distance (self , other : _ArrayOrGeom , ** kwargs : Any ) -> _Array1D [np .float64 ]: ...
167+ def hausdorff_distance (self , other : _ArrayOrGeom , ** kwargs ) -> _Array1D [np .float64 ]: ...
167168 def frechet_distance (self , other : _ArrayOrGeom , ** kwargs ) -> _Array1D [np .float64 ]: ...
168169 def buffer (self , distance : float | ArrayLike , resolution : int = 16 , ** kwargs ) -> GeometryArray : ...
169- def interpolate (self , distance , normalized : bool = False ) -> GeometryArray : ...
170+ def interpolate (self , distance : float | ArrayLike , normalized : bool = False ) -> GeometryArray : ...
170171 def simplify (self , tolerance : float | ArrayLike , preserve_topology : bool = True ) -> GeometryArray : ...
171172 def project (self , other : _ArrayOrGeom , normalized : bool = False ) -> _Array1D [np .float64 ]: ...
172173 def relate (self , other : _ArrayOrGeom ) -> _Array1D [np .str_ ]: ...
173- def relate_pattern (self , other , pattern : str ) -> _Array1D [np .bool ]: ...
174+ def relate_pattern (self , other : _ArrayOrGeom , pattern : str ) -> _Array1D [np .bool ]: ...
175+ @deprecated ("Use method `union_all` instead." )
174176 def unary_union (self ) -> BaseGeometry : ...
175177 def union_all (self , method : Literal ["coverage" , "unary" ] = "unary" ) -> BaseGeometry : ...
176178 def intersection_all (self ) -> BaseGeometry : ...
177- def affine_transform (self , matrix : Incomplete ) -> GeometryArray : ...
179+ def affine_transform (self , matrix ) -> GeometryArray : ...
178180 def translate (self , xoff : float = 0.0 , yoff : float = 0.0 , zoff : float = 0.0 ) -> GeometryArray : ...
179181 def rotate (self , angle : float , origin : _AffinityOrigin = "center" , use_radians : bool = False ) -> GeometryArray : ...
180182 def scale (
@@ -192,7 +194,7 @@ class GeometryArray(ExtensionArray):
192194 @property
193195 def z (self ) -> _Array1D [np .float64 ]: ...
194196 @property
195- def bounds (self ) -> _Array1D [np .float64 ]: ...
197+ def bounds (self ) -> _Array2D [np .float64 ]: ...
196198 @property
197199 def total_bounds (self ) -> _Array1D [np .float64 ]: ...
198200 @property
@@ -215,7 +217,12 @@ class GeometryArray(ExtensionArray):
215217 limit : int | None = None ,
216218 copy : bool = True ,
217219 ) -> GeometryArray : ...
218- def astype (self , dtype : DTypeLike , copy : bool = True ) -> GeometryArray | ExtensionArray | NDArray [Any ]: ...
220+ @overload
221+ def astype (self , dtype : GeometryDtype , copy : bool = True ) -> GeometryArray : ...
222+ @overload
223+ def astype (self , dtype : ExtensionDtype | Literal ["string" ], copy : bool = True ) -> ExtensionArray : ... # type: ignore[overload-overlap]
224+ @overload
225+ def astype (self , dtype : DTypeLike , copy : bool = True ) -> _Array1D [Incomplete ]: ...
219226 def isna (self ) -> _Array1D [np .bool ]: ...
220227 def value_counts (self , dropna : bool = True ) -> pd .Series [int ]: ...
221228 def unique (self ) -> GeometryArray : ...
0 commit comments