utils0: add epsg_code2utm_zone()#1159
Merged
yunjunz merged 5 commits intoinsarlab:mainfrom Mar 14, 2024
Merged
Conversation
+ utils.utils0.py: add `epsg_code2utm_zone()` to convert the EPSG code to the UTM zone string.
scottstanie
approved these changes
Mar 13, 2024
src/mintpy/utils/utils0.py
Outdated
Comment on lines
+312
to
+319
| # 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.') |
Contributor
There was a problem hiding this comment.
Suggested change
| # 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?
Member
Author
There was a problem hiding this comment.
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?
Collaborator
There was a problem hiding this comment.
Member
Author
There was a problem hiding this comment.
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 <scott.stanie@gmail.com>
ehavazli
pushed a commit
to ehavazli/MintPy
that referenced
this pull request
Mar 19, 2024
+ utils.utils0.py: add `epsg_code2utm_zone()` to convert the EPSG code to the UTM zone string. --------- Co-authored-by: Scott Staniewicz <scott.stanie@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of proposed changes
epsg_code2utm_zone()to convert the EPSG code to the UTM zone string.Reminders