none
Problem geocoding addresses in Puerto Rico RRS feed

  • Question

  • We're using the Location REST API to geocode addresses and have run into some problems with addresses in Puerto Rico.

    https://dev.virtualearth.net/REST/v1/Locations/US/PR/00765-9236/Vieques/HC%201%20Box%209368?includeNeighborhood=1&key=....

    This gives us

    "geocodePoints":[
      {
        "type":"Point",
        "coordinates":[
            39.450000762939453,
            -98.907997131347656
        ],
        "calculationMethod":"Rooftop",
        "usageTypes":[
            "Display"
        ]
      }
    ]

    A rooftop level lat/long in Kansas!

    I've tried a suggestion to replace US with PR and not include the adminDistrict (state) field by both omitting it completely from the URL and by using the "-" placeholder. Those attempts return zero results.

    How do we geocode Puerto Rican addresses?

    Thursday, January 24, 2013 10:49 PM

Answers

  • Actually that request returns a match for the US, not Kansas. It just happens that the location happens to be in Kansas. Personally I hate the structured address format as it is a bit too restrictive. I recommend instead turning your address into a single string query. This will make the geocoder parse your address for you and returns much better results. For instance, changing your request to this:

    http://dev.virtualearth.net/REST/v1/Locations?query=Vieques 000765-9236, Puerto Rico&incl=queryParse&key=...

    This request returns two results in Puerto Rico.


    http://rbrundritt.wordpress.com

    Friday, January 25, 2013 1:41 PM
  • In generally I find this method of passing data for geocoding returns more accurate results much more often than the other method. I'm based in UK and find that this method works significantly better in Europe than the other method.

    http://rbrundritt.wordpress.com

    Saturday, January 26, 2013 12:14 PM

All replies

  • Actually that request returns a match for the US, not Kansas. It just happens that the location happens to be in Kansas. Personally I hate the structured address format as it is a bit too restrictive. I recommend instead turning your address into a single string query. This will make the geocoder parse your address for you and returns much better results. For instance, changing your request to this:

    http://dev.virtualearth.net/REST/v1/Locations?query=Vieques 000765-9236, Puerto Rico&incl=queryParse&key=...

    This request returns two results in Puerto Rico.


    http://rbrundritt.wordpress.com

    Friday, January 25, 2013 1:41 PM
  • Interesting tidbit. Thanks for your reply!

    Would you say that you get "much better results" for standard US addresses this way too or just for the states that are really territories like Puerto Rico and the US Virgin Islands, etc...? Should we only switch to the single string query version for the outlying territories and leave the normal 50 state's addresses in the structured version?

    I also notice that it doesn't like the highway contract, but if I remove that too then I get a reasonable lat/long in Vieques.

    Saturday, January 26, 2013 3:47 AM
  • In generally I find this method of passing data for geocoding returns more accurate results much more often than the other method. I'm based in UK and find that this method works significantly better in Europe than the other method.

    http://rbrundritt.wordpress.com

    Saturday, January 26, 2013 12:14 PM
  • How many PR addresses do you have?  Did you get them to geocode successfully?
    Thursday, April 23, 2015 7:41 PM