Skip to content

Commit

Permalink
do not show quests for elements longer than 500m (fixes #1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Sep 28, 2018
1 parent 006ade4 commit ccff698
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -6,6 +6,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
Expand All @@ -28,9 +29,12 @@
import de.westnordost.osmapi.map.data.BoundingBox;
import de.westnordost.osmapi.map.data.Element;
import de.westnordost.osmapi.map.data.LatLon;
import de.westnordost.streetcomplete.util.SphericalEarthMath;

public class OsmQuestDownload
{
public static final int MAX_GEOMETRY_LENGTH_IN_METERS = 500;

private static final String TAG = "QuestDownload";

// injections
Expand Down Expand Up @@ -185,6 +189,18 @@ private boolean mayCreateQuestFrom(
return false;
}

// do not create quests that refer to geometry that is too long for a surveyor to be
// expected to survey
if(geometry.polylines != null)
{
double distance = 0;
for (List<LatLon> polyline : geometry.polylines)
{
distance += SphericalEarthMath.distance(polyline);
}
if(distance > MAX_GEOMETRY_LENGTH_IN_METERS) return false;
}

// do not create quests whose marker is at a blacklisted position
if(blacklistedPositions != null && blacklistedPositions.contains(geometry.center))
{
Expand Down

5 comments on commit ccff698

@matkoniecz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it makes sense to make an exception for surface quest.

@HolgerJeromin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surface quests make sense for more than 500 meter, but not for 10 km roads...

@matkoniecz
Copy link
Member

@matkoniecz matkoniecz commented on ccff698 Sep 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 km road segments are usually on main roads that typically are not changing surface.

Such ways are nice to survey from a bicycle or as a passenger in a bus/car.

@westnordost
Copy link
Member Author

@westnordost westnordost commented on ccff698 Sep 29, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matkoniecz
Copy link
Member

@matkoniecz matkoniecz commented on ccff698 Sep 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that (really rare) case I create notes from within SC or edit directly in Vespucci after the survey.

Sometimes I just select surface=paved if I failed to catch exact location of the transition.

Please sign in to comment.