Skip to content

Commit 25a5d65

Browse files
committed
nominatim: add postalcode request parameter
1 parent 1b03f81 commit 25a5d65

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ The geocoding converter supports the following additional Nominatim parameters,
7777
- `viewbox`
7878
- `viewboxlbrt`
7979
- `bounded`
80+
- `postalcode`
8081

8182
**Response**
8283

src/main/java/com/graphhopper/converter/resources/ConverterResourceNominatim.java

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public Response handle(@QueryParam("q") @DefaultValue("") String query,
3939
@QueryParam("locale") @DefaultValue("") String locale,
4040
@QueryParam("viewbox") @DefaultValue("") String viewbox,
4141
@QueryParam("bounded") @DefaultValue("") String bounded,
42+
@QueryParam("postalcode") @DefaultValue("") String postalcode,
4243
@QueryParam("reverse") @DefaultValue("false") boolean reverse,
4344
@QueryParam("point") @DefaultValue("") String point
4445
) {
@@ -58,6 +59,9 @@ public Response handle(@QueryParam("q") @DefaultValue("") String query,
5859
queryParam("email", nominatimEmail).
5960
queryParam("addressdetails", "1");
6061

62+
if (!postalcode.isEmpty()) {
63+
target.queryParam("postalcode", postalcode);
64+
}
6165
if (!locale.isEmpty()) {
6266
locale = getLocaleFromParameter(locale);
6367
target = target.queryParam("accept-language", locale);

0 commit comments

Comments
 (0)