Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add BBOX-parameter to /challenge/view API endpoint #1037

Open
pietervdvn opened this issue Apr 18, 2023 · 5 comments
Open

Comments

@pietervdvn
Copy link

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
image

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)

@tordans
Copy link
Contributor

tordans commented May 24, 2024

@bhousel how does Rapid handle loading the private vs. public challenges (for a bbox)?

@mvexel
Copy link
Member

mvexel commented May 24, 2024

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
Copy link

bhousel commented May 24, 2024

@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.)

@tordans
Copy link
Contributor

tordans commented May 25, 2024

Thanks Bryan! And given that facebook/Rapid#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?

@pietervdvn
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants