diff --git a/source/net/yacy/document/geolocalization/GeoLocation.java b/source/net/yacy/document/geolocalization/GeoLocation.java index 6e0bda36f..c9b5e21f4 100644 --- a/source/net/yacy/document/geolocalization/GeoLocation.java +++ b/source/net/yacy/document/geolocalization/GeoLocation.java @@ -24,10 +24,12 @@ package net.yacy.document.geolocalization; import java.util.Comparator; +import net.yacy.cora.document.UTF8; + public class GeoLocation extends IntegerGeoPoint implements Comparable, Comparator { - private String name; + private byte[] name; private int population; public GeoLocation(double lat, double lon) { @@ -38,15 +40,15 @@ public class GeoLocation extends IntegerGeoPoint implements Comparable locTypeHash2locType; private final Map id2loc; - private final Map id2locTypeHash; private final TreeMap> name2ids; private final TreeMap> kfz2ids; private final Map> predial2ids; @@ -64,13 +62,9 @@ public class OpenGeoDBLocalization implements Localization public OpenGeoDBLocalization(final File file, final boolean lonlat) { this.file = file; - this.locTypeHash2locType = new HashMap(); this.id2loc = new HashMap(); - this.id2locTypeHash = new HashMap(); - this.name2ids = - new TreeMap>(StringBuilderComparator.CASE_INSENSITIVE_ORDER); - this.kfz2ids = - new TreeMap>(StringBuilderComparator.CASE_INSENSITIVE_ORDER); + this.name2ids = new TreeMap>(StringBuilderComparator.CASE_INSENSITIVE_ORDER); + this.kfz2ids = new TreeMap>(StringBuilderComparator.CASE_INSENSITIVE_ORDER); this.predial2ids = new HashMap>(); this.zip2id = new HashMap(); @@ -143,11 +137,13 @@ public class OpenGeoDBLocalization implements Localization id = Integer.parseInt(v[0]); h = removeQuotes(v[2]); final Integer hc = h.hashCode(); - final String t = this.locTypeHash2locType.get(hc); - if ( t == null ) { - this.locTypeHash2locType.put(hc, h); + /* + final byte[] tb = this.locTypeHash2locType.get(hc); + if ( tb == null ) { + this.locTypeHash2locType.put(hc, UTF8.getBytes(h)); } this.id2locTypeHash.put(id, hc); + */ } else if ( v[1].equals("500300000") ) { // PLZ this.zip2id.put(removeQuotes(v[2]), Integer.parseInt(v[0])); } else if ( v[1].equals("500500000") ) { // KFZ-Kennzeichen diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index ce6aab283..7e40457be 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -322,6 +322,7 @@ public final class Switchboard extends serverSwitch getDataPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT); this.log.logConfig("HTDOCS Path: " + this.htDocsPath.toString()); this.workPath = getDataPath(SwitchboardConstants.WORK_PATH, SwitchboardConstants.WORK_PATH_DEFAULT); + this.workPath.mkdirs(); this.log.logConfig("Work Path: " + this.workPath.toString()); this.dictionariesPath = getDataPath( @@ -329,8 +330,16 @@ public final class Switchboard extends serverSwitch SwitchboardConstants.DICTIONARY_SOURCE_PATH_DEFAULT); this.log.logConfig("Dictionaries Path:" + this.dictionariesPath.toString()); + // init libraries + this.log.logConfig("initializing libraries"); + new Thread() { + @Override + public void run() { + LibraryProvider.initialize(Switchboard.this.dictionariesPath); + } + }.start(); + // init global host name cache - this.workPath.mkdirs(); Domains.init(new File(this.workPath, "globalhosts.list")); // init sessionid name file @@ -341,15 +350,6 @@ public final class Switchboard extends serverSwitch // init tables this.tables = new WorkTables(this.workPath); - // init libraries - this.log.logConfig("initializing libraries"); - new Thread() { - @Override - public void run() { - LibraryProvider.initialize(Switchboard.this.dictionariesPath); - } - }.start(); - // set a high maximum cache size to current size; this is adopted later automatically final int wordCacheMaxCount = (int) getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 20000); setConfig(SwitchboardConstants.WORDCACHE_MAX_COUNT, Integer.toString(wordCacheMaxCount));