easy_vic_build.tools.geo_func.create_gdf
GeoDataFrame construction helpers for common geometry types.
Functions
|
Demonstrate GeoDataFrame creation from a sample boundary file. |
Demonstrate polygon creation for MOPEX basin boundary files. |
Classes
|
Build GeoDataFrames from coordinate arrays. |
- class easy_vic_build.tools.geo_func.create_gdf.CreateGDF(info='')[source]
Bases:
objectBuild 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
CreateGDFinstance.- Parameters:
info (str, optional) – Optional metadata string.
- __init__(info='')[source]
Initialize a
CreateGDFinstance.- 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
detis 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 polygongeometry.- 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 pointgeometry.- 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
lonby 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
IDand polygongeometry.- Return type:
geopandas.GeoDataFrame