In February 2019, PC*MILER Web Services enhanced its geocoding logic to help provide the most accurate results possible for our users. As a result of this performance improvement, requests sent to the locations resource that contain cities, states, countries, regions and ZIP/Postal codes that do not match one another will fail with a geocoding error. (Please see examples below.)


Previously, mismatches when geocoding would trigger a warning but still return a result. If you find you are suddenly receiving errors for web service requests that worked in the past, please double-check that you are providing matching location parameters. 


If you continue to receive geocoding errors even after providing matching location parameters, please contact our Technical Support team by clicking the Submit Ticket button at the top of your screen. 


We apologize for any inconvenience as we continue to enhance PC*MILER Web Services.


Examples

REST Request

The following are examples of requests to our location service that would fail due to mismatches:


1. State is set to NJ (New Jersey) and EU (Europe) is set as the region, as NJ is not a state in EU

/locations?city=princeton&state=nj&postcode=08534&region=EU


2. State is invalid

/locations?city=princeton&state=za&postcode=19341


3. City is valid, but all other fields are invalid

/locations?city=princeton&state=za&postcode=99999


4. Country is set to GB (Great Britain) and UK (United Kingdom) is set as the state, as UK is not a state in GB

/locations?country=GB&region=EU&state=UK


Response

Below is the error the service would return. The description can be slightly different depending on the mismatch in the request.


[
   {
       "Address": null,
       "Coords": null,
       "Region": 4,
       "Label": null,
       "PlaceName": null,
       "TimeZone": null,
       "Errors": [
           {
               "Type": 1,
               "Code": 88,
               "LegacyErrorCode": 400,
               "Description": "Invalid state/country abbreviation."
           }
       ],
       "SpeedLimitInfo": null,
       "ConfidenceLevel": null,
       "DistanceFromRoad": null,
       "CrossStreet": null
   }
]


SOAP Request

This request would fail, even though the address is correct, because the region is set to EU, and NJ is not a state in EU.


<StopLocation>                          
          <Address>
             <StreetAddress>1 Independence Way</StreetAddress>
              <City>Princeton</City>
              <State>NJ</State>
              <Zip>08540</Zip>
              <SPLC></SPLC>
           </Address>                      
           <Coords>
              <Lat></Lat>
              <Lon></Lon>
           </Coords>  
              <Region>EU</Region>
              <PlaceName></PlaceName>
</StopLocation>