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

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

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

revision 2301 by torben, Sun Feb 15 16:09:11 2015 UTC revision 2324 by torben, Wed Feb 18 07:45:28 2015 UTC
# Line 14  import com.google.code.geocoder.model.Ge Line 14  import com.google.code.geocoder.model.Ge
14  import com.google.gson.Gson;  import com.google.gson.Gson;
15    
16  import dk.daoas.daoadresseservice.beans.OSMAddress;  import dk.daoas.daoadresseservice.beans.OSMAddress;
17    import dk.daoas.daoadresseservice.util.HttpUtil;
18    
19  public class GeocodeHelper {  public class GeocodeHelper {
20                    
# Line 21  public class GeocodeHelper { Line 22  public class GeocodeHelper {
22                    
23    
24    
25          public static void main(String[] args) throws IOException {                      public static void main(String[] args) throws IOException {
26                  //System.out.println(  GeocodeHelper.googleHelper(2800, "Chr. Xs Alle") );                  int post = 8700;
27                  System.out.println(  GeocodeHelper.openstreetmapHelper(2800, "Chr. Xs Alle") );                  String vej = "Enebarvej";
28                  System.out.println(  GeocodeHelper.openstreetmapHelper(8700, "Enebaervej") );                  
29                    long start1 = System.currentTimeMillis();
30                    System.out.println( "Google:" +  GeocodeHelper.googleHelper(post, vej) );              
31                    long stop1 = System.currentTimeMillis();
32                    
33                    long start2 = System.currentTimeMillis();
34                    System.out.println( "OSM:" +  GeocodeHelper.openstreetmapHelper(post, vej) );
35                    long stop2 = System.currentTimeMillis();
36                    
37                    System.out.println("Google: " + (stop1-start1));
38                    System.out.println("OSM: " + (stop2-start2));
39          }          }
40                    
41          public static String openstreetmapHelper(int postnr, String vejnavn) {          public static String openstreetmapHelper(int postnr, String vejnavn) {
# Line 72  public class GeocodeHelper { Line 83  public class GeocodeHelper {
83                                                    
84                          //System.out.println( "Status: >" + geocoderResponse.getStatus() + "<");                          //System.out.println( "Status: >" + geocoderResponse.getStatus() + "<");
85                          if (  geocoderResponse.getStatus() != GeocoderStatus.OK) {                          if (  geocoderResponse.getStatus() != GeocoderStatus.OK) {
86                                    System.out.println("Google responded with " + geocoderResponse.getStatus() );
87                                  return null;                                  return null;
88                          }                          }
89                                                    

Legend:
Removed from v.2301  
changed lines
  Added in v.2324

  ViewVC Help
Powered by ViewVC 1.1.20