Skip to content

Conversation

ruscon
Copy link
Contributor

@ruscon ruscon commented Feb 16, 2019

search address: 1200 E 89th St, Chicago, IL 60619, USA

HERE provider response:

{
  "Response": {
    "MetaInfo": {
      "Timestamp": "2019-02-14T22:22:52.180+0000"
    },
    "View": [
      {
        "_type": "SearchResultsViewType",
        "ViewId": 0,
        "Result": [
          {
            "Relevance": 0.99,
            "MatchLevel": "houseNumber",
            "MatchQuality": {
              "City": 1,
              "Street": [
                1
              ],
              "HouseNumber": 0.98
            },
            "MatchType": "interpolated",
            "Location": {
              "LocationId": "NT_.4F.1wbQ1kZP.RMjIh-x1A_xETO4A",
              "LocationType": "point",
              "DisplayPosition": {
                "Latitude": 41.7332549,
                "Longitude": -87.5953225
              },
              "NavigationPosition": [
                {
                  "Latitude": 41.73312,
                  "Longitude": -87.5953225
                }
              ],
              "MapView": {
                "TopLeft": {
                  "Latitude": 41.734379,
                  "Longitude": -87.5968289
                },
                "BottomRight": {
                  "Latitude": 41.7321307,
                  "Longitude": -87.5938161
                }
              },
              "Address": {
                "Label": "1198 E 89th St, Chicago, IL 60619, United States",
                "Country": "USA",
                "State": "IL",
                "County": "Cook",
                "City": "Chicago",
                "District": "Burnside",
                "Street": "E 89th St",
                "HouseNumber": "1198",
                "PostalCode": "60619",
                "AdditionalData": [
                  {
                    "value": "United States",
                    "key": "CountryName"
                  },
                  {
                    "value": "Illinois",
                    "key": "StateName"
                  },
                  {
                    "value": "Cook",
                    "key": "CountyName"
                  },
                  {
                    "value": "N",
                    "key": "PostalCodeType"
                  }
                ]
              }
            },
            "AdditionalData": [
              {
                "value": "true",
                "key": "houseNumberFallback"
              },
              {
                "value": "2",
                "key": "houseNumberFallbackDifference"
              }
            ]
          }
        ]
      }
    ]
  }
}

expected result:

[
  {
    "formattedAddress": "1198 E 89th St, Chicago, IL 60619, United States",
    "latitude": 41.7332549,
    "longitude": -87.5953225,
    "country": "United States",
    "countryCode": "US",
    "state": "Illinois",
    "stateCode": "IL", <--- new property
    "county": "Cook",
    "city": "Chicago",
    "zipcode": "60619",
    "district": "Burnside",
    "streetName": "E 89th St",
    "streetNumber": "1198",
    "building": null,
    "extra": {
      "herePlaceId": "NT_.4F.1wbQ1kZP.RMjIh-x1A_xETO4A",
      "confidence": 0.99
    },
    "administrativeLevels": {
      "level1long": "Illinois",
      "level2long": "Cook"
    },
    "provider": "here"
  }
]

actual result:

[
  {
    "formattedAddress": "1198 E 89th St, Chicago, IL 60619, United States",
    "latitude": 41.7332549,
    "longitude": -87.5953225,
    "country": "United States",
    "countryCode": "US",
    "state": "Illinois",
    // "stateCode": "IL", <------- undefined 
    "county": "Cook",
    "city": "Chicago",
    "zipcode": "60619",
    "district": "Burnside",
    "streetName": "E 89th St",
    "streetNumber": "1198",
    "building": null,
    "extra": {
      "herePlaceId": "NT_.4F.1wbQ1kZP.RMjIh-x1A_xETO4A",
      "confidence": 0.99
    },
    "administrativeLevels": {
      "level1long": "Illinois",
      "level2long": "Cook"
    },
    "provider": "here"
  }
]

@ruscon ruscon force-pushed the feature/here-add-state-code branch from 0972067 to 68dfd7e Compare February 20, 2019 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant