maproulette / maproulette-backend

MapRoulette back-end / API
Apache License 2.0
49 stars 37 forks source link

Unable to build relation-based challenge #259

Open nyurik opened 7 years ago

nyurik commented 7 years ago

I tried to build a challenge to fix broken Wikidata / Wikipedia links for admin relations. The goal is to show all relations matching ["wikipedia"]["wikidata"!~".*"]["admin_level"];. This query produced empty result, even though running it at OT showed 10MB of data.

[timeout:180];
(  relation["wikipedia"]["wikidata"!~".*"]["admin_level"]; );
out body geom qt;

I then added this query, but it gave me over 100K results, which is not correct:

[out:json][timeout:25];
(  relation["wikipedia"]["wikidata"!~".*"]["admin_level"]; );
out body; >; out body geom qt;
martijnv-telenav commented 7 years ago

Relations are not supported as they probably should. I think the problem is that MR would parse the individual ways, not the relation as one geometry. Perhaps one way to do it for now would be to create tasks from the centroids of the relation polygons?

nyurik commented 7 years ago

Would it be possible to convert relations into some sort of a node in the mean time using some OT query magic?

mvexel commented 7 years ago

Perhaps... Sorry I didn't email you back yet. I just sent an email about a similar question to the MapRoulette OSM mailing list. Are you on that list? I can forward if not.

nyurik commented 7 years ago

@mvexel I only found this post, and it doesn't seem to mention relations. Is it somewhere else?

mvexel commented 7 years ago

I was wrong. It was actually a private response. Let me paste the relevant parts here:

There is no great / easy workaround — if you export the result as GeoJSON and use that to build the challenge, it will parse individual ways as tasks because MR will interpret every geometry it finds as a task. One thing you could do is merge the geometries in QGIS or similar (based on a shared attribute) and save that as a GeoJSON file, and build your challenge with that.

Still, because there is no direct relation support, the process of editing these tasks through MapRoulette will be tricky, because the relations you are targeting are not pre-selected in JOSM / iD when the mapper clicks ‘edit’. So unless you are working with a close group of people and give very specific instructions it may be better suited for a different tool (perhaps the JOSM to-do plugin could be helpful?)

matkoniecz commented 6 years ago

In my case I wanted to produce challenge for objects with invalid wikipedia tags

[out:json];
(
relation["wikipedia"="en:Nairobi - Nakuru Highway"];
); out body geom qt;

failed without explanation.

matkoniecz commented 6 years ago

331 mentions

One way to circumvent would be to save the resulting geometries from overpass Turbo as GeoJSON and use that. Let me know if that works. Again sorry!

with reply

Thanks! I had to remove some rubbish nodes from exported GeoJSON. After that, import worked fine.