Package org.opentripplanner.geocoder

Examples of org.opentripplanner.geocoder.GeocoderResult


        final String description = "121 elm street";
       
        geocoderServer.geocoder = new Geocoder() {
            @Override
            public GeocoderResults geocode(String address, Envelope bbox) {
                GeocoderResult result = new GeocoderResult(lat, lng, description);
                return new GeocoderResults(Arrays.asList(result));
            }
        };
       
        GeocoderResults results = geocoderServer.geocode("121 elm street", null);
        for (GeocoderResult result : results.getResults()) {
            // should only have one result
            assertEquals("description matches", description, result.getDescription());
            assertEquals(lat, result.getLat(), 0.001);
            assertEquals(lng, result.getLng(), 0.001);
        }
    }
View Full Code Here


      if (line1 != null && !line1.trim().isEmpty()) {
        addressString = line1 + ", " + line2;
      } else {
        addressString = line2;
      }
      geocoderResults.add(new GeocoderResult(lat, lng, addressString));
    }
    return new GeocoderResults(geocoderResults);
  }
View Full Code Here

      Double lat = location.getLat();
      Double lng = location.getLng();
     
      String formattedAddress = googleGeocoderResult.getFormatted_address();
     
      GeocoderResult geocoderResult = new GeocoderResult(lat, lng, formattedAddress);
      geocoderResults.add(geocoderResult);
    }

    return new GeocoderResults(geocoderResults);
  }
View Full Code Here

        List<GeocoderResult> geocoderResults = new ArrayList<GeocoderResult>();
        for (NominatimGeocoderResult nominatimGeocoderResult : nominatimResults) {
            Double lat = nominatimGeocoderResult.getLatDouble();
            Double lng = nominatimGeocoderResult.getLngDouble();
            String displayName = nominatimGeocoderResult.getDisplay_name();
            GeocoderResult geocoderResult = new GeocoderResult(lat, lng, displayName);
            geocoderResults.add(geocoderResult);
        }
        return new GeocoderResults(geocoderResults);
    }
View Full Code Here

TOP

Related Classes of org.opentripplanner.geocoder.GeocoderResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.