Supporting fields parameter for api/organisationUnits.geojson endpoint

I want to add a feature request to DHIS2 web api, but wanted to double check here first. According to the latest docs, for the api/organisationUnits.geojson endpoint only “two parameters are supported”: parent and level. This means that adding other params that work for the .json endpoint shouldn’t have any effect.

For example, adding the fields parameter does not make any difference when tested on v2.42: https://play.im.dhis2.org/stable-2-42-3-1/api/organisationUnits.geojson?level=2&fields=id,name,geometry. The same set of standard properties are always included.

Being able to specify the fields would generally be useful to specify which properties we get in the returned GeoJSON. This is especially important since the default set of returned properties only includes org unit id at the feature.id level and not at the feature.properties.id level, which may or may not work for a given application. Either way it would be good to add or exclude additional fields.

Just double checking here that I haven’t missed or misunderstood anything that this is indeed a current limitation of the .geojson endpoint, before making a feature request.

Hi @karimbahgat !

Thank you for your first post. It’s always great to share these ideas with the community and see who else in the community might have a similar use-case. You’re more than welcome to share about the use-case itself, too!

I have a question for you below, but you’re welcome to create a feature request already since as you said only two parameters are supported in geojson. Please see ideas for details on feature request creation.

The .geojson is not the only way to get these values. I wondering if you tried the /api/geoFeatures.json endpoint. In the same docs pages you shared it says, “The OrgansationUnit attribute of value type GeoJSON: the api will use the provided coordinateField={attributeId} to get the GeoJSON coordinates from this attribute value.”

For example, to retrieve geo features for all organisation units at level 3 as above but get the coordinates from OrganisationUnit attribute tJqtSV4quLb

/api/geoFeatures.json?ou=ou:LEVEL-3&coordinateField=tJqtSV4quLb