osmlab / maproulette-python-client

MapRoulette Client Library for Python
https://maproulette-python-client.readthedocs.io
Apache License 2.0
11 stars 12 forks source link

[Feature Request] Cooperative Challenge model #63

Closed danielduhh closed 3 years ago

danielduhh commented 4 years ago

Is your feature request related to a problem? Please describe. Update the challenge model to handle MapRoulette Cooperative Challenges.

Cooperative challenges bring in-progress work to a MapRoulette task for completion or verification. Tag changes can be committed to OSM within MapRoulette.

See https://github.com/osmlab/maproulette3/wiki/Cooperative-Challenges for more information

Describe the solution you'd like Here's the Cooperative Work model:

CooperativeWork {
    meta: {version: 2, type: 2},
    operations: Operations[]
}

Operations
{
    operationType: "createElement" | "deleteElement" | "modifyElement"
    data: Data
}

Data
{
    id: "{elementType}/{OSMID}" e.g. "way/12345678"
    operations: DataOperation[]
}

DataOperation {
    operation: "setTags" | "unsetTags"
    data: {key: value} | string[] <- key/value for "setTags" and array of tag keys for "unsetTags"
}

Here's the example json that would be appended to a task object:

{
        "type": "FeatureCollection",
        "features": [],
    "cooperativeWork": {
        "meta": {
            "version": 2,
            "type": 1
        },
        "operations": [{
            "operationType": "modifyElement",
            "data": {
                "id": "way/792729120",
                "operations": [{
                    "operation": "setTags",
                    "data": {
                        "junction": "turning_loop"
                    }
                }]
            }
        }]
    }
}
shawat94 commented 3 years ago

Merged: https://github.com/osmlab/maproulette-python-client/pull/69