/[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 2300 by torben, Sun Feb 15 14:17:03 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 31  public class AdressSearch { Line 33  public class AdressSearch {
33                                    
34                  int postnr=0;                  int postnr=0;
35                  boolean google = false;                  boolean google = false;
36                    boolean osm = false;
37                                    
38                  try {                  try {
39                          postnr = Integer.parseInt(postnrStr);                          postnr = Integer.parseInt(postnrStr);
# Line 53  public class AdressSearch { Line 56  public class AdressSearch {
56                  }                  }
57                                    
58                  Long gadeident =  postnrVeje.get(vasketVejnavn);                  Long gadeident =  postnrVeje.get(vasketVejnavn);
59                    
60                    if ( gadeident == null) {
61                            gadeident = helperCache.get(vasketVejnavn);
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 86  public class AdressSearch { Line 110  public class AdressSearch {
110                                    
111                  SearchResult res = new SearchResult(addr);                  SearchResult res = new SearchResult(addr);
112                  res.google = google;                  res.google = google;
113                    res.osm = osm;
114                  return res;                  return res;
115          }          }
116                    
# Line 93  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.2300  
changed lines
  Added in v.2303

  ViewVC Help
Powered by ViewVC 1.1.20