none
Geocode for address with apartment number(unit number) RRS feed

  • Question

  • Is BingRest supported to GeoCode addresses with unit numbers like Apt#, suite # etc. If supported how do we include apartment/unit number information in the request.

    Also if we add unit number in address line for geocode, the resulting lat/lang going to be same or it will be different.?

    Any information on this topic would help. Thanks

    Monday, June 17, 2019 9:56 PM

All replies

  • Hi Robert,

    Firstly, our GeoCode by Address documentation is available here https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-address.  

    Secondly, I must ask what difference you expect an apartment number to make on a geocode call?  Typically apartment buildings have one address and one main entry.  With this in mind I would likely leave the apartment number off if I were geocoding for building location or access point.

    In that case where you have a fully structured address you can increase the accuracy of the resulting Lat,lon geocode by calling the query with the specific areas called out... from the documentation link above:

    For example, if you want to get latitude and longitude values for the address "100 Main St. Somewhere, WA 98001" you could call http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=US&adminDistrict=WA&locality=Somewhere&postalCode=98001&addressLine=100%20Main%20St.&key={BingMapsApIKey}

    By calling out the bolded items you help disambiguate the call, in this case you are telling the API the address is in the US, State of WA, City of Somewhere, postal code 98001 and then the address line, which could contain an apartment number but is probably not required.

    I hope that clarifies but please follow up with any further details if that doesn't answer your question.

    Sincerely,

    IoTGirl


    Wednesday, June 19, 2019 5:08 AM
    Owner
  • Hi,

      Thanks for the detailed explanation.  As per the USPS standard our system captures the unit data in the address line and then same will be passed to BING to geocode. My major concern is that when it's get geocoded do I loose the accuracy of the lat/lang or will i get any error. 

    Also when user include unit info. they can enter anything like apt#, suite# bldg # etc.. when this happens how geocode service react for it..  if you think it creates major issue i may need to parse the address to strip off unit part info. from the address line.

    Please advice.

    Friday, June 21, 2019 1:58 AM
  • Hi Robert,

    My previous answer still stands with respect to the geocoder location API. If you make the structured call, you can use the address line as I recommend, with or without the apt number.

    You are now adding a form filling component and for that I recommend AutoSuggest API, https://docs.microsoft.com/en-us/bingmaps/v8-web-control/modules/autosuggest-module/.  Try the sample at https://bingmapsv8samples.azurewebsites.net/#Fill%20Address%20Form%20with%20Autosuggest Note that this solves the problem of incorrectly entered addresses.

    I tried something simple like #1 First Street to see what addresses were recommended.  When you select the correct address, it is separated ready to be stored and passed to the geocoder API in the format above.

    Sincerely,

    IoTGirl


    Friday, June 21, 2019 4:32 AM
    Owner
  • So it means no impact in sending unit info. in the address line in for geocode call. Recently we reached tech. support they referred this post https://social.msdn.microsoft.com/Forums/en-US/09bb943c-f5b6-4881-9369-fd8ecf2b2c81/geocode-for-address-with-apartment-numberunit-number-is-not-correct?forum=bingmapsservices

    and told us using unit data for geocode is not supported. Please advice.

     
    Friday, June 21, 2019 6:00 PM
  • Hi Robert,

    I refer you to my previous answer that leaving the apartment number off will give you the building that the unit is in.  What are you expecting to gain by forcing the apartment number into the address line?  As noted in the answer the Support team pointed you to, the geocoder does it's best effort.

    Apartment identification is traditionally like this:

    Address1: "123 Main Street"

    Address2: "Suite 100"

    City: "MyTown"

    State: "MyState"

    Country: "MyCountry"

    The vagaries around apartment/suite number make it a wild card in geocoding that only really serves a use once you have already gotten to the location (Post Geocode).  This is why it does not seem to be a value that makes sense to be used with the geocoder.

    Sincerely,

    IoTGirl



    Sunday, June 23, 2019 4:22 AM
    Owner