title: Google GeoLocation API returns different results for the same wifi access point
body: <p>We are using Google's geolocation API to get the latlong for the wifi access points.  We are seeing inconsistent results.  Google's API returns different latlong on different boxes.  When I test on my development box, I get the latlong which points to a location in US.  When I test the same on the amazon ec2 box, I get the latlong which points to a location in Japan.  Has anybody else experienced the same with Google's GeoLocation API?<br>
  Below is the code and the response strings from both hosts.  JDK and JSON jar version is same on both the hosts.</p>
  
  <pre><code>public void testWifiIdMappingApi() {
  
      String apiUrl = "https://www.googleapis.com/geolocation/v1/geolocate?key=xxxxxxxxxxxxxxxxxxxxxxxx";
  
  InputStream inputStream = null;
  HttpsURLConnection con = null;
  DataOutputStream wr = null;
  try {
      URL url = new URL(apiUrl);                  
      con = (HttpsURLConnection) url.openConnection();
          con.setRequestMethod("POST");
      con.setRequestProperty("Content-Type", "application/json");
      con.setDoInput(true);
      con.setDoOutput(true);
      con.connect();
      JSONObject obj = new JSONObject();
      JSONArray wifiAry = new JSONArray();
      JSONObject wifiObj = new JSONObject();
      wifiObj.put("macAddress", "6c:f3:7f:4b:37:74");
      wifiObj.put("signalStrength", 60);
          wifiAry.add(wifiObj);
      wifiObj = new JSONObject();
      wifiObj.put("macAddress", "6c:f3:7f:4b:37:75");
      wifiObj.put("signalStrength", 60);
      wifiAry.add(wifiObj);
      obj.put("wifiAccessPoints", wifiAry);
      System.out.println(obj.toString());
      wr = new DataOutputStream(con.getOutputStream());
      wr.writeBytes(obj.toString());
      wr.flush();
      wr.close();
      int responseCode = con.getResponseCode();
      inputStream = null;
      if (responseCode == HttpsURLConnection.HTTP_OK) {
      inputStream = con.getInputStream();
          } else {
      inputStream = con.getErrorStream();
          }
      final char[] buffer = new char[4096];
      StringBuilder response = new StringBuilder();
      Reader r = new InputStreamReader(inputStream, "UTF-8");
      int read;
      do {
      read = r.read(buffer, 0, buffer.length);
      if (read &gt; 0) {
          response.append(buffer, 0, read);
      }
      } while (read &gt;= 0);
      System.out.println(new java.util.Date() + " - "
                  + response.toString());
  
  } catch (Exception e) {
      e.printStackTrace();
  } finally {
      try {
      if (inputStream != null)
          inputStream.close();
      if (wr != null)
          wr.close();
      if (con != null)
          con.disconnect();
      } catch (Exception e) {
          }
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Input JSON String</strong></p>
  
  <p>{"wifiAccessPoints":[{"signalStrength":60,"macAddress":"6c:f3:7f:4b:37:74"},
      {"signalStrength":60,"macAddress":"6c:f3:7f:4b:37:75"}]}</p>
  
  <p><strong>Response on the amazon ec2 host</strong>
  {
      "location": {
          "lat": 40.603124,
          "lng": 140.463922
       },
       "accuracy": 122000.0
  }</p>
  
  <p><strong>Response on my development box (windows 7)</strong></p>
  
  <p>{
      "location": {
          "lat": 37.593392,
          "lng": -122.04383
      },
      "accuracy": 22000.0
  }</p>