/[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 2302 by torben, Sun Feb 15 16:09:11 2015 UTC revision 2303 by torben, Sun Feb 15 16:53:13 2015 UTC
# Line 23  public class AdressSearch { Line 23  public class AdressSearch {
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                    
# Line 56  public class AdressSearch { Line 58  public class AdressSearch {
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                                    
# Line 105  public class AdressSearch { Line 118  public class AdressSearch {
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();

Legend:
Removed from v.2302  
changed lines
  Added in v.2303

  ViewVC Help
Powered by ViewVC 1.1.20