Add converter between AV2 city coordinate systems, and WGS84 and UTM#28
Add converter between AV2 city coordinate systems, and WGS84 and UTM#28benjaminrwilson merged 14 commits intomainfrom
Conversation
src/av2/geometry/utm.py
Outdated
|
|
||
|
|
||
| # All are North UTM zones (Northern hemisphere) | ||
| UTM_ZONE_MAP = { |
There was a problem hiding this comment.
| UTM_ZONE_MAP = { | |
| UTM_ZONE_MAP: Final[Dict[CityName, int]] = { |
src/av2/geometry/utm.py
Outdated
|
|
||
|
|
||
| # as (lat, long) tuples | ||
| CITY_ORIGIN_LATLONG_DICT = { |
There was a problem hiding this comment.
| CITY_ORIGIN_LATLONG_DICT = { | |
| CITY_ORIGIN_LATLONG_DICT: Final[Dict[CityName, Tuple[float, float]]] = { |
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.
Could we add some information about these two coordinate systems here?
There was a problem hiding this comment.
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.
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.
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.
| 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.
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: