xarray.Dataset.xvec.to_geopandas#

Dataset.xvec.to_geopandas()#

Convert this array into a GeoPandas GeoDataFrame

Returns a GeoDataFrame with coordinates based on a GeometryIndex set as an active geometry. The array needs to contain only a single geometry-based coordinate axis and can be 1D or 2D. Other cases are not supported.

Unlike to_pandas(), this always returns a GeoDataFrame with a single geometry column and one (1D array) or multiple (2D array) variable columns.

Only works for arrays with 2 or fewer dimensions.

Returns:
GeoDataFrame | DataFrame

GeoDataFrame with coordinates based on GeometryIndex set as an active geometry or pandas DataFrame with GeometryArrays

See also

to_geodataframe