83 |
} |
} |
84 |
|
|
85 |
|
|
86 |
|
// Brug OpenStreetMap før vi prøver google |
87 |
|
// For google har en request limit, det har OSM ikke! |
88 |
if ( gadeident == null) { |
if ( gadeident == null) { |
89 |
if (config.useGoogle) { |
if (config.useOpenStreetMaps) { |
90 |
result.googleVej = GeocodeHelper.googleHelper(config, postnr, result.splitResult.vej ); |
result.osmVej = GeocodeHelper.openstreetmapHelper(config, postnr, result.splitResult.vej ); |
91 |
result.google = true; |
result.osm = true; |
92 |
|
|
93 |
if (result.googleVej != null) { |
if (result.osmVej != null) { |
94 |
String googleVasket = AddressUtils.vaskVejnavn( result.googleVej ); |
String osmVasket = AddressUtils.vaskVejnavn( result.osmVej ); |
95 |
gadeident = postnrVeje.get(googleVasket); |
gadeident = postnrVeje.get(osmVasket); |
96 |
|
|
97 |
if (gadeident != null) { |
if (gadeident != null) { |
98 |
helperCache.put(helperSearchKey, gadeident); |
helperCache.put(helperSearchKey, gadeident); |
102 |
} |
} |
103 |
|
|
104 |
if ( gadeident == null) { |
if ( gadeident == null) { |
105 |
if (config.useOpenStreetMaps) { |
if (config.useGoogle) { |
106 |
result.osmVej = GeocodeHelper.openstreetmapHelper(config, postnr, result.splitResult.vej ); |
result.googleVej = GeocodeHelper.googleHelper(config, postnr, result.splitResult.vej ); |
107 |
result.osm = true; |
result.google = true; |
108 |
|
|
109 |
if (result.osmVej != null) { |
if (result.googleVej != null) { |
110 |
String osmVasket = AddressUtils.vaskVejnavn( result.osmVej ); |
String googleVasket = AddressUtils.vaskVejnavn( result.googleVej ); |
111 |
gadeident = postnrVeje.get(osmVasket); |
gadeident = postnrVeje.get(googleVasket); |
112 |
|
|
113 |
if (gadeident != null) { |
if (gadeident != null) { |
114 |
helperCache.put(helperSearchKey, gadeident); |
helperCache.put(helperSearchKey, gadeident); |
117 |
} |
} |
118 |
} |
} |
119 |
|
|
120 |
|
|
121 |
|
|
122 |
if (gadeident == null) { |
if (gadeident == null) { |
123 |
result.status = Status.ERROR_UNKNOWN_STREETNAME; |
result.status = Status.ERROR_UNKNOWN_STREETNAME; |
124 |
return result; |
return result; |