Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Community Speaker page has data/location validation issues #508

Open
mrlacey opened this issue Oct 15, 2020 · 4 comments
Open

Community Speaker page has data/location validation issues #508

mrlacey opened this issue Oct 15, 2020 · 4 comments

Comments

@mrlacey
Copy link

mrlacey commented Oct 15, 2020

image

Either

  • The Netherlands has moved and no-one told me,
  • there's some faulty geo-data in the system, or
  • the location name resolution when adding a new speaker has a bug

I was wrong. It seems there's a street in a town outside London that is called "The Netherlands" and the Azure Maps API thinks this is a more likely result than the country.

Based on

HttpResponseMessage responseMessage = await client.SendWithRetryAsync($"https://atlas.microsoft.com/search/address/json?&subscription-key={subscriptionKey}&api-version=1.0&language=en-US&limit=1&query={HttpUtility.UrlEncode(location)}");

// 20201015135708
// https://atlas.microsoft.com/search/address/json?&subscription-key=XXXXXX-HIDING-MY-KEY-XXXXXX&api-version=1.0&language=en-US&limit=1&query=The+Netherlands

{
  "summary": {
    "query": "the netherlands",
    "queryType": "NON_NEAR",
    "queryTime": 54,
    "numResults": 1,
    "offset": 0,
    "totalResults": 51,
    "fuzzyLevel": 1
  },
  "results": [
    {
      "type": "Street",
      "id": "GB/STR/p0/177159",
      "score": 4.6116523743,
      "address": {
        "streetName": "The Netherlands",
        "municipalitySubdivision": "Croydon",
        "municipality": "Coulsdon",
        "countrySecondarySubdivision": "Surrey",
        "countrySubdivision": "ENG",
        "countrySubdivisionName": "England",
        "postalCode": "CR5",
        "extendedPostalCode": "CR5 1ND, CR5 1NG, CR5 1NJ",
        "countryCode": "GB",
        "country": "United Kingdom",
        "countryCodeISO3": "GBR",
        "freeformAddress": "The Netherlands, Coulsdon",
        "localName": "Coulsdon"
      },
      "position": {
        "lat": 51.30505,
        "lon": -0.14558
      },
      "viewport": {
        "topLeftPoint": {
          "lat": 51.30604,
          "lon": -0.14663
        },
        "btmRightPoint": {
          "lat": 51.30375,
          "lon": -0.14425
        }
      }
    }
  ]
}

It looks like there's a need to manually update or override the results from the call to the API.

@daveaglick
Copy link
Member

You got it - we use the Azure Maps API to do fuzzy place name matching. The lat/lon can be overridden in the profile though by using Lat and Lon values in the front matter (this just isn't well publicized yet, not sure how best to indicate that on the speaker add page). When those are both provided, we use the explicit values instead of calling Azure Maps to get them.

@augustoproiete
Copy link
Member

@mrlacey @daveaglick Leaving aside the odd Azure Maps API behavior, shouldn't we encourage speakers to add a more detailed location including their city and state (if applicable), in addition to their country?

For example, if I'm running a .NET user group in Amsterdam and I'm looking for speakers, it would be useful to know speakers that are local or closer vs. the ones that are far away.

@daveaglick
Copy link
Member

Totally agree a more detailed location should be encouraged. Any thoughts on how to suggest/enforce that? I could check for a comma and error out if there isn't one (under the assumption a comma indicates at least a "region, country" style designation.

@augustoproiete
Copy link
Member

Yes, enforcing at least one comma assuming a region, country style would definitely be a good improvement.

That should catch most issues, at least for speakers outside of the US.

US-based speakers tend to omit their country and write things like City, State e.g. Nashville, TN (though probably not an issue for the Azure Maps API as I'm sure they recognize that much better than locations outside the US).

Perhaps enforcing two commas would be better to send people in the right direction?

e.g.

Location Pass/Fail
The Netherlands
Amsterdam, The Netherlands
Nashville, TN
Nashville, TN, USA
Amsterdam,, The Netherlands
Sao Paulo, SP, Brazil
Sao Paulo,, Brazil

Of course, alternatively, we could have separate fields (city, region, country) in the YAML instead of location, and make city and country required...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants