Skip to content

Commit bc68baa

Browse files
committed
Add _concatenator method to GeometryBlock
Following on pandas-dev/pandas#17728
1 parent d5ef041 commit bc68baa

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

geopandas/_block.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
from pandas.core.common import is_null_slice
77
from shapely.geometry.base import geom_factory, BaseGeometry
88

9-
from .vectorized import GeometryArray, to_shapely
9+
from .vectorized import GeometryArray, to_shapely, concat
1010

1111

1212
class GeometryBlock(NonConsolidatableMixIn, Block):
13-
""" implement a geometry block with uint pointers to C objects
14-
as underlying data"""
13+
""" Pandas Geometry block with pointers to C GEOS objects """
1514
__slots__ = ()
1615

16+
_concatenator = concat
17+
1718
@property
1819
def _holder(self):
1920
return GeometryArray

geopandas/vectorized.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,9 @@ cpdef cysjoin(np.ndarray[np.uintp_t, ndim=1, cast=True] left,
15661566
return left_out, right_out
15671567

15681568

1569-
def concat(L):
1569+
def concat(L, axis=0):
1570+
if axis != 0:
1571+
raise NotImplementedError("Can only concatenate geometries along axis=0")
15701572
L = list(L)
15711573
x = np.concatenate([ga.data for ga in L])
15721574
return GeometryArray(x, base=set(L))

0 commit comments

Comments
 (0)