-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add converter between AV2 city coordinate systems, and WGS84 and UTM #28
Conversation
src/av2/geometry/utm.py
Outdated
|
||
|
||
# All are North UTM zones (Northern hemisphere) | ||
UTM_ZONE_MAP = { |
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.
UTM_ZONE_MAP = { | |
UTM_ZONE_MAP: Final[Dict[CityName, int]] = { |
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.
Thanks, updated now.
src/av2/geometry/utm.py
Outdated
|
||
|
||
# as (lat, long) tuples | ||
CITY_ORIGIN_LATLONG_DICT = { |
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.
CITY_ORIGIN_LATLONG_DICT = { | |
CITY_ORIGIN_LATLONG_DICT: Final[Dict[CityName, Tuple[float, float]]] = { |
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.
Thanks, updated now.
src/av2/geometry/utm.py
Outdated
@@ -0,0 +1,105 @@ | |||
# <Copyright 2022, Argo AI, LLC. Released under the MIT license.> | |||
|
|||
"""Utilities for converting AV2 city coordinates to UTM or WGS84 coordinate systems.""" |
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.
Could we add some information about these two coordinate systems here?
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.
Sure, I added some references.
src/av2/geometry/utm.py
Outdated
} | ||
|
||
|
||
def convert_gps_to_utm(lat: float, long: float, city_name: CityName) -> Tuple[float, float]: |
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 understand that long
is common in the GIS community, but I think this is a bit confusing with the numerical type, long
. Perhaps we could use lon
?
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.
Good call. I switched to longitude
, since I think it's not much longer, and may be clearer.
return points_utm | ||
|
||
|
||
def convert_city_coords_to_wgs84(points_city: Union[NDArrayFloat, NDArrayInt], city_name: CityName) -> NDArrayFloat: |
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.
def convert_city_coords_to_wgs84(points_city: Union[NDArrayFloat, NDArrayInt], city_name: CityName) -> NDArrayFloat: | |
def convert_city_coords_to_wgs84(points_xy_city: Union[NDArrayFloat, NDArrayInt], city_name: CityName) -> NDArrayFloat: |
Prefer xy
to make it clear these points are 2D.
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'm a bit biased towards what we have, since I think points_xy_city
is maybe getting a bit too long for a name.
PR Summary
Adds converter between AV2 city coordinate systems, and WGS84 and UTM, as requested by argoverse/argoverse-api#290.
Testing
In order to ensure this PR works as intended, it is:
Compliance with Standards
As the author, I certify that this PR conforms to the following standards: