0

I am trying to understand how exactly bounding box is working, but from my tests at the moment it seems that result is returned regardless of the bounding box limits.

I tried various approaches,but it appears that either the flow is working this way or I am missing something. In short, I have tried to put in example request: https://developer.here.com/api-explorer/rest/geocoder/latitude-longitude-by-mapview-parameter mapview in Boston suburban area and search text which is my home address in Bulgaria - few thousand miles away from the bounding box borders. However, I still get a result-my address Geocoded correctly. Since it is out of the bounding box I was expecting either 0 results or some exception. Or there is some parameter in the Response I can use for defining outboxing-for this case that might be the Distnace because I am too far but in addresses close to borders I am not sure if that will be fine.

My URL request: https://geocoder.api.here.com/6.2/geocode.json?searchtext=g.k.%20Krasna%20polyana%201%2022%D0%91%2C%201373%20g.k.%20Krasna%20polyana%201%2C%20Sofia&mapview=42.3902%2C-71.1293%3B42.3312%2C-71.0228&gen=9&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ

The result I got:

'{
  "Response": {
    "MetaInfo": {
      "Timestamp": "2019-08-16T16:31:38.596+0000"
    },
    "View": [
      {
        "_type": "SearchResultsViewType",
        "ViewId": 0,
        "Result": [
          {
            "Relevance": 0.88,
            "Distance": 7276566.3,
            "MatchLevel": "houseNumber",
            "MatchQuality": {
              "City": 1,
              "District": 0.88,
              "Street": [
                0.85
              ],
              "HouseNumber": 1,
              "PostalCode": 0.56
            },
            "MatchType": "interpolated",
            "Location": {
              "LocationId": "NT_i2D3cJK.runCacYakfrAxD_yIjQ",
              "LocationType": "address",
              "DisplayPosition": {
                "Latitude": 42.69695,
                "Longitude": 23.28172
              },
              "NavigationPosition": [
                {
                  "Latitude": 42.69709,
                  "Longitude": 23.28169
                }
              ],
              "MapView": {
                "TopLeft": {
                  "Latitude": 42.6980742,
                  "Longitude": 23.2801904
                },
                "BottomRight": {
                  "Latitude": 42.6958258,
                  "Longitude": 23.2832496
                }
              },
              "Address": {
                "Label": "жк Красна поляна 1 22Б, 1330 София, България",
                "Country": "BGR",
                "County": "София-град",
                "City": "София",
                "District": "Красна поляна",
                "Street": "жк Красна поляна 1",
                "HouseNumber": "22Б",
                "PostalCode": "1330",
                "AdditionalData": [
                  {
                    "value": "България",
                    "key": "CountryName"
                  },
                  {
                    "value": "София-град",
                    "key": "CountyName"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  }
}'

I am expecting some standard way to catch the results out of the bounding box. Actually, it seems that either there is no clear value to count on or I am missing something about the way it works. Thanks in advance!

1 Answer 1

0

I think you are looking for this one:

bbox - A type of Spatial Filter. A spatial filter limits the search for any other attributes in the request.

For your example: https://geocoder.api.here.com/6.2/geocode.json?searchtext=g.k.%20Krasna%20polyana%201%2022%D0%91%2C%201373%20g.k.%20Krasna%20polyana%201%2C%20Sofia&bbox=42.3902%2C-71.1293%3B42.3312%2C-71.0228&&app_id=yyy&app_code=xxx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.