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 |
|
google = true; |
68 |
|
|
69 |
if (googleVej != null) { |
if (googleVej != null) { |
70 |
String googleVasket = AddressUtils.vaskVejnavn( googleVej ); |
String googleVasket = AddressUtils.vaskVejnavn( googleVej ); |
71 |
gadeident = postnrVeje.get(googleVasket); |
gadeident = postnrVeje.get(googleVasket); |
72 |
google = true; |
|
73 |
|
if (gadeident != null) { |
74 |
|
helperCache.put(vasketVejnavn, gadeident); |
75 |
|
} |
76 |
|
} |
77 |
|
} |
78 |
|
|
79 |
|
if ( gadeident == null) { |
80 |
|
String osmVej = GeocodeHelper.openstreetmapHelper(postnr, split.vej ); |
81 |
|
osm = true; |
82 |
|
|
83 |
|
if (osmVej != null) { |
84 |
|
String osmVasket = AddressUtils.vaskVejnavn( osmVej ); |
85 |
|
gadeident = postnrVeje.get(osmVasket); |
86 |
|
|
87 |
|
if (gadeident != null) { |
88 |
|
helperCache.put(vasketVejnavn, gadeident); |
89 |
|
} |
90 |
} |
} |
91 |
} |
} |
92 |
|
|
122 |
public void buildSearchStructures() throws SQLException{ |
public void buildSearchStructures() throws SQLException{ |
123 |
searchPostnrVejnavnGadeid = new HashMap<Integer, Map<String,Long>>(); |
searchPostnrVejnavnGadeid = new HashMap<Integer, Map<String,Long>>(); |
124 |
searchGadeidentAdresser = new HashMap<Long, Map<String,Address>>(); |
searchGadeidentAdresser = new HashMap<Long, Map<String,Address>>(); |
125 |
|
helperCache = new ConcurrentHashMap<String,Long>(); |
126 |
|
|
127 |
System.out.println("Build -- stage 1"); |
System.out.println("Build -- stage 1"); |
128 |
|
|
129 |
alleAdresser = DatabaseLayer.getAllAdresses(); |
alleAdresser = DatabaseLayer.getAllAdresses(); |