rslearn.utils.get_utm_ups_crs¶
get_utm_ups_crs ¶
Utilities for working with UTM/UPS projections.
UPS_NORTH_THRESHOLD
module-attribute
¶
Use UPS North for latitudes north of this threshold.
UPS_SOUTH_THRESHOLD
module-attribute
¶
Use UPS South for latitudes south of this threshold.
get_utm_ups_crs ¶
Get the appropriate UTM or UPS CRS for a given lon/lat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lon
|
float
|
longitude in degrees |
required |
lat
|
float
|
latitude in degrees |
required |
Returns:
| Type | Description |
|---|---|
CRS
|
the rasterio CRS for the appropriate UTM or UPS zone |
Source code in rslearn/utils/get_utm_ups_crs.py
get_utm_ups_projection ¶
get_utm_ups_projection(lon: float, lat: float, x_resolution: float, y_resolution: float) -> Projection
Get the appropriate UTM or UPS Projection for a given lon/lat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lon
|
float
|
longitude in degrees |
required |
lat
|
float
|
latitude in degrees |
required |
x_resolution
|
float
|
desired x resolution in meters per pixel |
required |
y_resolution
|
float
|
desired y resolution in meters per pixel |
required |
Returns: the Projection object
Source code in rslearn/utils/get_utm_ups_crs.py
get_utm_zone_info ¶
Get UTM zone number (1 to 60) and S/N from CRS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
utm_crs
|
CRS
|
the UTM CRS. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int, str]
|
tuple of (utm_zone, "S" or "N") |
Source code in rslearn/utils/get_utm_ups_crs.py
get_wgs84_bounds ¶
Returns the bounding longitude and latitude of this UTM zone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
utm_crs
|
CRS
|
the UTM CRS. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int, int, int, int]
|
tuple (min_lon, min_lat, max_lon, max_lat) |
Source code in rslearn/utils/get_utm_ups_crs.py
get_proj_bounds ¶
Returns projection bounds of a UTM zone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
utm_crs
|
CRS
|
the UTM CRS. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float, float, float]
|
tuple (min_x, min_y, max_x, max_y) |