Skip to content

Keep unlocated detections in GeoJSON results - #204

Open
0z5a wants to merge 1 commit into
mapillary:mainfrom
0z5a:fix/unlocated-detections
Open

0z5a wants to merge 1 commit into
mapillary:mainfrom
0z5a:fix/unlocated-detections

Conversation

@0z5a

@0z5a 0z5a commented Nov 17, 2026

Copy link
Copy Markdown

Fixes #176.

A detection can have pixel geometry and a label even when the response has no image location. The SDK currently gives that detection an empty geometry object. Constructing the collection then raises KeyError: 'type', so the caller loses the located detections in the same response.

Keep the detection with a null geometry, as specified for an unlocated feature in RFC 7946 §3.2. Preserve its properties and keep point geometry for detections with a location.

I checked get_detections_with_map_feature_id on macOS arm64 with a two-detection response supplied at the HTTP boundary. On main, the located-only control returned a point and the mixed response raised. With this change, the mixed response returns both features, with the point and null geometry respectively. The two regression tests and 12 offline API configuration tests passed.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 17, 2026
@Rubix982

Copy link
Copy Markdown
Contributor

LGTM. 👍

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] Detections with map feature ID decoding error

2 participants