[Bug Report] Detections with map feature ID decoding error
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Reproduziere den Aufruf von mapillary.interface.get_detections_with_map_feature_id mit fields=[] und verfolge ihn durch interface.py, controller/detection.py und models/geojson.py. Untersuche, wie Geometry das leere Geometrieobjekt behandelt, kläre die beabsichtigte zurückgegebene Repräsentation und betrachte das Issue als abgeschlossen, wenn diese Antwort keinen KeyError mehr auslöst und das erwartete Verhalten abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 66
- Forks
- 23
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 11
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus mapillary/mapillary-python-sdk
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
mapillary/mapillary-python-sdk#156 · 1 Kommentar ·
-
Bug Report Offenbug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
mapillary/mapillary-python-sdk#150 · 1 Kommentar ·
-
point cloud data Offenexample
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
mapillary/mapillary-python-sdk#147 · 11 Kommentare ·
-
feature
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 32/100
mapillary/mapillary-python-sdk#127 · 1 Kommentar · 2 Reaktionen ·
-
feature
mapillary/mapillary-python-sdk#119 · 1 zugewiesene Person ·
Alle Issues in mapillary/mapillary-python-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
OpenHands/extensions#626 · 1 Kommentar ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
CSCfi/sd-search-api#39 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
-
please add to porn list Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
StevenBlack/hosts#3255 ·