ReverseGeocodeUSLocation

ReverseGeocodeUSLocation takes a latitude and longitude point as input and returns the address that is the best match for that point. For example, you could enter the following information:

Longitude: -105239771 Latitude: 40018912 Search Distance: 150 feet

This input would result in the following output:


          4750 WALNUT ST BOULDER, CO 80301-2538
          MatchCode = NS0
          LocCode = AS0
          Lon = -105239773
          Lat = 40018911
          Distances:
          Search = 150
          Offset = 50
          Squeeze = 50
          Nearest = 50.0
          Pct Geocode = 94.0
          SegID = 472881795
          PtID = GDT
          Block = 080130122032066
          County Name = BOULDER COUNTY
          DPBC = 50
        

Note: The address returned is an approximate address based on the latitude and longitude provided. This approximate address may not exist or may not accept mail delivery.

ReverseGeocodeUSLocation processes geocodes in the following order:

  1. ReverseGeocodeUSLocation defines a small rectangle based on your input geocode and search distance.
  2. ReverseGeocodeUSLocation computes the distance between each street segment and the input location.
  3. If one segment is closest, ReverseGeocodeUSLocation finds the offset and interpolated percentage (using the squeeze factor) and the street side. It then computes an approximate house number based on this information.

    If there is more than one segment that is equally close to the input location, a multi-match occurs. ReverseGeocodeUSLocation returns the information for all of the equally close segments so that you can determine which segment is applicable.

  4. ReverseGeocodeUSLocation returns the address information, including the segment range, the approximate house number, and the parity of the range along with other standard address information.
Note: Although many of the standard address matching outputs apply to the reverse geocoding option, several outputs are unavailable (such as LACSLink information and unit numbers). ReverseGeocodeUSLocation returns these outputs as blank. ReverseGeocodeUSLocation also has outputs specific to reverse geocode processing, such as specific match codes and the distance from the input location to the matched segment.

To use ReverseGeocodeUSLocation, you need additional data files, called GSX files. There is an option to install these files when you install the geocoding database. The GSX files must be installed the GSX subdirectory of the geocoding database. If you install the TomTom Points database, you must recreate the GSX files. Consult with Precisely Technical Support if you need more information about GSX files.

Resource URL

JSON endpoint:

http://server:port/rest/ReverseGeocodeUSLocation/results.json
https://OnDemandServer/rest/ReverseGeocodeUSLocation/results.json 

XML endpoint:

http://server:port/rest/ReverseGeocodeUSLocation/results.xml
https://OnDemandServer/rest/ReverseGeocodeUSLocation/results.xml

For a list of Spectrum OnDemand servers, see Connecting to Spectrum OnDemand Servers.

Example with JSON Response

The following example requests a JSON response:

http://myserver:8080/rest/ReverseGeocodeUSLocation/results.json?​Data.Longitude=-73549161&Data.Latitude=41071067
https://spectrum.precisely.com/rest/ReverseGeocodeUSLocation/results.json?​Data.Longitude=-73549161&Data.Latitude=41071067

The JSON returned by this request would be:

{"output_port": [{
   "Latitude": "41.071067",
   "Longitude": "-73.549161",
   "StreetSide": "R",
   "Distance": "50.4",
   "PercentGeocode": "50.0",
   "FirmName": "",
   "AddressLine1": "2995 Summer St",
   "AddressLine2": "",
   "LastLine": "Stamford, CT  06905",
   "AdditionalInputData": "",
   "City": "Stamford",
   "StateProvince": "CT",
   "PostalCode.Base": "06905",
   "PostalCode.AddOn": "",
   "PostalCode": "06905",
   "USUrbanName": "",
   "Country": "United States of America",
   "LocationCode": "AS0",
   "MatchCode": "NS1",
   "StreetDataType": "TOMTOM",
   "Confidence": "100.0",
   "ProcessedBy": "KGL",
   "PBKey": "",
   "Status": "",
   "Status.Code": "",
   "Status.Description": "",
   "user_fields": []
}]}

Example with XML Response

The following example requests an XML response:

http://myserver:8080/rest/ReverseGeocodeUSLocation/results.xml?​Data.Latitude=41071067&Data.Longitude=-73549161
https://spectrum.precisely.com/rest/ReverseGeocodeUSLocation/results.xml?​Data.Latitude=41071067&Data.Longitude=-73549161

The XML returned by this request would be:

<xml.ReverseGeocodeUSLocationResponse xmlns="http://www.pb.com/spectrum/services/ReverseGeocodeUSLocation">
   <output_port>
      <Address>
         <Latitude>41.071067</Latitude>
         <Longitude>-73.549161</Longitude>
         <StreetSide>R</StreetSide>
         <Distance>50.4</Distance>
         <PercentGeocode>50.0</PercentGeocode>
         <FirmName/>
         <AddressLine1>2995 Summer St</AddressLine1>
         <AddressLine2/>
         <LastLine>Stamford, CT  06905</LastLine>
         <AdditionalInputData/>
         <City>Stamford</City>
         <StateProvince>CT</StateProvince>
         <PostalCode.Base>06905</PostalCode.Base>
         <PostalCode.AddOn/>
         <PostalCode>06905</PostalCode>
         <USUrbanName/>
         <Country>United States of America</Country>
         <LocationCode>AS0</LocationCode>
         <MatchCode>NS1</MatchCode>
         <StreetDataType>TOMTOM</StreetDataType>
         <Confidence>100.0</Confidence>
         <ProcessedBy>KGL</ProcessedBy>
         <PBKey/>
         <Status/>
         <Status.Code/>
         <Status.Description/>
         <user_fields/>
      </Address>
   </output_port>
</xml.ReverseGeocodeUSLocationResponse>