none
Which address is closest to me? RRS feed

  • Question

  • Hi --

    My use case: Given multiple addresses, I'd like to know which one is closest to where I live.

    Background: I live in Japan and I'm going to be taking driving lessons in preparation for the road test in order to swap out my NYC driver's license for a local driver's license.  47 schools are prefectural police designated learning centers for driving instruction.  None of them are in my town, and I want to know which is the easiest to get to given my location.

    My solution: Unless I'm missing something, this doesn't seem to be a civilian-facing use case that's been implemented yet.  For fun, I tried using the REST-based location query API to build a programmatic solution.  My first pass was simply an attempt to geolocate each address and calculate relative distances.  Unfortunately, returned latitude and longitude points are unusable.  In a nutshell, when I do a manual search on Bing Maps and supply the name of a given driving school, I receive 'precise' geospatial coordinates; however, these coordinate do not match the coordinates returned by the location query API.

    An example:

    URI -
    http://dev.virtualearth.net/REST/v1/Locations/JP/埼玉/350-1151/川越/中台2-1-2?o=xml&key={BingMapsKey}

    The address embedded in the URI is of the following driving school: 三共自動車教習所 (located at 35.891399, 139.475754)

    The location query, by contrast, returns 4 locations in descending order of confidence; and, as you can see, they all miss the mark:

    ...
    <Confidence>Medium</Confidence>
    <MatchCode>UpHierarchy</MatchCode>
    <GeocodePoint>
    <Latitude>35.884178161621094</Latitude>
    <Longitude>139.62887573242187</Longitude>
    <CalculationMethod>Rooftop</CalculationMethod>
    <UsageType>Display</UsageType>
    </GeocodePoint>
    ...
    <Confidence>Medium</Confidence>
    <MatchCode>Ambiguous</MatchCode>
    <MatchCode>UpHierarchy</MatchCode>
    <GeocodePoint>
    <Latitude>35.917999267578125</Latitude>
    <Longitude>139.48822021484375</Longitude>
    <CalculationMethod>Rooftop</CalculationMethod>
    <UsageType>Display</UsageType>
    </GeocodePoint>
    ...
    <Confidence>Low</Confidence>
    <MatchCode>Ambiguous</MatchCode>
    <MatchCode>UpHierarchy</MatchCode>
    <GeocodePoint>
    <Latitude>34.950000762939453</Latitude>
    <Longitude>132.41999816894531</Longitude>
    <CalculationMethod>Rooftop</CalculationMethod>
    <UsageType>Display</UsageType>
    </GeocodePoint>
    ...
    <Confidence>Low</Confidence>
    <MatchCode>Ambiguous</MatchCode>
    <MatchCode>UpHierarchy</MatchCode>
    <GeocodePoint>
    <Latitude>35.020000457763672</Latitude>
    <Longitude>136.66999816894531</Longitude>
    <CalculationMethod>Rooftop</CalculationMethod>
    <UsageType>Display</UsageType>
    </GeocodePoint>
    ...

    If this is a use case that warrants further attention (on my part), then please steer me in the right direction.  In either case, I would like to know your opinion.

    Regards,
    Paul B
    Hasuda City, Saitama Prefecture
    Friday, January 31, 2020 4:24 AM

All replies

  • Hi Pablo,

    I believe the scenario you are talking about is what we would call a "Store Locator".  Essentially your driving school would publish a site like our sample https://bingmapsv8samples.azurewebsites.net/#Simple%20Store%20Locator with the addresses of their locations preloaded and those that are nearest would appear first in the list.  A real world example is the Amazon Locker locator which tells you the closest pick up of drop off locker for Amazon delivery.

    Please take a look at the sample link above and follow up with any further details if this is not your scenario.

    Sincerely,

    IoTGirl 

    Friday, January 31, 2020 4:53 PM
    Owner