Skip to content

Commit 5efafbc

Browse files
authored
Add documentation for entity/submission geodata endpoints (#1629)
Add documentation for entity/submission geodata endpoints, towards getodk/central#1346
1 parent d40f552 commit 5efafbc

File tree

1 file changed

+161
-0
lines changed

1 file changed

+161
-0
lines changed

docs/api.yaml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ info:
4747
- New endpoint [GET /projects/:id/datasets/:name/entities/creators](/central-api-entity-management/#entities-creators) to retrieve a list of all Actors who have created Entities in a Dataset, sorted by display name.
4848
- [Bulk delete Entities](/central-api-entity-management/#bulk-deleting-entities) endpoint for deleting multiple Entities at once.
4949
- [Bulk restore Entities](/central-api-entity-management/#bulk-restoring-entities) endpoint for restoring multiple soft-deleted Entities at once.
50+
- Endpoints for getting submissions' and entities' geodata in GeoJSON format.
51+
Their current primary use case is to deliver data for the map in Central.
52+
53+
⚠️ This API will likely change in a future release.
54+
55+
The endpoints are:
56+
- [GET /projects/:id/datasets/:name/entities.geojson](/central-api-entity-management/#entities-geodata)
57+
- [GET /projects/:id/forms/:xmlFormId/submissions.geojson](/central-api-submission-management/#submissions-geodata)
5058

5159
**Changed**:
5260
- [Download Dataset](/central-api-dataset-management/#download-dataset) API now supports $search query parameter.
@@ -6074,6 +6082,89 @@ paths:
60746082
example:
60756083
code: "409.1"
60766084
message: A resource already exists with id value(s) of 1.
6085+
/v1/projects/{projectId}/forms/{xmlFormId}/submissions.geojson:
6086+
get:
6087+
tags:
6088+
- Submissions
6089+
summary: Retrieving Submissions Geodata
6090+
description: |-
6091+
Submissions' geodata, one form field per submission, in [GeoJSON](https://geojson.org) format.
6092+
If no particular field path is supplied, the first non-repeat geopoint/geotrace/geoshape field is used.
6093+
No particular ordering is implied.
6094+
6095+
⚠️ The specifics of this endpoint are likely to change in future releases, and the parameters this endpoint takes are not all documented.
6096+
Its current behaviour should not be depended upon.
6097+
Use cases for this API can be discussed on [the forum](https://forum.getodk.org/).
6098+
operationId: Submissions Geodata
6099+
parameters:
6100+
- name: projectId
6101+
in: path
6102+
description: The numeric ID of the Project
6103+
required: true
6104+
schema:
6105+
type: number
6106+
example: "10"
6107+
- name: xmlFormId
6108+
in: path
6109+
description: The `xmlFormId` of the Form being referenced.
6110+
required: true
6111+
schema:
6112+
type: string
6113+
example: simple
6114+
responses:
6115+
200:
6116+
description: OK
6117+
content:
6118+
application/json:
6119+
schema:
6120+
description: |
6121+
Submission geodata, in [GeoJSON](https://geojson.org) format.
6122+
Geodata is grouped by submission. Submissions are represented as a GeoJSON "feature".
6123+
6124+
When the provenance of the geodata (the form's field path) is not evident from the request, the origin field path of the geodata will be denoted in a `fieldpath` property in the feature's GeoJSON `properties` object. This is the case in when no field path is specified in the request, as in that situation the first geopoint-, geotrace-, or geoshape-field (not in any repeatgroup) of the form is used. And thus as forms get revised, what is the first geo-type field (not in any repeatgroup) may change; without the `fieldpath` extra information, the data provenance would be unclear.
6125+
type: object
6126+
example: |
6127+
{
6128+
"type": "FeatureCollection",
6129+
"features": [
6130+
{
6131+
"type": "Feature",
6132+
"id": "uuid:f7ec6523-05f5-450c-9153-934b640b7467",
6133+
"geometry": {
6134+
"type": "Point",
6135+
"coordinates": [170.511231, -52.123783, 654]
6136+
},
6137+
"properties": {
6138+
"fieldpath": "/some_group/some_geopoint"
6139+
}
6140+
},
6141+
{
6142+
"type": "Feature",
6143+
"id": "uuid:0de0e925-0f0e-467c-b809-31a7427f1518",
6144+
"geometry": {
6145+
"type": "Polygon",
6146+
"coordinates": [
6147+
[
6148+
[170, 10, 653],
6149+
[171.123, 20.123, -30.30],
6150+
[172, 30, 65.65],
6151+
[170, 10, 653]
6152+
]
6153+
]
6154+
},
6155+
"properties": {
6156+
"fieldpath": "/some_geoshape"
6157+
}
6158+
}
6159+
]
6160+
}
6161+
403:
6162+
description: Forbidden
6163+
content:
6164+
application/json:
6165+
schema:
6166+
$ref: '#/components/schemas/Error403'
6167+
60776168
/v1/projects/{projectId}/forms/{xmlFormId}/submissions/{instanceId}:
60786169
get:
60796170
tags:
@@ -9030,6 +9121,76 @@ paths:
90309121
application/json:
90319122
schema:
90329123
$ref: '#/components/schemas/Error403'
9124+
/projects/{projectId}/datasets/{name}/entities.geojson:
9125+
get:
9126+
tags:
9127+
- Entity Management
9128+
summary: Entities Geodata
9129+
description: |-
9130+
This endpoint returns the geometry-interpretable value of the `geometry` attribute of Entities of an entity dataset, in [GeoJSON](https://geojson.org) format.
9131+
No particular ordering is implied.
9132+
9133+
⚠️ The specifics of this endpoint are likely to change in future releases, and the parameters this endpoint takes are not all documented.
9134+
Its current behaviour should not be depended upon.
9135+
Use cases for this API can be discussed on [the forum](https://forum.getodk.org/).
9136+
operationId: Entities Geodata
9137+
parameters:
9138+
- name: projectId
9139+
in: path
9140+
description: The numeric ID of the Project
9141+
required: true
9142+
schema:
9143+
type: number
9144+
example: "10"
9145+
- name: name
9146+
in: path
9147+
description: Name of the Dataset
9148+
required: true
9149+
schema:
9150+
type: string
9151+
example: people
9152+
responses:
9153+
200:
9154+
description: OK
9155+
content:
9156+
application/json:
9157+
schema:
9158+
description: |
9159+
Value of the `geometry` attribute (if geometry-interpretable) of Entities of an entity dataset, in [GeoJSON](https://geojson.org) format.
9160+
9161+
Each entity is represented as a GeoJSON feature.
9162+
type: object
9163+
example: |
9164+
{
9165+
"type": "FeatureCollection",
9166+
"features": [
9167+
{
9168+
"type": "Feature",
9169+
"id": "06f1b19a-a14e-4916-b850-b5a5155ea4b7",
9170+
"properties": null,
9171+
"geometry": {
9172+
"type": "Point",
9173+
"coordinates": [27.98833, 86.92528, 8848]
9174+
}
9175+
},
9176+
{
9177+
"type": "Feature",
9178+
"id": "b4677e0a-8731-4b75-b8df-8e4337ff9b5e",
9179+
"properties": null,
9180+
"geometry": {
9181+
"type": "Point",
9182+
"coordinates": [11.3733, 142.5917, -10984]
9183+
}
9184+
}
9185+
]
9186+
}
9187+
9188+
403:
9189+
description: Forbidden
9190+
content:
9191+
application/json:
9192+
schema:
9193+
$ref: '#/components/schemas/Error403'
90339194
/v1/projects/{projectId}/datasets/{name}/entities/creators:
90349195
get:
90359196
tags:

0 commit comments

Comments
 (0)