Skip to content

Commit

Permalink
Merge pull request #167 from google:crs_unit
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 658015946
  • Loading branch information
Xee authors committed Jul 31, 2024
2 parents 2c92e97 + 71a3b08 commit 18ef42b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xee/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ def __init__(

self.crs_arg = crs or proj.get('crs', proj.get('wkt', 'EPSG:4326'))
self.crs = CRS(self.crs_arg)

is_crs_geographic = self.crs.is_geographic
# Gets the unit i.e. meter, degree etc.
self.scale_units = self.crs.axis_info[0].unit_name
self.scale_units = 'degree' if is_crs_geographic else 'meter'
# Get the dimensions name based on the CRS (scale units).
self.dimension_names = self.DIMENSION_NAMES.get(
self.scale_units, ('X', 'Y')
Expand Down

0 comments on commit 18ef42b

Please sign in to comment.