Search in sources :

Example 1 with GHGeocodingEntry

use of com.graphhopper.api.model.GHGeocodingEntry in project graphhopper by graphhopper.

the class GraphHopperGeocodingIT method testReverseGeocoding.

@Test
public void testReverseGeocoding() {
    GHGeocodingResponse response = geocoding.geocode(new GHGeocodingRequest(52.5170365, 13.3888599, "en", 5));
    assertEquals(5, response.getHits().size());
    GHGeocodingEntry entry = response.getHits().get(0);
    assertTrue(entry.getName().contains("Berlin"));
    assertEquals("place", entry.getOsmKey());
    assertEquals(0, entry.getExtent().length);
}
Also used : GHGeocodingRequest(com.graphhopper.api.model.GHGeocodingRequest) GHGeocodingEntry(com.graphhopper.api.model.GHGeocodingEntry) GHGeocodingResponse(com.graphhopper.api.model.GHGeocodingResponse) Test(org.junit.Test)

Aggregations

GHGeocodingEntry (com.graphhopper.api.model.GHGeocodingEntry)1 GHGeocodingRequest (com.graphhopper.api.model.GHGeocodingRequest)1 GHGeocodingResponse (com.graphhopper.api.model.GHGeocodingResponse)1 Test (org.junit.Test)1