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.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output values.
geodesic_length
method descriptor
¶
geodesic_length() -> Float64Array
Determine the length of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013). As opposed to older methods like Vincenty, this method is accurate to a few nanometers and always converges.
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.
haversine_length
method descriptor
¶
haversine_length()
Determine the length of a geometry using the haversine formula.
Note: this implementation uses a mean earth radius of 6371.088 km, based on the recommendation of the IUGG
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()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float) -> Self
Simplifies a geometry.
The Ramer–Douglas–Peucker algorithm simplifies a linestring. Polygons are simplified by running the RDP algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology.
Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
Returns:
-
Self
–Simplified geometry array.
simplify_vw
method descriptor
¶
simplify_vw(epsilon: float) -> Self
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm
See here for a graphical explanation
Polygons are simplified by running the algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology. Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
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_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
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
vincenty_length
method descriptor
¶
vincenty_length()
Determine the length of a geometry using Vincenty’s formulae.
LineStringArray ¶
An immutable array of LineString geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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.
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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output values.
geodesic_length
method descriptor
¶
geodesic_length() -> Float64Array
Determine the length of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013). As opposed to older methods like Vincenty, this method is accurate to a few nanometers and always converges.
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.
haversine_length
method descriptor
¶
haversine_length()
Determine the length of a geometry using the haversine formula.
Note: this implementation uses a mean earth radius of 6371.088 km, based on the recommendation of the IUGG
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()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float) -> Self
Simplifies a geometry.
The Ramer–Douglas–Peucker algorithm simplifies a linestring. Polygons are simplified by running the RDP algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology.
Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
Returns:
-
Self
–Simplified geometry array.
simplify_vw
method descriptor
¶
simplify_vw(epsilon: float) -> Self
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm
See here for a graphical explanation
Polygons are simplified by running the algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology. Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
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_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
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
vincenty_length
method descriptor
¶
vincenty_length()
Determine the length of a geometry using Vincenty’s formulae.
PolygonArray ¶
An immutable array of Polygon geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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.
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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output 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
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()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float) -> Self
Simplifies a geometry.
The Ramer–Douglas–Peucker algorithm simplifies a linestring. Polygons are simplified by running the RDP algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology.
Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
Returns:
-
Self
–Simplified geometry array.
simplify_vw
method descriptor
¶
simplify_vw(epsilon: float) -> Self
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm
See here for a graphical explanation
Polygons are simplified by running the algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology. Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
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_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
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.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output values.
geodesic_length
method descriptor
¶
geodesic_length() -> Float64Array
Determine the length of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013). As opposed to older methods like Vincenty, this method is accurate to a few nanometers and always converges.
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.
haversine_length
method descriptor
¶
haversine_length()
Determine the length of a geometry using the haversine formula.
Note: this implementation uses a mean earth radius of 6371.088 km, based on the recommendation of the IUGG
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()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float) -> Self
Simplifies a geometry.
The Ramer–Douglas–Peucker algorithm simplifies a linestring. Polygons are simplified by running the RDP algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology.
Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
Returns:
-
Self
–Simplified geometry array.
simplify_vw
method descriptor
¶
simplify_vw(epsilon: float) -> Self
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm
See here for a graphical explanation
Polygons are simplified by running the algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology. Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
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_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
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
vincenty_length
method descriptor
¶
vincenty_length()
Determine the length of a geometry using Vincenty’s formulae.
MultiLineStringArray ¶
An immutable array of MultiLineString geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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.
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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output values.
geodesic_length
method descriptor
¶
geodesic_length() -> Float64Array
Determine the length of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013). As opposed to older methods like Vincenty, this method is accurate to a few nanometers and always converges.
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.
haversine_length
method descriptor
¶
haversine_length()
Determine the length of a geometry using the haversine formula.
Note: this implementation uses a mean earth radius of 6371.088 km, based on the recommendation of the IUGG
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()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float) -> Self
Simplifies a geometry.
The Ramer–Douglas–Peucker algorithm simplifies a linestring. Polygons are simplified by running the RDP algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology.
Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
Returns:
-
Self
–Simplified geometry array.
simplify_vw
method descriptor
¶
simplify_vw(epsilon: float) -> Self
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm
See here for a graphical explanation
Polygons are simplified by running the algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology. Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
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_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
translate
method descriptor
¶
translate(x_offset, y_offset)
Translate a Geometry along its axes by the given offsets
vincenty_length
method descriptor
¶
vincenty_length()
Determine the length of a geometry using Vincenty’s formulae.
MultiPolygonArray ¶
An immutable array of MultiPolygon geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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.
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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output 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
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()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
simplify
method descriptor
¶
simplify(epsilon: float) -> Self
Simplifies a geometry.
The Ramer–Douglas–Peucker algorithm simplifies a linestring. Polygons are simplified by running the RDP algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology.
Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
Returns:
-
Self
–Simplified geometry array.
simplify_vw
method descriptor
¶
simplify_vw(epsilon: float) -> Self
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm
See here for a graphical explanation
Polygons are simplified by running the algorithm on all their constituent rings. This may result in invalid Polygons, and has no guarantee of preserving topology. Multi* objects are simplified by simplifying all their constituent geometries individually.
An epsilon less than or equal to zero will return an unaltered version of the geometry.
Parameters:
-
epsilon
(float
) –tolerance for simplification.
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_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
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.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output 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
signed_area
method descriptor
¶
signed_area()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
GeometryCollectionArray ¶
An immutable array of GeometryCollection geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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.
area
method descriptor
¶
area() -> Float64Array
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.
chamberlain_duquette_signed_area
method descriptor
¶
chamberlain_duquette_signed_area() -> Float64Array
Calculate the signed approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area values.
chamberlain_duquette_unsigned_area
method descriptor
¶
chamberlain_duquette_unsigned_area() -> Float64Array
Calculate the unsigned approximate geodesic area of a Geometry
.
Returns:
-
Float64Array
–Array with area 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_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_area_signed
method descriptor
¶
geodesic_area_signed() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Feature standard. Alternative windings may result in a negative area. See "Interpreting negative area values" below.
- Polygons are assumed to be smaller than half the size of the earth. If you expect to be dealing
with polygons larger than this, please use the
unsigned
methods.
Units¶
- return value: meter²
Interpreting negative area values¶
A negative value can mean one of two things:
1. The winding of the polygon is in the clockwise direction (reverse winding). If this is the case, and you know the polygon is smaller than half the area of earth, you can take the absolute value of the reported area to get the correct area.
2. The polygon is larger than half the planet. In this case, the returned area of the polygon is not correct. If you expect to be dealing with very large polygons, please use the unsigned
methods.
Returns:
-
Float64Array
–Array with output values.
geodesic_area_unsigned
method descriptor
¶
geodesic_area_unsigned() -> Float64Array
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth.
This uses the geodesic measurement methods given by Karney (2013).
Assumptions¶
- Polygons are assumed to be wound in a counter-clockwise direction for the exterior ring and a clockwise direction for interior rings. This is the standard winding for geometries that follow the Simple Features standard. Using alternative windings will result in incorrect results.
Units¶
- return value: meter²
Returns:
-
Float64Array
–Array with output 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
signed_area
method descriptor
¶
signed_area()
Signed planar area of a geometry array
Returns:
-
–
Array with area values.
WKBArray ¶
An immutable array of WKB-encoded geometries using GeoArrow's in-memory representation.
__arrow_c_array__
method descriptor
¶
__arrow_c_array__(_requested_schema=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)
Construct this object from existing Arrow data
Parameters:
-
input
–Arrow array to use for constructing this object
Returns:
-
–
Self
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