none
How to get correct address by coordinate RRS feed

  • Question

  • Hi, I try to get address by longitude and latitude. 
    When I send ajax.

    /Locations/59.89497181625588,30.30111940862026?key=key

    I receive 5 address (with different value)

    How should I choose the correct address? 
    Maybe I should add some parameters to the request?
    Thursday, May 28, 2020 2:04 PM

Answers

  • Hi Zeland,

    You can notice in the Argentina list, the first is closest.  

    Sincerely,

    IoTGirl

    • Marked as answer by Zeland Thursday, June 4, 2020 12:44 PM
    Tuesday, June 2, 2020 8:03 PM
    Owner

All replies

  • Hi Zealand,

    Have you taken a look at https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-point?

    A very basic call would be 

    http://dev.virtualearth.net/REST/v1/Locations/59.89497181625588,30.30111940862026?o=xml&key={BingMapsAPIKey}

    But you can add other parameters to tune the response as noted at the doc link.

    For example, the values: 

    <Confidence>Medium</Confidence> <MatchCode>Good</MatchCode>

    Should help you choose the most appropriate address from those given.

    Sincerely,

    IoTGirl



    Thursday, May 28, 2020 5:07 PM
    Owner
  • Hi Zealand,

    Are you familiar with this location? We show a road at https://www.bing.com/maps?osid=ed19d3b4-a634-4329-b23d-3d87da7c470b&cp=59.895008~30.301094&lvl=18&v=2&sV=2&form=S00027 but no name.  Does it have a documented name or is it a driveway?

    PS: OSM also shows no name https://www.openstreetmap.org/search?query=59.89497181625588%2C30.30111940862026#map=19/59.89497/30.30112

    Sincerely,

    IoTGirl


    Thursday, May 28, 2020 6:23 PM
    Owner
  • Hi IoTGirl,

    Api return me next collection:

    <?xml version="1.0" encoding="utf-8"?>
    <Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">
        <Copyright>Copyright © 2020 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.</Copyright>
        <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>
        <StatusCode>200</StatusCode>
        <StatusDescription>OK</StatusDescription>
        <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
        <TraceId>187861dy1f11d4a5u28bc55f652f176032|DU00000D70|0.0.0.1|DU01EAP000003E5, i-0da5e5ae1c5a8c22d.eu-west-1b</TraceId>
        <ResourceSets>
            <ResourceSet>
                <EstimatedTotal>5</EstimatedTotal>
                <Resources>
                    <Location>
                        <Name>Saint Petersburg, Russia, 198095</Name>
                        <Point>
                            <Latitude>59.89504</Latitude>
                            <Longitude>30.30099</Longitude>
                        </Point>
                        <BoundingBox>
                            <SouthLatitude>59.89504</SouthLatitude>
                            <WestLongitude>30.30065</WestLongitude>
                            <NorthLatitude>59.89504</NorthLatitude>
                            <EastLongitude>30.30099</EastLongitude>
                        </BoundingBox>
                        <EntityType>Address</EntityType>
                        <Address>
                            <AddressLine>Saint Petersburg</AddressLine>
                            <AdminDistrict>Northwestern Federal District</AdminDistrict>
                            <AdminDistrict2>Saint Petersburg</AdminDistrict2>
                            <CountryRegion>Russia</CountryRegion>
                            <FormattedAddress>Saint Petersburg, Russia, 198095</FormattedAddress>
                            <Locality>Saint Petersburg</Locality>
                            <PostalCode>198095</PostalCode>
                            <Intersection />
                        </Address>
                        <Confidence>Medium</Confidence>
                        <MatchCode>Good</MatchCode>
                        <GeocodePoint>
                            <Latitude>59.89504</Latitude>
                            <Longitude>30.30099</Longitude>
                            <CalculationMethod>Interpolation</CalculationMethod>
                            <UsageType>Display</UsageType>
                            <UsageType>Route</UsageType>
                        </GeocodePoint>
                    </Location>
                    <Location>
                        <Name>Mitrofan'evskoe shosse 18, Saint Petersburg, Russia, 198095</Name>
                        <Point>
                            <Latitude>59.89505</Latitude>
                            <Longitude>30.30147</Longitude>
                        </Point>
                        <BoundingBox>
                            <SouthLatitude>59.8939258</SouthLatitude>
                            <WestLongitude>30.2992288</WestLongitude>
                            <NorthLatitude>59.8961742</NorthLatitude>
                            <EastLongitude>30.3037112</EastLongitude>
                        </BoundingBox>
                        <EntityType>Address</EntityType>
                        <Address>
                            <AddressLine>Mitrofan'evskoe shosse 18</AddressLine>
                            <AdminDistrict>Northwestern Federal District</AdminDistrict>
                            <AdminDistrict2>Saint Petersburg</AdminDistrict2>
                            <CountryRegion>Russia</CountryRegion>
                            <FormattedAddress>Mitrofan'evskoe shosse 18, Saint Petersburg, Russia, 198095</FormattedAddress>
                            <Locality>Saint Petersburg</Locality>
                            <PostalCode>198095</PostalCode>
                            <Intersection />
                        </Address>
                        <Confidence>Medium</Confidence>
                        <MatchCode>Good</MatchCode>
                        <GeocodePoint>
                            <Latitude>59.89505</Latitude>
                            <Longitude>30.30147</Longitude>
                            <CalculationMethod>Interpolation</CalculationMethod>
                            <UsageType>Display</UsageType>
                            <UsageType>Route</UsageType>
                        </GeocodePoint>
                    </Location>
                    <Location>
                        <Name>Mitrofan'evskoe shosse 18, Saint Petersburg, Russia, 198095</Name>
                        <Point>
                            <Latitude>59.8948108</Latitude>
                            <Longitude>30.3007135</Longitude>
                        </Point>
                        <BoundingBox>
                            <SouthLatitude>59.8936867</SouthLatitude>
                            <WestLongitude>30.2984723</WestLongitude>
                            <NorthLatitude>59.895935</NorthLatitude>
                            <EastLongitude>30.3029546</EastLongitude>
                        </BoundingBox>
                        <EntityType>Address</EntityType>
                        <Address>
                            <AddressLine>Mitrofan'evskoe shosse 18</AddressLine>
                            <AdminDistrict>Northwestern Federal District</AdminDistrict>
                            <AdminDistrict2>Saint Petersburg</AdminDistrict2>
                            <CountryRegion>Russia</CountryRegion>
                            <FormattedAddress>Mitrofan'evskoe shosse 18, Saint Petersburg, Russia, 198095</FormattedAddress>
                            <Locality>Saint Petersburg</Locality>
                            <PostalCode>198095</PostalCode>
                            <Intersection />
                        </Address>
                        <Confidence>Medium</Confidence>
                        <MatchCode>Good</MatchCode>
                        <GeocodePoint>
                            <Latitude>59.8948108</Latitude>
                            <Longitude>30.3007135</Longitude>
                            <CalculationMethod>Interpolation</CalculationMethod>
                            <UsageType>Display</UsageType>
                            <UsageType>Route</UsageType>
                        </GeocodePoint>
                    </Location>
                    <Location>
                        <Name>Mitrofan'evskoe shosse 15, Saint Petersburg, Russia, 198095</Name>
                        <Point>
                            <Latitude>59.89516</Latitude>
                            <Longitude>30.30062</Longitude>
                        </Point>
                        <BoundingBox>
                            <SouthLatitude>59.8940358</SouthLatitude>
                            <WestLongitude>30.2983788</WestLongitude>
                            <NorthLatitude>59.8962842</NorthLatitude>
                            <EastLongitude>30.3028612</EastLongitude>
                        </BoundingBox>
                        <EntityType>Address</EntityType>
                        <Address>
                            <AddressLine>Mitrofan'evskoe shosse 15</AddressLine>
                            <AdminDistrict>Northwestern Federal District</AdminDistrict>
                            <AdminDistrict2>Saint Petersburg</AdminDistrict2>
                            <CountryRegion>Russia</CountryRegion>
                            <FormattedAddress>Mitrofan'evskoe shosse 15, Saint Petersburg, Russia, 198095</FormattedAddress>
                            <Locality>Saint Petersburg</Locality>
                            <PostalCode>198095</PostalCode>
                            <Intersection />
                        </Address>
                        <Confidence>Medium</Confidence>
                        <MatchCode>Good</MatchCode>
                        <GeocodePoint>
                            <Latitude>59.89516</Latitude>
                            <Longitude>30.30062</Longitude>
                            <CalculationMethod>Interpolation</CalculationMethod>
                            <UsageType>Display</UsageType>
                            <UsageType>Route</UsageType>
                        </GeocodePoint>
                    </Location>
                    <Location>
                        <Name>Saint Petersburg, Russia, 198095</Name>
                        <Point>
                            <Latitude>59.89535</Latitude>
                            <Longitude>30.30113</Longitude>
                        </Point>
                        <BoundingBox>
                            <SouthLatitude>59.89535</SouthLatitude>
                            <WestLongitude>30.30109</WestLongitude>
                            <NorthLatitude>59.89579</NorthLatitude>
                            <EastLongitude>30.30192</EastLongitude>
                        </BoundingBox>
                        <EntityType>Address</EntityType>
                        <Address>
                            <AddressLine>Saint Petersburg</AddressLine>
                            <AdminDistrict>Northwestern Federal District</AdminDistrict>
                            <AdminDistrict2>Saint Petersburg</AdminDistrict2>
                            <CountryRegion>Russia</CountryRegion>
                            <FormattedAddress>Saint Petersburg, Russia, 198095</FormattedAddress>
                            <Locality>Saint Petersburg</Locality>
                            <PostalCode>198095</PostalCode>
                            <Intersection />
                        </Address>
                        <Confidence>Medium</Confidence>
                        <MatchCode>Good</MatchCode>
                        <GeocodePoint>
                            <Latitude>59.89535</Latitude>
                            <Longitude>30.30113</Longitude>
                            <CalculationMethod>Interpolation</CalculationMethod>
                            <UsageType>Display</UsageType>
                            <UsageType>Route</UsageType>
                        </GeocodePoint>
                    </Location>
                </Resources>
            </ResourceSet>
        </ResourceSets>
    </Response>

    As you can see all of them has confidence (medium) and matchcode(good), but right only with 'Mitrofan'evskoe shosse 18, Saint Petersburg, Russia, 198095' name.

    Another place:
    Locations/-34.53937925354808,-58.555061340332024

    API return absolutely different locations.

    Thanks, Zeland

    Friday, May 29, 2020 6:56 AM
  • Hi Zeland,

    Thank you for the extra details. Are the other addresses actually invalid? That is, they do not exist?  Specifically you say "Mitrofan'evskoe shosse 18, Saint Petersburg, Russia, 198095" is correct but are the others incorrect?

    Sincerely,

    IoTGirl


    Friday, May 29, 2020 8:28 PM
    Owner
  • Hi IoTGirl,
    It was just an example.

    How to determine correct address here?
    Locations/-34.53937925354808,-58.555061340332024?o=json

    Sarmiento 5626, 1653 Villa Ballester, Argentina
    Los Pinos 2020, 1653 Villa Ballester, Argentina
    Sarmiento 5600, 1653 Villa Ballester, Argentina
    San Vladimir 2027, 1653 Villa Ballester, Argentina
    Falucho 1999, 1653 Villa Ballester, Argentina


    Bing gives us very average values.
    Does it possible to reduce the circle of searching?
    Thanks, Zeland

    Tuesday, June 2, 2020 6:59 AM
  • Hi Zeland,

    You can notice in the Argentina list, the first is closest.  

    Sincerely,

    IoTGirl

    • Marked as answer by Zeland Thursday, June 4, 2020 12:44 PM
    Tuesday, June 2, 2020 8:03 PM
    Owner
  • Hi IoTGirl,
    Thank you for your help,
    Zeland
    Thursday, June 4, 2020 12:44 PM
  • You are very welcome!
    Thursday, June 4, 2020 7:10 PM
    Owner