pandera.engines.geopandas_engine.Geometry

class pandera.engines.geopandas_engine.Geometry(crs=None)[source]

Semantic representation of geopandas geopandas.array.GeometryDtype.

Extends the native GeometryDtype by allowing designation of a coordinate reference system (CRS) as found on GeometryArray, GeoSeries, and GeoDataFrame. When the CRS is defined, validator will check for matching CRS, and coerce will transform coordinate values via GeoPandas’ ‘to_crs’ method. Otherwise, CRS of data is ignored.

Attributes

auto_coerce

Whether to force coerce to be True in all cases

continuous

Whether the number data type is continuous.

crs

Coordinate Reference System of the geometry objects.

type

Native pandas dtype boxed by the data type.

Methods

__init__(crs=None)[source]
check(pandera_dtype, data_container=None)[source]

Check data container to the specified data type.

Return type:

Union[bool, Iterable[bool]]

coerce(data_container)[source]

Coerce data container to the specified data type.

Return type:

Union[Series, DataFrame, GeoSeries, GeoDataFrame]

coerce_value(value)[source]

Coerce an value to a particular type.

Return type:

Any

try_coerce(data_container)[source]

Coerce data container to the data type, raises a ParserError if the coercion fails :raises: ParserError: if coercion fails

Return type:

Union[Series, DataFrame]

__call__(data_container)[source]

Coerce data container to the data type.