Feature request: add BBOX-parameter to `/challenge/view` API endpoint
Hi,
I'm trying to setup an import flow (for openbenches.org) which uses mapcomplete as frontend and maproulette as backend. The challenge is here and contains about 27.000 items.
I want to load those points into MapComplete (see example below). MapComplete can load (tiled) geojson, for example as provided by tasks/box/{left}/{bottom}/{right}/{top} - but this one does not show tasks from private challenges (necessary for testing) and contains data that I don't need.
Alternatively, I can use /challenge/view/{id} from the API, which returns all tasks for the given challenge. This will return many tasks far away from the mapper, takes several seconds to download and, most importantly, chokes mapcomplete.
Ideally, this API call would include an extra parameter which allows to set a BBOX (or a slippy-map-tile z/x/y param) which would then return only tasks within that bbox (e.g. /challenge/view/{id}?bbox={left},{right},{top},{bottom})
Context
For context: a similar 'import'-flow has been prototyped but not used at scale (about 20 points). This is how it looks like

The idea is that the contributor should not be aware of the tags that they edit. The 'import' button will prepare the correct tags and add a new point with these tags. Additionally, if a nearby feature matches, the contributor will be able to apply extra tags on the already existing feature. I've done a similar 'guided import' in the past, but using map notes as data storage.
(One can also browse all MapRoulette tasks here)
@bhousel how does Rapid handle loading the private vs. public challenges (for a bbox)?
Thanks for flagging this again @pietervdvn Team - let's discuss if we can do something here. I think this would be useful not just for MapComplete.
@bhousel how does Rapid handle loading the private vs. public challenges (for a bbox)?
IIRC it works like this:
We fetch Tasks with the /tasks/box endpoint, as that's the only one that supports tiled bbox queries.
We check the results of that, and mark the tasks as private (hidden) if we haven't looked up the challenge details yet.
We add new challenge ids we haven't seen before to a queue.
Then we fetch the missing Challenge details with challenge/{id}.
We check the results of that and use it to update the tasks' visibility, and also save whatever details live with the Challenge (like the changeset comment, sources, etc.)
Thanks Bryan! And given that https://github.com/facebook/Rapid/pull/1446 works without additional queries that means that "but this one does not show tasks from private challenges (necessary for testing)" should be wrong or outdated @pietervdvn - right?
but this one does not show tasks from private challenges (necessary for testing)" should be wrong or outdated @pietervdvn - right?
Bryan wrote:
mark the tasks as private (hidden)
I think that Bryan means "not shown in iD" with the word "private", not the private tasks on MapRoulette.
In either case, it feels a bit wasteful to download 100s of unnecessary tasks.