/[projects]/dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AdressSearch.java
ViewVC logotype

Diff of /dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AdressSearch.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2382 by torben, Thu Feb 26 10:39:12 2015 UTC revision 2383 by torben, Thu Feb 26 11:25:26 2015 UTC
# Line 83  public class AdressSearch { Line 83  public class AdressSearch {
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);
# Line 100  public class AdressSearch { Line 102  public class AdressSearch {
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);
# Line 115  public class AdressSearch { Line 117  public class AdressSearch {
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;

Legend:
Removed from v.2382  
changed lines
  Added in v.2383

  ViewVC Help
Powered by ViewVC 1.1.20