Contrary to what we initially thought, there is no way to know if
Nominatim has further results or not. Even if the first results
returned by Nominatim are limited to 5 results (i.e less than the
maximum number of results Nominatim can return on a single page), it
does not mean that Nominatim has no further results.

So, we just assume that Nominatim may have further results.

Signed-off-by: Thomas Petazzoni <[email protected]>
---
 www/maposmatic/nominatim.py |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/www/maposmatic/nominatim.py b/www/maposmatic/nominatim.py
index cc83506..e06afa9 100644
--- a/www/maposmatic/nominatim.py
+++ b/www/maposmatic/nominatim.py
@@ -146,13 +146,10 @@ def _compute_prev_next_excludes(xml):
     """
     excludes = xml.getroot().get("exclude_place_ids", None)
 
-    # If the current number of entries is 10, we have other entries
-    if (len(xml.getroot().getchildren()) == 
NOMINATIM_MAX_RESULTS_PER_RESPONSE):
-        nextexcludes = excludes
-        hasnext = True
-    else:
-        nextexcludes = ""
-        hasnext = False
+    # Assume we always have next entries, because there is no way to
+    # know in advance if Nominatim has further entries.
+    nextexcludes = excludes
+    hasnext = True
 
     # Compute the exclude list to get the previous list
     prevexcludes = ""
-- 
1.7.4.1


Reply via email to