[Bug Report] Detections with map feature ID decoding error
還沒有人認領這個 Issue。
評估
研究方向
重現使用 fields=[] 呼叫 mapillary.interface.get_detections_with_map_feature_id,並透過 interface.py、controller/detection.py 和 models/geojson.py 追蹤它。檢查 Geometry 如何處理空的 geometry 物件,釐清預期的返回表示形式,並在此回應不再引發 KeyError 且預期行為受到涵蓋時,視為該 issue 已完成。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
Running interface.get_detections_with_map_feature_id under select map feature IDs throws a KeyError within the models/geojson file.
To Reproduce
mapillary.interface.get_detections_with_map_feature_id(1852672618623383, fields=[])
Returns KeyError as following:
Traceback (most recent call last):
File "x.py", line 703, in <module>
mapillary.interface.get_detections_with_map_feature_id(1852672618623383, fields=[])
File "..\mapillary\utils\auth.py", line 59, in wrapper
return f(*args, **kwargs)
File "..\mapillary\interface.py", line 330, in get_detections_with_map_feature_id
return detection.get_map_feature_detections_controller(
File "..\mapillary\controller\detection.py", line 83, in get_map_feature_detections_controller
return GeoJSON(
File "..\mapillary\models\geojson.py", line 398, in __init__
[Feature(feature=feature) for feature in geojson["features"]]
File "..\mapillary\models\geojson.py", line 398, in <listcomp>
[Feature(feature=feature) for feature in geojson["features"]]
File "..\mapillary\models\geojson.py", line 270, in __init__
self.geometry = Geometry(feature["geometry"])
File "..\mapillary\models\geojson.py", line 211, in __init__
self.type: str = geometry["type"]
KeyError: 'type'
The returned GeoJSON from the API is in the form:
[{'geometry': {'coordinates': [-0.12497729285872, 51.537085937084],
'type': 'Point'},
'properties': {'created_at': '2025-08-02T16:21:25+0000',
'id': '1724058414915752',
'pixel_geometry': 'Gjp4AgoGbXB5LW9yKIAgEisYAwgBIiUJqiuWInoIDxAABAcIAAQHBgAcAAgIBAgACAMQCwAPCCkKBxEP',
'value': 'object--catch-basin'},
'type': 'Feature'},
{'geometry': {'coordinates': [-0.12498136837391, 51.537059028201],
'type': 'Point'},
'properties': {'created_at': '2025-08-02T16:20:30+0000',
'id': '1807913776455018',
'pixel_geometry': 'Gld4AgoGbXB5LW9yKIAgEkgYAwgBIkIJ2inOJ+oBKDcEAAgHLiEkEAgKBAAECAQACAgKCAwICAgIEAsaGRALGAcIAwgHCAcIAwADCAsAGQ8DBy8fAwcTBw8=',
'value': 'object--catch-basin'},
'type': 'Feature'},
{'geometry': {},
'properties': {'created_at': '2025-08-02T16:20:20+0000',
'id': '685612757857124',
'pixel_geometry': 'GosBeAIKBm1weS1vciiAIBJ8GAMIASJ2Cd44jCy6AwQHCAAIBwgABAcGAAgHBAAIBwgABAcUCQQHCAAEBwgABAcOAAgAFAgECAgACAgICgQABAgEAAoIBAgECAgQABADEgcAAwgNAA8YBwgHCAcIAwAHCA8QFQoDACchAw8LAAMHAwAJBwsXBwADCQMHDw==',
'value': 'object--catch-basin'},
'type': 'Feature'},
{'geometry': {'coordinates': [-0.12497321734354, 51.537112845968],
'type': 'Point'},
'properties': {'created_at': '2025-08-02T16:21:33+0000',
'id': '1777805250267304',
'pixel_geometry': 'GiR4AgoGbXB5LW9yKIAgEhUYAwgBIg8JtCWiIyIyAAQYMQADBw8=',
'value': 'object--catch-basin'},
'type': 'Feature'}]
Clearly we see features in Mapillary without attached geometry, but still picked up by the map feature API.
It's unclear what the expected behaviour is here, otherwise I would have submitted a PR. 😥
Expected behavior
Detections returned as usual.
Unclear how to handle detections without any geometry.
Screenshots
Additional context
- 主要語言
- Python
- 星號
- 66
- 分支
- 23
- 平均合併
- 1 天 20 小時
- 30 天內合併 PR
- 11
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
mapillary/mapillary-python-sdk 的其他 Issue
-
enhancement
難度 5/5 一週以上 新手友好度 15/100
mapillary/mapillary-python-sdk#156 · 1 則留言 ·
-
Bug Report 未關閉bug
難度 3/5 1-2 天 新手友好度 35/100
mapillary/mapillary-python-sdk#150 · 1 則留言 ·
-
point cloud data 未關閉example
難度 5/5 一週以上 新手友好度 20/100
mapillary/mapillary-python-sdk#147 · 11 則留言 ·
-
feature
難度 5/5 一週以上 新手友好度 32/100
mapillary/mapillary-python-sdk#127 · 1 則留言 · 2 個 reaction ·
-
feature
mapillary/mapillary-python-sdk#119 · 已指派 1 人 ·
查看 mapillary/mapillary-python-sdk 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 90/100
-
bug
難度 2/5 1-3 小時 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難度 2/5 1-3 小時 新手友好度 88/100
NousResearch/hermes-agent#117848 ·