Skip to content

Commit

Permalink
same as Photon – without trailing /
Browse files Browse the repository at this point in the history
  • Loading branch information
cpesch committed Sep 18, 2024
1 parent fd3874a commit acb9e5d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public boolean isOverQueryLimit() {
}

private String getNominatimUrl() {
return preferences.get(NOMINATIM_URL_PREFERENCE, "https://nominatim.openstreetmap.org/");
return preferences.get(NOMINATIM_URL_PREFERENCE, "https://nominatim.openstreetmap.org");
}

private String execute(String uri) throws IOException {
Expand Down Expand Up @@ -95,7 +95,7 @@ private List<NavigationPosition> extractPositions(List<PlaceType> placeTypes) {
}

public List<NavigationPosition> getPositionsFor(String address) throws IOException {
SearchresultsType result = getSearchFor("search?q=" + encodeUri(address) + "&limit=10&format=xml");
SearchresultsType result = getSearchFor("/search?q=" + encodeUri(address) + "&limit=10&format=xml");
if (result == null)
return null;
return extractPositions(result.getPlace());
Expand All @@ -114,7 +114,7 @@ private ReversegeocodeType getReverseFor(String uri) throws IOException {
}

public String getAddressFor(NavigationPosition position) throws IOException {
ReversegeocodeType type = getReverseFor("reverse?lat=" + position.getLatitude() +
ReversegeocodeType type = getReverseFor("/reverse?lat=" + position.getLatitude() +
"&lon=" + position.getLongitude() + "&zoom=18&addressdetails=1&format=xml");
if (type == null)
return null;
Expand Down

0 comments on commit acb9e5d

Please sign in to comment.