Geometry Arrays¶
The classes on this page represent arrays of geospatial geometries.
PointArray
LineStringArray
PolygonArray
MultiPointArray
MultiLineStringArray
MultiPolygonArray
MixedGeometryArray
GeometryCollectionArray
WKBArray
RectArray
geoarrow.rust.core ¶
PointArray ¶
An immutable array of Point geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.PointArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_ragged_array
, including numpy object arrays and
geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
from_xy
builtin
¶
from_xy(x: ArrowArrayExportable | NumpyArrayProtocolf64, y: ArrowArrayExportable | NumpyArrayProtocolf64) -> Self
Construct a PointArray from arrays of x and y values
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
length
method descriptor
¶
length(*, method: LengthMethod | LengthMethodT = 'euclidean') -> Float64Array
Calculation of the length of a Line
Other Parameters:
-
method
(LengthMethod | LengthMethodT
) –The method to use for length calculation. One of "Ellipsoidal", "Euclidean", "Haversine", or "Vincenty". Refer to the documentation on LengthMethod for more information.
Returns:
-
Float64Array
–Array with length values.
rotate_around_center
method descriptor
¶
rotate_around_center(degrees)
Rotate a geometry around the center of its bounding box by an angle, in degrees.
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
rotate_around_centroid
method descriptor
¶
rotate_around_centroid(degrees)
Rotate a geometry around its centroid by an angle, in degrees
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
scale_xy
method descriptor
¶
scale_xy(x_factor, y_factor)
Scale a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float, *, method: SimplifyMethod | SimplifyMethodT = 'rdp') -> Self
Simplifies a geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification. An epsilon less than or equal to zero will return an unaltered version of the geometry.
Other Parameters:
-
method
(SimplifyMethod | SimplifyMethodT
) –The method to use for simplification calculation. One of
"rdp"
,"vw"
, or"vw_preserve"
. Refer to the documentation on SimplifyMethod for more information.
Returns:
-
Self
–Simplified geometry array.
skew
method descriptor
¶
skew(degrees)
An affine transformation which skews a geometry, sheared by a uniform angle along the x and y dimensions.
skew_xy
method descriptor
¶
skew_xy(degrees_x, degrees_y)
Skew a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
to_wkb
method descriptor
¶
to_wkb() -> WKBArray
Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.
Returns:
-
WKBArray
–An array with WKB-formatted geometries
total_bounds
method descriptor
¶
total_bounds() -> Tuple[float, float, float, float]
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
LineStringArray ¶
An immutable array of LineString geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.LineStringArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
chaikin_smoothing
method descriptor
¶
chaikin_smoothing(n_iterations: int) -> Self
Smoothen LineString
, Polygon
, MultiLineString
and MultiPolygon
using Chaikins algorithm.
Each iteration of the smoothing doubles the number of vertices of the geometry, so in some cases it may make sense to apply a simplification afterwards to remove insignificant coordinates.
This implementation preserves the start and end vertices of an open linestring and smoothes the corner between start and end of a closed linestring.
Parameters:
-
n_iterations
(int
) –Number of iterations to use for smoothing.
Returns:
-
Self
–Smoothed geometry array.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
densify
method descriptor
¶
densify(max_distance: float) -> Self
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
frechet_distance
method descriptor
¶
frechet_distance(other: BroadcastGeometry) -> Float64Array
Determine the similarity between two arrays of LineStrings
using the Frechet distance.
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.
This implementation is based on Computing Discrete Frechet Distance by T. Eiter and H. Mannila.
Parameters:
-
other
(BroadcastGeometry
) –the geometry or geometry array to compare against. This must contain geometries of `LineString`` type. A variety of inputs are accepted:
- A scalar
LineString
- A
LineStringArray
- A
ChunkedLineStringArray
- Any Python class that implements the Geo Interface, such as a
shapely
LineString - Any GeoArrow array or chunked array of
LineString
type
- A scalar
Returns:
-
Float64Array
–Array with float distance values.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_ragged_array
, including numpy object arrays and
geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
length
method descriptor
¶
length(*, method: LengthMethod | LengthMethodT = 'euclidean') -> Float64Array
Calculation of the length of a Line
Other Parameters:
-
method
(LengthMethod | LengthMethodT
) –The method to use for length calculation. One of "Ellipsoidal", "Euclidean", "Haversine", or "Vincenty". Refer to the documentation on LengthMethod for more information.
Returns:
-
Float64Array
–Array with length values.
line_interpolate_point
method descriptor
¶
line_interpolate_point(fraction: float | int | ArrowArrayExportable | NumpyArrayProtocolf64) -> PointArray
Returns a point interpolated at given distance on a line.
This is intended to be equivalent to shapely.line_interpolate_point
when
normalized=True
.
If the given fraction is
* less than zero (including negative infinity): returns the starting point
* greater than one (including infinity): returns the ending point
* If either the fraction is NaN, or any coordinates of the line are not
finite, returns Point EMPTY
.
Parameters:
-
input
–input geometry array or chunked geometry array
-
fraction
(float | int | ArrowArrayExportable | NumpyArrayProtocolf64
) –the fractional distance along the line. A variety of inputs are accepted:
- A Python
float
orint
- A numpy
ndarray
withfloat64
data type. - An Arrow array or chunked array with
float64
data type.
- A Python
Returns:
-
PointArray
–PointArray with result values
line_locate_point
method descriptor
¶
line_locate_point(point: GeoInterfaceProtocol | ArrowArrayExportable) -> Float64Array
Returns a fraction of the line's total length representing the location of the closest point on the line to the given point.
This is intended to be equivalent to shapely.line_locate_point
when
normalized=True
.
If the line has zero length the fraction returned is zero.
If either the point's coordinates or any coordinates of the line
are not finite, returns NaN
.
Parameters:
-
input
–input geometry array or chunked geometry array
-
point
(GeoInterfaceProtocol | ArrowArrayExportable
) –the fractional distance along the line. A variety of inputs are accepted:
- A scalar
Point
- A
PointArray
- A
ChunkedPointArray
- Any Python class that implements the Geo Interface, such as a
shapely
Point - Any GeoArrow array or chunked array of
Point
type
- A scalar
Returns:
-
Float64Array
–Array with float fraction values.
rotate_around_center
method descriptor
¶
rotate_around_center(degrees)
Rotate a geometry around the center of its bounding box by an angle, in degrees.
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
rotate_around_centroid
method descriptor
¶
rotate_around_centroid(degrees)
Rotate a geometry around its centroid by an angle, in degrees
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
scale_xy
method descriptor
¶
scale_xy(x_factor, y_factor)
Scale a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float, *, method: SimplifyMethod | SimplifyMethodT = 'rdp') -> Self
Simplifies a geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification. An epsilon less than or equal to zero will return an unaltered version of the geometry.
Other Parameters:
-
method
(SimplifyMethod | SimplifyMethodT
) –The method to use for simplification calculation. One of
"rdp"
,"vw"
, or"vw_preserve"
. Refer to the documentation on SimplifyMethod for more information.
Returns:
-
Self
–Simplified geometry array.
skew
method descriptor
¶
skew(degrees)
An affine transformation which skews a geometry, sheared by a uniform angle along the x and y dimensions.
skew_xy
method descriptor
¶
skew_xy(degrees_x, degrees_y)
Skew a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
to_wkb
method descriptor
¶
to_wkb() -> WKBArray
Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.
Returns:
-
WKBArray
–An array with WKB-formatted geometries
total_bounds
method descriptor
¶
total_bounds() -> Tuple[float, float, float, float]
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
PolygonArray ¶
An immutable array of Polygon geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.PolygonArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
chaikin_smoothing
method descriptor
¶
chaikin_smoothing(n_iterations: int) -> Self
Smoothen LineString
, Polygon
, MultiLineString
and MultiPolygon
using Chaikins algorithm.
Each iteration of the smoothing doubles the number of vertices of the geometry, so in some cases it may make sense to apply a simplification afterwards to remove insignificant coordinates.
This implementation preserves the start and end vertices of an open linestring and smoothes the corner between start and end of a closed linestring.
Parameters:
-
n_iterations
(int
) –Number of iterations to use for smoothing.
Returns:
-
Self
–Smoothed geometry array.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
densify
method descriptor
¶
densify(max_distance: float) -> Self
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_ragged_array
, including numpy object arrays and
geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
polylabel
method descriptor
¶
polylabel(tolerance: float) -> PointArray
Calculate a Polygon's ideal label position by calculating its pole of inaccessibility.
The pole of inaccessibility is the most distant internal point from the polygon outline (not to be confused with centroid), and is useful for optimal placement of a text label on a polygon.
The calculation uses an iterative grid-based algorithm, ported from the original JavaScript implementation.
Parameters:
-
tolerance
(float
) –precision of algorithm. Refer to the original JavaScript documentation for more information
Returns:
-
PointArray
–PointArray with result values
rotate_around_center
method descriptor
¶
rotate_around_center(degrees)
Rotate a geometry around the center of its bounding box by an angle, in degrees.
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
rotate_around_centroid
method descriptor
¶
rotate_around_centroid(degrees)
Rotate a geometry around its centroid by an angle, in degrees
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
scale_xy
method descriptor
¶
scale_xy(x_factor, y_factor)
Scale a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float, *, method: SimplifyMethod | SimplifyMethodT = 'rdp') -> Self
Simplifies a geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification. An epsilon less than or equal to zero will return an unaltered version of the geometry.
Other Parameters:
-
method
(SimplifyMethod | SimplifyMethodT
) –The method to use for simplification calculation. One of
"rdp"
,"vw"
, or"vw_preserve"
. Refer to the documentation on SimplifyMethod for more information.
Returns:
-
Self
–Simplified geometry array.
skew
method descriptor
¶
skew(degrees)
An affine transformation which skews a geometry, sheared by a uniform angle along the x and y dimensions.
skew_xy
method descriptor
¶
skew_xy(degrees_x, degrees_y)
Skew a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
to_wkb
method descriptor
¶
to_wkb() -> WKBArray
Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.
Returns:
-
WKBArray
–An array with WKB-formatted geometries
total_bounds
method descriptor
¶
total_bounds() -> Tuple[float, float, float, float]
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
MultiPointArray ¶
An immutable array of MultiPoint geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.MultiPointArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_ragged_array
, including numpy object arrays and
geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
length
method descriptor
¶
length(*, method: LengthMethod | LengthMethodT = 'euclidean') -> Float64Array
Calculation of the length of a Line
Other Parameters:
-
method
(LengthMethod | LengthMethodT
) –The method to use for length calculation. One of "Ellipsoidal", "Euclidean", "Haversine", or "Vincenty". Refer to the documentation on LengthMethod for more information.
Returns:
-
Float64Array
–Array with length values.
rotate_around_center
method descriptor
¶
rotate_around_center(degrees)
Rotate a geometry around the center of its bounding box by an angle, in degrees.
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
rotate_around_centroid
method descriptor
¶
rotate_around_centroid(degrees)
Rotate a geometry around its centroid by an angle, in degrees
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
scale_xy
method descriptor
¶
scale_xy(x_factor, y_factor)
Scale a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float, *, method: SimplifyMethod | SimplifyMethodT = 'rdp') -> Self
Simplifies a geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification. An epsilon less than or equal to zero will return an unaltered version of the geometry.
Other Parameters:
-
method
(SimplifyMethod | SimplifyMethodT
) –The method to use for simplification calculation. One of
"rdp"
,"vw"
, or"vw_preserve"
. Refer to the documentation on SimplifyMethod for more information.
Returns:
-
Self
–Simplified geometry array.
skew
method descriptor
¶
skew(degrees)
An affine transformation which skews a geometry, sheared by a uniform angle along the x and y dimensions.
skew_xy
method descriptor
¶
skew_xy(degrees_x, degrees_y)
Skew a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
to_wkb
method descriptor
¶
to_wkb() -> WKBArray
Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.
Returns:
-
WKBArray
–An array with WKB-formatted geometries
total_bounds
method descriptor
¶
total_bounds() -> Tuple[float, float, float, float]
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
MultiLineStringArray ¶
An immutable array of MultiLineString geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.MultiLineStringArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
chaikin_smoothing
method descriptor
¶
chaikin_smoothing(n_iterations: int) -> Self
Smoothen LineString
, Polygon
, MultiLineString
and MultiPolygon
using Chaikins algorithm.
Each iteration of the smoothing doubles the number of vertices of the geometry, so in some cases it may make sense to apply a simplification afterwards to remove insignificant coordinates.
This implementation preserves the start and end vertices of an open linestring and smoothes the corner between start and end of a closed linestring.
Parameters:
-
n_iterations
(int
) –Number of iterations to use for smoothing.
Returns:
-
Self
–Smoothed geometry array.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
densify
method descriptor
¶
densify(max_distance: float) -> Self
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_ragged_array
, including numpy object arrays and
geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
length
method descriptor
¶
length(*, method: LengthMethod | LengthMethodT = 'euclidean') -> Float64Array
Calculation of the length of a Line
Other Parameters:
-
method
(LengthMethod | LengthMethodT
) –The method to use for length calculation. One of "Ellipsoidal", "Euclidean", "Haversine", or "Vincenty". Refer to the documentation on LengthMethod for more information.
Returns:
-
Float64Array
–Array with length values.
rotate_around_center
method descriptor
¶
rotate_around_center(degrees)
Rotate a geometry around the center of its bounding box by an angle, in degrees.
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
rotate_around_centroid
method descriptor
¶
rotate_around_centroid(degrees)
Rotate a geometry around its centroid by an angle, in degrees
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
scale_xy
method descriptor
¶
scale_xy(x_factor, y_factor)
Scale a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float, *, method: SimplifyMethod | SimplifyMethodT = 'rdp') -> Self
Simplifies a geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification. An epsilon less than or equal to zero will return an unaltered version of the geometry.
Other Parameters:
-
method
(SimplifyMethod | SimplifyMethodT
) –The method to use for simplification calculation. One of
"rdp"
,"vw"
, or"vw_preserve"
. Refer to the documentation on SimplifyMethod for more information.
Returns:
-
Self
–Simplified geometry array.
skew
method descriptor
¶
skew(degrees)
An affine transformation which skews a geometry, sheared by a uniform angle along the x and y dimensions.
skew_xy
method descriptor
¶
skew_xy(degrees_x, degrees_y)
Skew a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
to_wkb
method descriptor
¶
to_wkb() -> WKBArray
Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.
Returns:
-
WKBArray
–An array with WKB-formatted geometries
total_bounds
method descriptor
¶
total_bounds() -> Tuple[float, float, float, float]
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
MultiPolygonArray ¶
An immutable array of MultiPolygon geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.MultiPolygonArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
chaikin_smoothing
method descriptor
¶
chaikin_smoothing(n_iterations: int) -> Self
Smoothen LineString
, Polygon
, MultiLineString
and MultiPolygon
using Chaikins algorithm.
Each iteration of the smoothing doubles the number of vertices of the geometry, so in some cases it may make sense to apply a simplification afterwards to remove insignificant coordinates.
This implementation preserves the start and end vertices of an open linestring and smoothes the corner between start and end of a closed linestring.
Parameters:
-
n_iterations
(int
) –Number of iterations to use for smoothing.
Returns:
-
Self
–Smoothed geometry array.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
densify
method descriptor
¶
densify(max_distance: float) -> Self
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_ragged_array
, including numpy object arrays and
geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
rotate_around_center
method descriptor
¶
rotate_around_center(degrees)
Rotate a geometry around the center of its bounding box by an angle, in degrees.
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
rotate_around_centroid
method descriptor
¶
rotate_around_centroid(degrees)
Rotate a geometry around its centroid by an angle, in degrees
Positive angles are counter-clockwise, and negative angles are clockwise rotations.
scale_xy
method descriptor
¶
scale_xy(x_factor, y_factor)
Scale a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float, *, method: SimplifyMethod | SimplifyMethodT = 'rdp') -> Self
Simplifies a geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification. An epsilon less than or equal to zero will return an unaltered version of the geometry.
Other Parameters:
-
method
(SimplifyMethod | SimplifyMethodT
) –The method to use for simplification calculation. One of
"rdp"
,"vw"
, or"vw_preserve"
. Refer to the documentation on SimplifyMethod for more information.
Returns:
-
Self
–Simplified geometry array.
skew
method descriptor
¶
skew(degrees)
An affine transformation which skews a geometry, sheared by a uniform angle along the x and y dimensions.
skew_xy
method descriptor
¶
skew_xy(degrees_x, degrees_y)
Skew a geometry from it's bounding box center, using different values for
x_factor
and y_factor
to distort the geometry's aspect
ratio.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
to_wkb
method descriptor
¶
to_wkb() -> WKBArray
Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.
Returns:
-
WKBArray
–An array with WKB-formatted geometries
total_bounds
method descriptor
¶
total_bounds() -> Tuple[float, float, float, float]
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
MixedGeometryArray ¶
An immutable array of Geometry geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.MixedGeometryArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_ewkb
builtin
¶
from_ewkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from EWKB to its GeoArrow-native counterpart.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding EWKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_wkb
, including numpy
object arrays and geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
from_wkt
builtin
¶
from_wkt(input: ArrowArrayExportable) -> Self
Parse an Arrow StringArray from WKT to its GeoArrow-native counterpart.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of string type holding WKT-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
GeometryCollectionArray ¶
An immutable array of GeometryCollection geometries using GeoArrow's in-memory representation.
__geo_interface__ ¶
__geo_interface__: dict = <attribute '__geo_interface__' of 'geoarrow.rust.core._rust.GeometryCollectionArray' objects>
Implements the "geo interface protocol".
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
affine_transform
method descriptor
¶
affine_transform(transform)
Apply an affine transformation to geometries.
This is intended to be equivalent to shapely.affinity.affine_transform
for 2D
transforms.
Parameters:
-
other
–an affine transformation to apply to all geometries.
This integrates with the
affine
Python library, and most users should use that integration, though it allows any input that is a tuple with 6 or 9 float values.
Returns:
-
–
New GeoArrow array or chunked array with the same type as input and with
-
–
transformed coordinates.
area
method descriptor
¶
area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Unsigned area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
center
method descriptor
¶
center() -> PointArray
Compute the center of geometries
This first computes the axis-aligned bounding rectangle, then takes the center of that box
Returns:
-
PointArray
–Array with center values.
centroid
method descriptor
¶
centroid() -> PointArray
Calculation of the centroid.
The centroid is the arithmetic mean position of all points in the shape. Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
The geometric centroid of a convex object always lies in the object. A non-convex object might have a centroid that is outside the object itself.
Returns:
-
PointArray
–Array with centroid values.
convex_hull
method descriptor
¶
convex_hull() -> PolygonArray
Returns the convex hull of a Polygon. The hull is always oriented counter-clockwise.
This implementation uses the QuickHull algorithm, based on Barber, C. Bradford; Dobkin, David P.; Huhdanpaa, Hannu (1 December 1996) Original paper here: www.cs.princeton.edu/~dpd/Papers/BarberDobkinHuhdanpaa.pdf
Returns:
-
PolygonArray
–Array with convex hull polygons.
envelope
method descriptor
¶
envelope()
Computes the minimum axis-aligned bounding box that encloses an input geometry
Returns:
-
–
Array with axis-aligned bounding boxes.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_ewkb
builtin
¶
from_ewkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from EWKB to its GeoArrow-native counterpart.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding EWKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_wkb
, including numpy
object arrays and geopandas.GeoSeries
Returns:
A new array.
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> Self
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
from_wkt
builtin
¶
from_wkt(input: ArrowArrayExportable) -> Self
Parse an Arrow StringArray from WKT to its GeoArrow-native counterpart.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of string type holding WKT-formatted geometries.
Returns:
-
Self
–A GeoArrow-native geometry array
geodesic_perimeter
method descriptor
¶
geodesic_perimeter() -> Float64Array
Determine the perimeter of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
For a polygon this returns the sum of the perimeter of the exterior ring and interior rings.
To get the perimeter of just the exterior ring of a polygon, do polygon.exterior().geodesic_length()
.
Units¶
- return value: meter
Returns:
-
Float64Array
–Array with output values.
is_empty
method descriptor
¶
is_empty() -> BooleanArray
signed_area
method descriptor
¶
signed_area(*, method: AreaMethod | AreaMethodT = 'euclidean') -> Float64Array
Signed area of a geometry array
Parameters:
-
method
(AreaMethod | AreaMethodT
, default:'euclidean'
) –The method to use for area calculation. One of "Ellipsoidal", "Euclidean", or "Spherical". Refer to the documentation on AreaMethod for more information.
Returns:
-
Float64Array
–Array with area values.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
WKBArray ¶
An immutable array of WKB-encoded geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema: object | None = None) -> Tuple[object, object]
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
from_arrow
builtin
¶
from_arrow(input: ArrowArrayExportable) -> Self
Construct this object from existing Arrow data
Parameters:
-
input
(ArrowArrayExportable
) –Arrow array to use for constructing this object
Returns:
-
Self
–Self
from_shapely
builtin
¶
from_shapely(input) -> Self
Create this array from a shapely array
Args:
input: Any array object accepted by shapely.to_wkb
, including numpy
object arrays and geopandas.GeoSeries
Returns:
A new array.
to_shapely
method descriptor
¶
to_shapely() -> NDArray[np.object_]
Convert this array to a shapely array
Returns:
A shapely array.
RectArray ¶
An immutable array of Rect geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(requested_schema=None)
An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.
For example, you can call pyarrow.array()
to convert this array
into a pyarrow array, without copying memory.
to_polygon_array
method descriptor
¶
to_polygon_array() -> PolygonArray