Skip to content

Format 'groupByObject' as JSON-object, not list for /elements/{agg}/groupBy/boundary/groupBy/tag #149

Open
@SlowMo24

Description

@SlowMo24

Endpoint: https://api.ohsome.org/v1/elements/area/groupBy/boundary/groupBy/tag

Body: {'time': '2021-02-28', 'bboxes': 'id1:12.4458570122,45.4386880794,12.4468333362,45.4393693706', 'filter': 'building=* and geometry:polygon', 'groupByKey': 'building'}

Returns: {'attribution': {'url': 'https://ohsome.org/copyrights', 'text': '© OpenStreetMap contributors'}, 'apiVersion': '1.3.2', 'groupByResult': [{'groupByObject': ['id1', 'building=yes'], 'result': [{'timestamp': '2021-02-28T00:00:00Z', 'value': 20.29}]}, {'groupByObject': ['id1', 'building=hut'], 'result': [{'timestamp': '2021-02-28T00:00:00Z', 'value': 1153.18}]}]}

The {'groupByObject': ['id1', 'building=yes']...} is risky as it relies on the right order in the list which may change at any time. Explicit results would also be easier to parse: {'groupByObject': {'boundaryId':'id1', 'tag':'building=yes'}...} or if there is some reason to stick to the list: {'groupByObject': [{'boundaryId':'id1'},{'tag':'building=yes'}]...}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions