Skip to content

Fetch GeoJSON for individual submission/entityΒ #1325

@matthew-white

Description

@matthew-white

#1387 is a frontend issue that calls for showing a map for an individual submission/entity. This issue is to update the API so that #1387 is possible. Frontend should be able to fetch the GeoJSON of an individual submission/entity in order to display it on a map. Currently, it's not possible to use the GeoJSON API to filter for an individual submission/entity.

From getodk/central-backend#1555 (comment):

On the submissions page, we will map all submissions. But on the submission detail page, we will map only the one submission. So we need some way to fetch the GeoJSON for a single submission.

  • One way to do this (maybe the typical way for the codebase) would be to add an additional endpoint, i.e., one endpoint for all submission GeoJSON and a second endpoint for an individual submission's GeoJSON. Something like /v1/projects/:projectId/forms/:xmlFormId/submissions/:instanceId.geojson. We have a similar endpoint path for fetching an individual submission's XML (.../:instanceId.xml). We also have separate endpoints for fetching all submission OData vs. fetching an individual submission's OData.
  • An alternative would be to keep the one endpoint, but add a query parameter to filter for a specific submission.

Metadata

Metadata

Assignees

Labels

backendRequires a change to the API server

Projects

Status

βœ… done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions