Closed atiannicelli closed 1 month ago
There is JOSM plugin that performs this entire workflow if you are interested.
Poke me if there are questions on the API.
cc: @mvexel
All righty- there's a lot of raw material here to work with, so let's break this work down.
Maproulette has challenges, which are themed groupings of small tasks. For example, somebody might create a challenge that's to 'map all the parking spaces in a city', consisting of thousands of tasks to map a single parking lot. Challenge creators have a lot of latitude in the tasks they create- they can include descriptions of what the challenge requires. Some challenges might ask for simple things like 'if this is a parking lot, just draw the perimeter of the parking lot'. The same challenge could instead be much more detailed and might ask the user to map the individual parking spot geometries, parking ways with directional information, etc. It's very open and free-form, which makes this task quite a big one!
task
and challenge
APIs.After this investigation, you should have a handle on the API. Now see if you can hand-construct some API calls using a tool such as curl or postman:
@voscarmv Next task will be to write a Service in Rapid to obtain all of the challenges in an area, and all the tasks for a specific challenge. I'll fill that in when we get to it. :)
If you need some sample API returns, https://github.com/JOSM/MapRoulette/tree/master/src/test/resources/__files/api/v2 has samples from MapRoulette's API (note: the responses are ~9 months old at this point)
Since it was not easy to find I thought I'd answer the extra credit :) I did find out how to get tasks in a specific bounding box using the /tasks/box/ API. I forgot to post that I had asked the developers how to do it and they replied that the /tasks/box API should work and you can add a "cid" to show tasks from a specific challenge or "pid" if you want tasks from a project. (A project is just a collection of challenges).
Also, if you have MapRoulette specific API questions you can ask them in the maproulette-dev channel on the OpenStreetMap slack (osmus.slack.com).
Thank you for the tips @tsmock and @atiannicelli !
https://github.com/maproulette/maproulette3/issues/2211 was filed by Alex I. as a result of @voscarmv's investigation.
This feature landed in 2.3 and is receiving updates in 2.4. Closing!
Description
OK, so the TL;DR is that I want to be able to open up Rapid and look at the map and see all the Map Roulette Issues on the map and address them.
This is how I would propose that the feature is added:
The user would be able to get that challenge ID from the URL that they are using to look at the map roulette challenge![Screenshot 2023-10-06 at 1 26 00 PM](https://github.com/facebook/Rapid/assets/5851115/c31c8840-bb22-4ca3-b2e3-231cb4731903)
Once the user has enabled maproulette tasks and optionally filled in a specific challenge ID then Rapid would use the Map Roulette API to fetch the Tasks from the bounding box as shown on the map.
curl -X 'PUT' \ 'https://maproulette.org/api/v2/tasks/box/-71.0749/42.3564/-71.0868/42.3764?limit=5&page=0&excludeLocked=false&order=ASC&includeTotal=false&includeGeometries=true&includeTags=false' \ -H 'accept: application/json'
Each of the returned items would be added on the map as a dot of some kind as the point indicated in the data retrieved.
curl -X 'GET' \ 'https://maproulette.org/api/v2/task/186693991' \ -H 'accept: application/json'
Node: If the instructions are "none" then you might need to fetch the instructions from the challenge. curl -X 'GET' \ 'https://maproulette.org/api/v2/challenge/41497' \ -H 'accept: application/json'
Then Rapid would pop up a box with the following info: Challenge Name, Feature ID, Instructions, etc
Also there would be a Button to "Lock" the task (so no one else works on this task). If the lock doesn't work then you report that someone else has it locked. If the Lock works then display the locked state.
The mapper then fixes the issue and clicks one of the resolution buttons on the dialog box associated with this issue. "fixed", "not an issue", "too hard", "skip", "already fixed". Rapid would then update the task and unlock it.
Note: I don't know that locking is that important. It is more important for mapathons when lots of people are working on the same challenge. In most cases it is not needed.
I'd like to be able to see the dots and zoom in and fix a bunch of issues and then click the dots and "fix" each one.
To be able to lock and update the MR task the mapper will have had to enter a Map Roulette UserID.
Note: I don't know what the API to fetch tasks from a specific challenge in a bounding box is. I've asked because they must have it... or maybe they get all and filter on the "parent" field? (yuck).
There is JOSM plugin that performs this entire workflow if you are interested. Map Roulette swagger is here: https://maproulette.org/docs/swagger-ui/index.html#/