streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.85k stars 352 forks source link

Download zone size too big? #1357

Closed JulienPalard closed 5 years ago

JulienPalard commented 5 years ago

This is related to: https://github.com/westnordost/StreetComplete/issues/1232

I'm near Paris, France, with tons of quests. Around my house I've done everything the apps showed me. But there's still A LOT to do in this zone, the app just don't show them to me.

Instead the app shows me quests from the next city, where I never go.

I bet this is because my city and the other city are in the same "quests download zone" and I'm hitting the 2000 limit from https://github.com/westnordost/StreetComplete/pull/1180/commits/51f9c3510e36ef0ffa9b3bf3a0f82402a91ece38. Simple fix would be to move my ass to the other city, fix a lot of thing there, and come back home to enjoy new tasks, I know, but I won't do it þ

How to Reproduce Complete a small region in a quest-dense region, see there's still a lot of work to do (house numbers, foors, ...) that do not show up in the map.

Versions affected StreetComplete 10.2, Android 8.1.0.

matkoniecz commented 5 years ago

Can you share approximate location of where it happens to test what goes wrong?

I suspect that something else may be going on, download zones are not so big.

JulienPalard commented 5 years ago

I live near 48.9146531,2.1811596,20.75z, rue de la remise, 78420 Carrières-sur-Seine.

I compiled myself a version with a limit of 4k instead of 2k, and some new quests are poping, if this information can help.

westnordost commented 5 years ago

You are well informed, thank you! The limit will be the reason why certain quests may not pop up in your area any more. I am also not sure what to change here. If I set the limit higher, it will lead to performance problems. Note that this limit is per quest and per overpass-query bounding box. If you download at slightly different locations, it will be a different bbox and thus it will download another 2000 quests.

Currently, the constants are like this:

    public final static double
        MAX_DOWNLOADABLE_AREA_IN_SQKM = 50,
        MIN_DOWNLOADABLE_AREA_IN_SQKM = 4;

    public final static double MIN_DOWNLOADABLE_RADIUS_IN_METERS = 1000;

Btw, looking at your area, is it normal to have all those housenumbers not on the houses (or the entrances of the houses) but free-floating next to the street? You sure shouldn't do any housenumber quests in StreetComplete in areas like this.

JulienPalard commented 5 years ago

If I get your explanation and the constants right, the app should start by downloading 2000 quests in a 4km², and already at this point I'm hitting the 2000 limit? It may be right, 4km² looks big here and already points to place I'll never go (a bit more than 1h walking).

I think it would help me if the app started downloading at 1km² instead of 4km², I'll get things to do near me instead of far, and when I walk 1km I can still re-download.

What would it break?

(Thanks for noticing free-floating numbers, I'll fix them, at first by making them touch the polygon, as it's easy)

westnordost commented 5 years ago

4km² is only the minimum area to download. It works like this: When the app automatically decides to download quests, it creates a bounding box out of a radius around your current position. If you are in a WiFi, the radius is 2400m, if you are on a mobile connection, the radius is 800m. Then, additionally, that bbox is enlarged to fit into a spatial raster of zoom 14. In other words, bboxes actually downloaded are one or several map tiles of zoom level 14. This is because the app memorizes which tiles for one quest type have been downloaded already, so it does not download the same tiles over and over again.

Edit: And for the manual download, the constants I pasted above are used to ensure a minimum bbox size, the zoom-14 raster is also applied there.

westnordost commented 5 years ago

Since you compiled the app yourself, you may want to look into WifiAutoDownloadStrategyand MobileDataAutoDownloadStrategyand change those values there if you have Auto-Sync on. You could play around with those values and see what would be a good fit. Since the values in there currently stem rather from theoretical considerations, it would be good anyway to update them to something that comes from actually testing it out.

JulienPalard commented 5 years ago

I'm trying with lower values:

-               MAX_DOWNLOADABLE_AREA_IN_SQKM = 50,
-               MIN_DOWNLOADABLE_AREA_IN_SQKM = 4;
+               MAX_DOWNLOADABLE_AREA_IN_SQKM = 10,
+               MIN_DOWNLOADABLE_AREA_IN_SQKM = 1;

100 meter in mobile instead of 800, 1000 meter using Wi-Fi instead of 2400. I reset my DEFAULT_MAX_QUESTS to 2000 for fair comparison.

Those values make sense for me typically while working in Paris I don't want to download 800 meters around me, in 100 meters there's already thouthands of quests.

I'll try during the following weeks with those values and hopefully tell you back.

Instead of playing with constants which will probably never fit everyone, why not a "download for larger radius until enough quests found" approach? In my case it would stop soon (maybe at the first try), and in the case of someone in a less dense area it would still find remote quests after a few tries enlarging the search radius, showing them where to head.

westnordost commented 5 years ago

download for larger radius until enough quests found

"download for larger radius until enough quests for each quest type found" or generally, for all quests?

JulienPalard commented 5 years ago

This, for the moment, I don't know :)

westnordost commented 5 years ago

Cause for the second case (generally, all quests), this is already done. The quest auto syncer only stops downloading more and more quest types until in a certain area around you, there are "enough" quests.

test2a commented 5 years ago

Just chiming in, dont know where to ask but how do you refresh the map data on the app? There are street and building improvements on osm but steeetcomplete seems to be showing only cached data. There is one option to limit cache size but I dont see option to refresh the map.

HolgerJeromin commented 5 years ago

