Skip to content
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

Merged
merged 5 commits into from
Mar 14, 2024
Merged

utils0: add epsg_code2utm_zone() #1159

merged 5 commits into from
Mar 14, 2024

Conversation

yunjunz
Copy link
Member

@yunjunz yunjunz commented Mar 13, 2024

Description of proposed changes

  • utils.utils0.py: add epsg_code2utm_zone() to convert the EPSG code to the UTM zone string.

Reminders

  • Pass Pre-commit check (green)
  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

+ utils.utils0.py: add `epsg_code2utm_zone()` to convert the EPSG code to the UTM zone string.
src/mintpy/utils/utils0.py Outdated Show resolved Hide resolved
src/mintpy/utils/utils0.py Show resolved Hide resolved
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.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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

@yunjunz yunjunz merged commit 97c7004 into insarlab:main Mar 14, 2024
7 checks passed
@yunjunz yunjunz deleted the utm branch March 14, 2024 03:00
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants