File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,26 @@ def infer_unit_coords(coords):
145145 return unit
146146
147147
148+ def get_crs_unit (coords ):
149+ """
150+ Retrieve the unit of measurement for the coordinate reference system (CRS).
151+
152+ Parameters
153+ ----------
154+ coords : GeoDataFrame
155+ An object with a coordinate reference system (CRS) attribute.
156+
157+ Returns
158+ -------
159+ unit : str
160+ The unit of measurement for the coordinate system, as specified in the
161+ CRS axis information. Assumes that both axes have the same unit.
162+ """
163+
164+ unit = coords .crs .axis_info [0 ].unit_name # assume both axes have the same unit
165+ return unit
166+
167+
148168def latlon_to_geosph_vector (lat , lon , rad = False , basis = False ):
149169 """Convert lat/lon coodinates to radial vectors (on geosphere)
150170
You can’t perform that action at this time.
0 commit comments