@test2a

how do you refresh the map data on the app

This is covered by #1011

JulienPalard commented 5 years ago

@test2a please discuss each subject in related issue if exists or create a new one, to keep issues readable. (thanks @HolgerJeromin for answering).

westnordost commented 5 years ago

@JulienPalard Did you reach any outcome?

JulienPalard commented 5 years ago

I think my current setup is:

               MAX_DOWNLOADABLE_AREA_IN_SQKM = 10,
               MIN_DOWNLOADABLE_AREA_IN_SQKM = 1;
               DEFAULT_MAX_QUESTS = 4000;

and it works well for me, in my specific area. I spend the last three weeks not being able to test it so I don't have more feedback.

Why not allowing to configure downloadable area and max quests in settings?

Maybe allow for DEFAULT_MAX_QUESTS = "1000, 2000, 4000, 8000" defaulting to 2000.

And for downloadable area maybe allow 10, 50, 100? So anyone can find a settings that fit their specific area needs?

westnordost commented 5 years ago

Ah you didn't adjust the radii specified in the DownloadStrategy?

Am 12. Mai 2019 12:26:24 MESZ schrieb Julien Palard notifications@github.com:

I think my current setup is:

              MAX_DOWNLOADABLE_AREA_IN_SQKM = 10,
              MIN_DOWNLOADABLE_AREA_IN_SQKM = 1;
              DEFAULT_MAX_QUESTS = 4000;

and it works well for me, in my specific area. I spend the last three weeks not being able to test it so I don't have more feedback.

Why not allowing to configure downloadable area and max quests in settings?

Maybe allow for DEFAULT_MAX_QUESTS = "1000, 2000, 4000, 8000" defaulting to 2000.

And for downloadable area maybe allow 10, 50, 100? So anyone can find a settings that fit their specific area needs?

JulienPalard commented 5 years ago

To be exhaustive:

diff --git a/app/src/main/java/de/westnordost/streetcomplete/ApplicationConstants.java b/app/src/main/java/de/westnordost/streetcomplete/ApplicationConstants.java
index 4c337c65..ab497175 100644
--- a/app/src/main/java/de/westnordost/streetcomplete/ApplicationConstants.java
+++ b/app/src/main/java/de/westnordost/streetcomplete/ApplicationConstants.java
@@ -15,8 +15,8 @@ public class ApplicationConstants
        public final static Date DATE_OF_BIRTH = new GregorianCalendar(2017,Calendar.FEBRUARY,20).getTime();

        public final static double
-               MAX_DOWNLOADABLE_AREA_IN_SQKM = 50,
-               MIN_DOWNLOADABLE_AREA_IN_SQKM = 4;
+               MAX_DOWNLOADABLE_AREA_IN_SQKM = 10,
+               MIN_DOWNLOADABLE_AREA_IN_SQKM = 1;

        public final static double MIN_DOWNLOADABLE_RADIUS_IN_METERS = 1000;

diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/download/MobileDataAutoDownloadStrategy.java b/app/src/main/java/de/westnordost/streetcomplete/data/download/MobileDataAutoDownloadStrategy.java
index f7761b92..71529db6 100644
--- a/app/src/main/java/de/westnordost/streetcomplete/data/download/MobileDataAutoDownloadStrategy.java
+++ b/app/src/main/java/de/westnordost/streetcomplete/data/download/MobileDataAutoDownloadStrategy.java
@@ -35,6 +35,6 @@ public class MobileDataAutoDownloadStrategy extends AActiveRadiusStrategy

        @Override protected int getDownloadRadius()
        {
-               return 800;
+               return 100;
        }
 }
diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/download/WifiAutoDownloadStrategy.java b/app/src/main/java/de/westnordost/streetcomplete/data/download/WifiAutoDownloadStrategy.java
index cac1b9f2..3e4942f1 100644
--- a/app/src/main/java/de/westnordost/streetcomplete/data/download/WifiAutoDownloadStrategy.java
+++ b/app/src/main/java/de/westnordost/streetcomplete/data/download/WifiAutoDownloadStrategy.java
@@ -44,6 +44,6 @@ public class WifiAutoDownloadStrategy extends AActiveRadiusStrategy

        @Override protected int getDownloadRadius()
        {
-               return 2400;
+               return 1000;
        }
 }
diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/osm/tql/OverpassQLUtil.java b/app/src/main/java/de/westnordost/streetcomplete/data/osm/tql/OverpassQLUtil.java
index 0d32f961..ddfe20c9 100644
--- a/app/src/main/java/de/westnordost/streetcomplete/data/osm/tql/OverpassQLUtil.java
+++ b/app/src/main/java/de/westnordost/streetcomplete/data/osm/tql/OverpassQLUtil.java
@@ -7,7 +7,7 @@ import de.westnordost.osmapi.map.data.BoundingBox;

 public class OverpassQLUtil
 {
-       public static final int DEFAULT_MAX_QUESTS = 2000;
+       public static final int DEFAULT_MAX_QUESTS = 4000;

        public static String getGlobalOverpassBBox(BoundingBox bbox)
        {
westnordost commented 5 years ago

Oh, I missed your reply. Sorry for not reacting

westnordost commented 5 years ago

I now changed it, though a bit more conservative than you changed it for yourself.

JulienPalard commented 5 years ago

@westnordost you're still replying faster than me in average ;) Thanks!

Don't hesitate to poke me when you push a new release, I'll use it.