Skip to content

Accept application/json as data input #160

Open
@SlowMo24

Description

@SlowMo24

JSON is a widely used format that can be processed in many applications. Accepting JSON as input would increase the usability of the API.

For example https://github.com/GIScience/ohsome-py is logging the data body input it sends to the API in JSON format if the query fails. If the API accepted JSON the logged files could be directly used to reproduce the failed query using curl:

curl --data-urlencode "bpolys@the_bpolys.geojson" \
    --data-urlencode "@the_body.json" \
    -X POST https://api.ohsome.org/v1/elements/count/groupBy/boundary \
    -H "Content-Type: application/json" 

Currently manual interaction is necessary to rewrite the query as follows:

curl -d "time=2007-10-08T00:00:00Z,2019-05-04" \
    -d "clipGeometry=false" \
    ...
    --data-urlencode "bpolys@the_bpolys.geojson" \
    -X POST https://api.ohsome.org/v1/elements/count/groupBy/boundary

temp_body.json.txt

temp_bpolys.geojson.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    brainstormingIdea for a potential new feature or adaption that still needs further discussioncomments welcomeIndicates that the creator of this issue/PR is open for early review commentsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions