Skip to content

Geometry Type

geoarrow.rust.core.GeoType

A GeoArrow data type.

This implements the Arrow PyCapsule interface, allowing it to be seamlessly converted to other Arrow implementations.

Converting to pyarrow

geoarrow-types is recommended to register GeoArrow extension types into the pyarrow type registry.

from geoarrow.types.type_pyarrow import register_extension_types
from geoarrow.rust.core import point

pa.field(point("xy"))
# pyarrow.Field<: extension<geoarrow.point<PointType>>>

# You may want to set the name on the field upon importing:
pa.field(point("xy")).with_name("geometry")
# pyarrow.Field<geometry: extension<geoarrow.point<PointType>>>

# Because the extension types were registered from geoarrow-types,
# the resulting type is geoarrow-aware
pa.field(point("xy", crs="epsg:4326")).type.crs
# ProjJsonCrs(EPSG:4326)

coord_type property

coord_type: CoordType | None

The coordinate type of the type.

This will only be set if the type is a "native" GeoArrow type with a known coordinate type. Serialized arrays such as WKB/WKT arrays do not have a coordinate type.

crs property

crs: CRS | None

The CRS of the type.

dimension property

dimension: Dimension | None

The dimension of the type.

This will only be set if the type is a "native" GeoArrow type with a known dimension type. Geometry arrays and serialized arrays such as WKB/WKT arrays do not have a statically-known dimension.

edges property

edges: Edges | None

The edge interpolation of this type.

with_crs

with_crs(
    crs: CRSInput | None = None, *, edges: EdgesInput | None = None
) -> GeoType

Return a new type with the given CRS and edge interpolation.

Parameters:

  • crs (CRSInput | None, default: None ) –

    the CRS of the type. Defaults to None.

Other Parameters:

  • edges (EdgesInput | None) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.point

point(
    dimension: DimensionInput,
    *,
    coord_type: CoordTypeInput = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow Point array.

Parameters:

Other Parameters:

Examples:

from geoarrow.rust.core import point

point("xy")
# GeoType(Point(dimension="XY", coord_type="separated"))

point("xy", coord_type="interleaved")
# GeoType(Point(dimension="XY", coord_type="interleaved"))

geoarrow.rust.core.linestring

linestring(
    dimension: DimensionInput,
    *,
    coord_type: CoordTypeInput = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow LineString array.

Parameters:

Other Parameters:

geoarrow.rust.core.polygon

polygon(
    dimension: DimensionInput,
    *,
    coord_type: CoordTypeInput = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow Polygon array.

Parameters:

Other Parameters:

geoarrow.rust.core.multipoint

multipoint(
    dimension: DimensionInput,
    *,
    coord_type: CoordTypeInput = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow MultiPoint array.

Parameters:

Other Parameters:

geoarrow.rust.core.multilinestring

multilinestring(
    dimension: DimensionInput,
    *,
    coord_type: CoordTypeInput = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow MultiLineString array.

Parameters:

Other Parameters:

geoarrow.rust.core.multipolygon

multipolygon(
    dimension: DimensionInput,
    *,
    coord_type: CoordTypeInput = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow MultiPolygon array.

Parameters:

Other Parameters:

geoarrow.rust.core.geometry

geometry(
    *,
    coord_type: CoordType = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow Geometry array.

Other Parameters:

  • coord_type (CoordType) –

    The coordinate type of the array. Defaults to CoordType.SEPARATED.

  • crs (CRSInput | None) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.geometrycollection

geometrycollection(
    dimension: DimensionInput,
    *,
    coord_type: CoordTypeInput = SEPARATED,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow GeometryCollection array.

Parameters:

Other Parameters:

geoarrow.rust.core.box

box(
    dimension: DimensionInput,
    *,
    crs: CRSInput | None = None,
    edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow Box array.

Parameters:

Other Parameters:

  • crs (CRSInput | None) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.wkb

wkb(*, crs: CRSInput | None = None, edges: EdgesInput | None = None) -> GeoType

Create a new Arrow type for a GeoArrow WKB array.

This type is backed by an Arrow BinaryArray with i32 offsets, allowing a maximum array size of 2 GB per array chunk.

Parameters:

  • crs (CRSInput | None, default: None ) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None, default: None ) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.large_wkb

large_wkb(
    *, crs: CRSInput | None = None, edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow WKB array.

This type is backed by an Arrow LargeBinaryArray with i64 offsets, allowing more than 2GB of data per array chunk.

Parameters:

  • crs (CRSInput | None, default: None ) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None, default: None ) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.wkb_view

wkb_view(
    *, crs: CRSInput | None = None, edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow WKB array.

This type is backed by an Arrow BinaryViewArray.

Parameters:

  • crs (CRSInput | None, default: None ) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None, default: None ) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.wkt

wkt(*, crs: CRSInput | None = None, edges: EdgesInput | None = None) -> GeoType

Create a new Arrow type for a GeoArrow WKT array.

This type is backed by an Arrow StringArray with i32 offsets, allowing a maximum array size of 2 GB per array chunk.

Parameters:

  • crs (CRSInput | None, default: None ) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None, default: None ) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.large_wkt

large_wkt(
    *, crs: CRSInput | None = None, edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow WKT array.

This type is backed by an Arrow LargeString array with i64 offsets, allowing more than 2GB of data per array chunk.

Parameters:

  • crs (CRSInput | None, default: None ) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None, default: None ) –

    the edge interpolation of the type. Defaults to None.

geoarrow.rust.core.wkt_view

wkt_view(
    *, crs: CRSInput | None = None, edges: EdgesInput | None = None
) -> GeoType

Create a new Arrow type for a GeoArrow WKT array.

This type is backed by an Arrow StringView array.

Parameters:

  • crs (CRSInput | None, default: None ) –

    the CRS of the type. Defaults to None.

  • edges (EdgesInput | None, default: None ) –

    the edge interpolation of the type. Defaults to None.