easy_vic_build.tools.geo_func.create_gdf

GeoDataFrame construction helpers for common geometry types.

Functions

demo1()

Demonstrate GeoDataFrame creation from a sample boundary file.

mopex_basin()

Demonstrate polygon creation for MOPEX basin boundary files.

Classes

CreateGDF([info])

Build GeoDataFrames from coordinate arrays.

class easy_vic_build.tools.geo_func.create_gdf.CreateGDF(info='')[source]

Bases: object

Build GeoDataFrames from coordinate arrays.

_info

Optional metadata string attached to the instance.

Type:

str

createGDF_rectangle_central_coord(lon, lat, det, ID=None, crs='EPSG:4326')[source]

Build rectangular-cell polygons from center coordinates.

createGDF_points(lon, lat, ID=None, crs='EPSG:4326')[source]

Build point geometries from longitude/latitude pairs.

createGDF_polygons(lon, lat, ID=None, crs='EPSG:4326')[source]

Build polygon geometries from per-feature vertex coordinates.

Initialize a CreateGDF instance.

Parameters:

info (str, optional) – Optional metadata string.

__init__(info='')[source]

Initialize a CreateGDF instance.

Parameters:

info (str, optional) – Optional metadata string.

createGDF_rectangle_central_coord(lon, lat, det, ID=None, crs='EPSG:4326')[source]

Create rectangular polygons from center coordinates.

Parameters:
  • lon (array-like) – Longitude of cell centers.

  • lat (array-like) – Latitude of cell centers.

  • det (float) – Cell size (in coordinate units). A square with side det is generated around each center point.

  • ID (array-like, optional) – Row identifiers. If None, DataFrame index values are used.

  • crs (str, optional) – Coordinate reference system. Default is "EPSG:4326".

Returns:

GeoDataFrame with clon, clat, ID, and polygon geometry.

Return type:

geopandas.GeoDataFrame

createGDF_points(lon, lat, ID=None, crs='EPSG:4326')[source]

Create point geometries from longitude/latitude coordinates.

Parameters:
  • lon (array-like) – Point longitudes.

  • lat (array-like) – Point latitudes.

  • ID (array-like, optional) – Row identifiers. If None, DataFrame index values are used.

  • crs (str, optional) – Coordinate reference system. Default is "EPSG:4326".

Returns:

GeoDataFrame with lon, lat, ID, and point geometry.

Return type:

geopandas.GeoDataFrame

createGDF_polygons(lon, lat, ID=None, crs='EPSG:4326')[source]

Create polygons from per-feature vertex coordinates.

Parameters:
  • lon (list of array-like) – Per-polygon longitude sequences. Each element defines one polygon.

  • lat (list of array-like) – Per-polygon latitude sequences. Must align with lon by index.

  • ID (array-like, optional) – Row identifiers. If None, DataFrame index values are used.

  • crs (str, optional) – Coordinate reference system. Default is "EPSG:4326".

Returns:

GeoDataFrame with ID and polygon geometry.

Return type:

geopandas.GeoDataFrame

static plot()[source]

Placeholder for future plotting helper.

easy_vic_build.tools.geo_func.create_gdf.demo1()[source]

Demonstrate GeoDataFrame creation from a sample boundary file.

Returns:

This function only demonstrates plotting and printing outputs.

Return type:

None

easy_vic_build.tools.geo_func.create_gdf.mopex_basin()[source]

Demonstrate polygon creation for MOPEX basin boundary files.

Returns:

This function only demonstrates plotting and printing outputs.

Return type:

None