Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHGeocodingEntry uses wrong JsonProperty #1825

Closed
calvinkehl opened this issue Dec 13, 2019 · 4 comments
Closed

GHGeocodingEntry uses wrong JsonProperty #1825

calvinkehl opened this issue Dec 13, 2019 · 4 comments
Labels
Milestone

Comments

@calvinkehl
Copy link

Describe the bug
The class GHGeocodingEntry uses "house_number" as JsonProperty:

@JsonProperty("house_number")
public void setHouseNumber(String houseNumber) {
    this.houseNumber = houseNumber;
}

The geocoding API response (https://graphhopper.com/api/1/geocode) sends property as "housenumber". Therefore all hits contain houseNumber = null.

To Reproduce
Make an API call as follows:

...
GraphHopperGeocoding graphHopperGeocoding = new GraphHopperGeocoding();
boolean reverse = true;
GHPoint point = new GHPoint(location.getLatitude(), location.getLongitude());
GHGeocodingRequest req = new GHGeocodingRequest(point, "de", 20);
graphHopperGeocoding.setKey(KEY);
GHGeocodingResponse resp = graphHopperGeocoding.geocode(req);
for (GHGeocodingEntry hit : resp.getHits()) {
    hit.getHouseNumber(); // always null!
}

hit.getHouseNumber() will always be null, no matter what location you put in.

Expected behavior
hit.getHouseNumber() should return the actual housenumber ;-)

System Information
JAVA 1.8, directions-api-client-hc-0.10.0.jar (Code of GHGeocodingEntry is the same on master).

@karussell
Copy link
Member

karussell commented Dec 13, 2019

Are you sure that this fails? If yes, then it must be something else as we include both properties in the output: graphhopper/geocoder-converter#57

@calvinkehl
Copy link
Author

I'm not using the geocoder-converter, I'm using graphhopper/client-hc!

@karussell
Copy link
Member

Sorry, I meant a different thing. But yes, this does not apply to the default geocoding provider. Will fix this.

@karussell karussell added the bug label Dec 13, 2019
@karussell karussell added this to the 1.0 milestone Dec 13, 2019
karussell added a commit that referenced this issue Dec 13, 2019
@karussell
Copy link
Member

Thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants