23 |
|
|
24 |
List<Address> alleAdresser; |
List<Address> alleAdresser; |
25 |
|
|
26 |
|
Map<String,Long> helperCache; |
27 |
|
|
28 |
|
|
29 |
Map<Integer,HundredePctBean> hundredePct; |
Map<Integer,HundredePctBean> hundredePct; |
30 |
|
|
58 |
Long gadeident = postnrVeje.get(vasketVejnavn); |
Long gadeident = postnrVeje.get(vasketVejnavn); |
59 |
|
|
60 |
if ( gadeident == null) { |
if ( gadeident == null) { |
61 |
String osmVej = GeocodeHelper.openstreetmapHelper(postnr, split.vej ); |
gadeident = helperCache.get(vasketVejnavn); |
|
if (osmVej != null) { |
|
|
String osmVasket = AddressUtils.vaskVejnavn( osmVej ); |
|
|
gadeident = postnrVeje.get(osmVasket); |
|
|
osm = true; |
|
|
} |
|
62 |
} |
} |
63 |
|
|
64 |
|
|
65 |
if ( gadeident == null) { |
if ( gadeident == null) { |
66 |
String googleVej = GeocodeHelper.googleHelper(postnr, split.vej ); |
String googleVej = GeocodeHelper.googleHelper(postnr, split.vej ); |
67 |
if (googleVej != null) { |
if (googleVej != null) { |
68 |
String googleVasket = AddressUtils.vaskVejnavn( googleVej ); |
String googleVasket = AddressUtils.vaskVejnavn( googleVej ); |
69 |
gadeident = postnrVeje.get(googleVasket); |
gadeident = postnrVeje.get(googleVasket); |
70 |
google = true; |
google = true; |
71 |
|
if (gadeident != null) { |
72 |
|
helperCache.put(googleVasket, gadeident); |
73 |
|
} |
74 |
|
} |
75 |
|
} |
76 |
|
|
77 |
|
if ( gadeident == null) { |
78 |
|
String osmVej = GeocodeHelper.openstreetmapHelper(postnr, split.vej ); |
79 |
|
if (osmVej != null) { |
80 |
|
String osmVasket = AddressUtils.vaskVejnavn( osmVej ); |
81 |
|
gadeident = postnrVeje.get(osmVasket); |
82 |
|
osm = true; |
83 |
|
if (gadeident != null) { |
84 |
|
helperCache.put(osmVasket, gadeident); |
85 |
|
} |
86 |
} |
} |
87 |
} |
} |
88 |
|
|
118 |
public void buildSearchStructures() throws SQLException{ |
public void buildSearchStructures() throws SQLException{ |
119 |
searchPostnrVejnavnGadeid = new HashMap<Integer, Map<String,Long>>(); |
searchPostnrVejnavnGadeid = new HashMap<Integer, Map<String,Long>>(); |
120 |
searchGadeidentAdresser = new HashMap<Long, Map<String,Address>>(); |
searchGadeidentAdresser = new HashMap<Long, Map<String,Address>>(); |
121 |
|
helperCache = new ConcurrentHashMap<String,Long>(); |
122 |
|
|
123 |
System.out.println("Build -- stage 1"); |
System.out.println("Build -- stage 1"); |
124 |
|
|
125 |
alleAdresser = DatabaseLayer.getAllAdresses(); |
alleAdresser = DatabaseLayer.getAllAdresses(); |