here.geopandas_adapter.utils.geo module

here.geopandas_adapter.utils.geo module

Utilities to convert geometries for use with GeoPandas

here.geopandas_adapter.utils.geo.to_geometry(x) BaseGeometry | None

Convert an object to a shapely geometry for use with geopandas.

This is used to convert columns of a variety of types to geopandas’ geometry type.

Supported formats:

- None passed through as None

  • str containing a geometry in GeoJSON format
  • str containing a geometry in WKT format
  • object with __geo_interface__
  • a Mapping in the format of a GeoJSON geometry
  • a BaseGeometry, returned unchanged
  • an object in a supported, non-standard format. For more information

please see here.platform.utils.geo.is_nonstandard_geometry

Parameters:
x – the object to convert

Returns:
the object converted to a shapely geometry

Raises:
ValueError – in case the object cannot be converted