Geospatial
geospatial
¶
Functions:¶
get_projected_CRS(lat, lon, assume_western_hem=True)
¶
Returns a projected Coordinate Reference System (CRS) based on latitude and longitude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat
|
float
|
Latitude in degrees. |
required |
lon
|
float
|
Longitude in degrees. |
required |
assume_western_hem
|
bool
|
Assumes the longitude is in the Western Hemisphere. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
CRS
|
pyproj.CRS: The projected CRS corresponding to the UTM zone for the given latitude and longitude. |
Source code in tree_detection_framework/utils/geospatial.py
to_crs_multiple_geometry_columns(data, crs, columns_to_transform=None, inplace=False)
¶
Behaves like gpd.GeoDataFrame.to_crs() except supports transforming multiple geometry columns
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
GeoDataFrame
|
Input data to transform |
required |
crs
|
CRS
|
The output CRS |
required |
columns_to_transform
|
Optional[List[str]]
|
Which columns to transform. If unset, all geometry-typed columns will be. Defaults to None. |
None
|
inplace
|
bool
|
Should the input geodataframe be modified. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
Optional[GeoDataFrame]
|
Optional[gpd.GeoDataFrame]: Returns the modified geodataframe if inplace=False, else None |