[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH] maposmatic/nominatim: fix Nominatim handling of
From: |
Thomas Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH] maposmatic/nominatim: fix Nominatim handling of next results |
Date: |
Sun, 25 Mar 2012 16:50:27 +0200 |
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 <address@hidden>
---
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Maposmatic-dev] [PATCH] maposmatic/nominatim: fix Nominatim handling of next results,
Thomas Petazzoni <=