polartoolkit.region_to_df#
- region_to_df(region, coord_names=('easting', 'northing'), reverse=False)[source]#
Convert region bounds in format [xmin, xmax, ymin, ymax] to pandas dataframe with coordinates of region corners, or reverse this if reverse is True.
- Parameters:
region (
tuple[float,float,float,float] |DataFrame) โ bounding region in format [xmin, xmax, ymin, ymax] or, if reverse is True, a DataFrame with coordinate columns with names set by cood_namescoord_names (
tuple[str,str]) โ names of input or output coordinate columns, by default (โeastingโ, โnorthingโ)reverse (
bool) โ If True, convert from df to region tuple, else, convert from region tuple to df, by default False
- Returns:
Dataframe with easting and northing columns, and a row for each corner of the region, or, if reverse is True, an array in the format [xmin, xmax, ymin, ymax].
- Return type: