Find nearby addresses limited by a spatial filter

The Reverse Geocode resource offers the ability to find the nearest addresses based on querying with geocoordinates. It is an option to use a circular spatial filter (in=circle:lat,lon;rad) instead of specifying a spatial context (at=lat,lon).

Submit the HTTP GET request to https://revgeocode.search.hereapi.com/v1/revgeocode with the appropriate parameters for your search.

Procedure

A user selects a map point on a location in Nendaz, Switzerland, identifying point coordinates, sets a result size and radial limit and submits the following request to the endpoint:

GET https://revgeocode.search.hereapi.com/v1/
    revgeocode
    ?in=circle%3A46.180298%2C7.2913685%3Br%3D25
    &limit=20
    &apiKey={YOUR_API_KEY}

The following parameters are used:

  • in - Search within a geographic area. Results will be returned if they are located within the specified area.
  • limit - Maximum number of results to be returned.
  • apiKey - Your API key.

Note

This request uses API key authentication. For more information about authentication options on the HERE platform, see the Identity & Access Management Guide.

The API returns the nearest address - "Route de la Télécabine 67, 1997 Nendaz Valais, Suisse" and only some additional nearby results from within the radial limitation.

The response to the above request looks like the following:

{
  "items": [
    {
      "title": "Route de la Télécabine 67, 1997 Nendaz Valais, Suisse",
      "id": "here:af:streetsection:9z62iGVQH0LlHrihOC9UMD:CgcIBCDLq9J-EAEaAjY3",
      "resultType": "houseNumber",
      "houseNumberType": "PA",
      "address": {
        "label": "Route de la Télécabine 67, 1997 Nendaz Valais, Suisse",
        "countryCode": "CHE",
        "countryName": "Suisse",
        "state": "Valais",
        "county": "Conthey",
        "city": "Nendaz",
        "district": "Haute-Nendaz",
        "street": "Route de la Télécabine",
        "postalCode": "1997",
        "houseNumber": "67"
      },
      "position": {
        "lat": 46.18017,
        "lng": 7.29134
      },
      "access": [
        {
          "lat": 46.18028,
          "lng": 7.29128
        }
      ],
      "distance": 15,
      "mapView": {
        "west": 7.29039,
        "south": 46.17957,
        "east": 7.29552,
        "north": 46.18338
      }
    },
    {
      "title": "Nv Remontées Mécaniques SA",
      "id": "here:pds:place:756u0jnt-1c66d7a60c1645c2a827244ca1cf9bfe",
      "resultType": "place",
      "address": {
        "label": "Nv Remontées Mécaniques SA, Route de la Télécabine, 1997 Nendaz Valais, Suisse",
        "countryCode": "CHE",
        "countryName": "Suisse",
        "state": "Valais",
        "county": "Conthey",
        "city": "Nendaz",
        "district": "Haute-Nendaz",
        "street": "Route de la Télécabine",
        "postalCode": "1997"
      },
      "position": {
        "lat": 46.18017,
        "lng": 7.29134
      },
      "access": [
        {
          "lat": 46.18028,
          "lng": 7.29128
        }
      ],
      "distance": 15,
      "categories": [
        {
          "id": "800-8600-0197",
          "primary": true
        }
      ]
    },
    {
      "title": "Route de la Télécabine, 1997 Nendaz Valais, Suisse",
      "id": "here:af:streetsection:9z62iGVQH0LlHrihOC9UMD",
      "resultType": "street",
      "address": {
        "label": "Route de la Télécabine, 1997 Nendaz Valais, Suisse",
        "countryCode": "CHE",
        "countryName": "Suisse",
        "state": "Valais",
        "county": "Conthey",
        "city": "Nendaz",
        "district": "Haute-Nendaz",
        "street": "Route de la Télécabine",
        "postalCode": "1997"
      },
      "position": {
        "lat": 46.18125,
        "lng": 7.29297
      },
      "distance": 1,
      "mapView": {
        "west": 7.29039,
        "south": 46.17957,
        "east": 7.29552,
        "north": 46.18338
      }
    }
  ]
}

Review the result JSON. You see much more detail about the address. Notice the reduction of the additional returned addresses due to the given spatial limitation. Notice the distance from the map point (in meters) towards the nearest coordinates of the returned item. The nearest coordinates might differ from its position or access coordinates which may lay outside the spatial filter.

results matching ""

    No results matching ""