diff --git a/source/de/anomic/data/OpenGeoDB.java b/source/de/anomic/data/OpenGeoDB.java index 42c896bbf..4405badda 100644 --- a/source/de/anomic/data/OpenGeoDB.java +++ b/source/de/anomic/data/OpenGeoDB.java @@ -38,9 +38,9 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Set; import java.util.SortedMap; -import java.util.SortedSet; import java.util.TreeMap; import java.util.zip.GZIPInputStream; @@ -170,8 +170,11 @@ public class OpenGeoDB { */ public HashSet find(String anyname) { HashSet r = new HashSet(); - List c; - c = this.locationName2ids.get(anyname); if (c != null) r.addAll(c); + SortedMap> cities = this.locationName2ids.tailMap(anyname); + for (Map.Entry> e: cities.entrySet()) { + if (e.getKey().toLowerCase().startsWith(anyname.toLowerCase())) r.addAll(e.getValue()); else break; + } + List c; c = this.kfz2ids.get(anyname); if (c != null) r.addAll(c); c = this.predial2ids.get(anyname); if (c != null) r.addAll(c); Integer i = this.zip2id.get(anyname); if (i != null) r.add(i);