title: Geocoding with java API
body: <p>I am using Nominatim java api for nomitim to get longitude and latitude attributes for given address:<a href="https://github.com/AtlisInc/Nominatim-API" rel="nofollow noreferrer">https://github.com/AtlisInc/Nominatim-API</a>. For every different input longitude and latitude outputs are being same.For latitude = 51.3258094 and for longitude = 11.3400106. What am I doing wrong?
  Here is the code:</p>
  
  <pre><code>public class Geocoding(){
  private volatile NominatimAPI nominatimAPI;//Use Volatile
  public NominatimAPI getNominatimAPI(){
  NominatimAPI result=nominatimAPI;
  if(result==null){
      synchronized (this){//Synchronize for thread safety
          result=nominatimAPI;
          if (result==null){
              result=new NominatimAPI();
              nominatimAPI=result;
          }
      }
  }
  return result;
  }
  
  private static void mymethod2() {
      List&lt;String&gt; cities = Arrays.asList("Los Angeles","Berlin");
      String endpointUrl = "https://nominatim.openstreetmap.org/";
      MapPoint mapPoint;
      Geocoding test=new Geocoding();
      for (String city : cities) {
          NominatimAPI nominatim = test.getNominatimAPI();
          Address address = new Address();
          address.setCity(city);
          nominatim.initNominatimAPI(endpointUrl);
          mapPoint = nominatim.getMapPointFromAddress(address, 18);
         System.out.println(mapPoint.getLatitude()+","+mapPoint.getLongitude());
  }
  }
  }
  </code></pre>