[fix] resolve wrong bbox order in case rectangle prompt
Browse files- src/io/lambda_helpers.py +5 -2
- src/utilities/type_hints.py +2 -0
src/io/lambda_helpers.py
CHANGED
@@ -107,9 +107,12 @@ def _get_new_prompt_data_rectangle(bbox_ne, bbox_sw, prompt, zoom):
|
|
107 |
current_point_sw = get_latlng_to_pixel_coordinates(bbox_ne, bbox_sw, prompt.data.sw, zoom, prompt.type)
|
108 |
app_logger.debug(
|
109 |
f"rectangle:: current_point_sw prompt: {type(current_point_sw)}, value:{current_point_sw}.")
|
|
|
110 |
return [
|
111 |
-
|
112 |
-
|
|
|
|
|
113 |
]
|
114 |
|
115 |
|
|
|
107 |
current_point_sw = get_latlng_to_pixel_coordinates(bbox_ne, bbox_sw, prompt.data.sw, zoom, prompt.type)
|
108 |
app_logger.debug(
|
109 |
f"rectangle:: current_point_sw prompt: {type(current_point_sw)}, value:{current_point_sw}.")
|
110 |
+
# correct order for rectangle prompt
|
111 |
return [
|
112 |
+
current_point_sw["x"],
|
113 |
+
current_point_ne["y"],
|
114 |
+
current_point_ne["x"],
|
115 |
+
current_point_sw["y"]
|
116 |
]
|
117 |
|
118 |
|
src/utilities/type_hints.py
CHANGED
@@ -74,8 +74,10 @@ class RawPromptRectangle(BaseModel):
|
|
74 |
def get_type_str(self):
|
75 |
return self.type
|
76 |
|
|
|
77 |
class RawRequestInput(BaseModel):
|
78 |
"""Input lambda request validator type (not yet parsed)"""
|
|
|
79 |
bbox: RawBBox
|
80 |
prompt: list[RawPromptPoint | RawPromptRectangle]
|
81 |
zoom: int | float
|
|
|
74 |
def get_type_str(self):
|
75 |
return self.type
|
76 |
|
77 |
+
|
78 |
class RawRequestInput(BaseModel):
|
79 |
"""Input lambda request validator type (not yet parsed)"""
|
80 |
+
id: str = ""
|
81 |
bbox: RawBBox
|
82 |
prompt: list[RawPromptPoint | RawPromptRectangle]
|
83 |
zoom: int | float
|