-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils0: add epsg_code2utm_zone()
#1159
Conversation
+ utils.utils0.py: add `epsg_code2utm_zone()` to convert the EPSG code to the UTM zone string.
src/mintpy/utils/utils0.py
Outdated
# epsg_code = str(epsg_code) | ||
# if epsg_code.startswith('326'): | ||
# utm_zone = epsg_code[3:] + 'N' | ||
# elif epsg_code.startswith('327'): | ||
# utm_zone = epsg_code[3:] + 'S' | ||
# else: | ||
# utm_zone = None | ||
# print(f'WARNING: input EPSG code ({epsg_code}) is NOT a UTM zone, return None and continue.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# epsg_code = str(epsg_code) | |
# if epsg_code.startswith('326'): | |
# utm_zone = epsg_code[3:] + 'N' | |
# elif epsg_code.startswith('327'): | |
# utm_zone = epsg_code[3:] + 'S' | |
# else: | |
# utm_zone = None | |
# print(f'WARNING: input EPSG code ({epsg_code}) is NOT a UTM zone, return None and continue.') |
delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about how the conversion between ESPG code and UTM Zone is done mathematically, then saw the code from Sara's PR, and thought this is helpful for understanding. Is it correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mirzaees, this is very helpful! I added the link to the inline comment. Now the EPSG code feels more generic and simple. It looks like we could use EPSG code for all kinds of calculations and checking very easily, without UTM_ZONE at all. Maybe we could remove this metadata completely, what do you think? @mirzaees @scottstanie @hfattahi
Co-authored-by: Scott Staniewicz <[email protected]>
+ utils.utils0.py: add `epsg_code2utm_zone()` to convert the EPSG code to the UTM zone string. --------- Co-authored-by: Scott Staniewicz <[email protected]>
Description of proposed changes
epsg_code2utm_zone()
to convert the EPSG code to the UTM zone string.Reminders