--- dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AdressSearch.java 2015/02/26 10:39:12 2382 +++ dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AdressSearch.java 2015/02/26 11:25:26 2383 @@ -83,14 +83,16 @@ } + // Brug OpenStreetMap før vi prøver google + // For google har en request limit, det har OSM ikke! if ( gadeident == null) { - if (config.useGoogle) { - result.googleVej = GeocodeHelper.googleHelper(config, postnr, result.splitResult.vej ); - result.google = true; + if (config.useOpenStreetMaps) { + result.osmVej = GeocodeHelper.openstreetmapHelper(config, postnr, result.splitResult.vej ); + result.osm = true; - if (result.googleVej != null) { - String googleVasket = AddressUtils.vaskVejnavn( result.googleVej ); - gadeident = postnrVeje.get(googleVasket); + if (result.osmVej != null) { + String osmVasket = AddressUtils.vaskVejnavn( result.osmVej ); + gadeident = postnrVeje.get(osmVasket); if (gadeident != null) { helperCache.put(helperSearchKey, gadeident); @@ -100,13 +102,13 @@ } if ( gadeident == null) { - if (config.useOpenStreetMaps) { - result.osmVej = GeocodeHelper.openstreetmapHelper(config, postnr, result.splitResult.vej ); - result.osm = true; + if (config.useGoogle) { + result.googleVej = GeocodeHelper.googleHelper(config, postnr, result.splitResult.vej ); + result.google = true; - if (result.osmVej != null) { - String osmVasket = AddressUtils.vaskVejnavn( result.osmVej ); - gadeident = postnrVeje.get(osmVasket); + if (result.googleVej != null) { + String googleVasket = AddressUtils.vaskVejnavn( result.googleVej ); + gadeident = postnrVeje.get(googleVasket); if (gadeident != null) { helperCache.put(helperSearchKey, gadeident); @@ -115,6 +117,8 @@ } } + + if (gadeident == null) { result.status = Status.ERROR_UNKNOWN_STREETNAME; return result;