Skip to content

Commit

Permalink
streetcomplete#427 limit WayLit quest for paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Krason authored and Krzysztof Krason committed Jul 30, 2017
1 parent 5e42ad8 commit bf23bba
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import android.os.Bundle;
import android.text.TextUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.inject.Inject;

import de.westnordost.streetcomplete.data.osm.SimpleOverpassQuestType;
Expand Down Expand Up @@ -30,8 +34,12 @@ public class AddWayLit extends SimpleOverpassQuestType
@Override
protected String getTagFilters()
{
return "ways with highway ~ " + TextUtils.join("|", ROADS_WITH_LIGHT)
+ "|" + TextUtils.join("|", WAYS_WITH_LIGHT) + " and !lit";
List<String> waysWithoutPath = new ArrayList<>(Arrays.asList(WAYS_WITH_LIGHT));
waysWithoutPath.remove("path");
return "ways with (highway ~ " + TextUtils.join("|", ROADS_WITH_LIGHT)
+ "|" + TextUtils.join("|", waysWithoutPath)
+ ") or (highway = path and (foot = designated or bicycle = designated))"
+ " and !lit";
}

public AbstractQuestAnswerFragment createForm()
Expand Down

0 comments on commit bf23bba

Please sign in to comment.