IRestGeocodeService Interface Reference

Inherited by IRestService.

Public Member Functions

List< GeocodeOutputLocationLocations (string streetaddr, string city, string state, string zip, string country, PostCodeType? postcodeFilter, GeocodeCitySearchFilter citySearchFilter, string splc, int list, double[] lnglat, string searchString, bool? matchNamedRoadsOnly, double? maxCleanupMiles, CountryAbbreviationType? countryAbbrevType, DataRegion? region, ALK.PCM.Model.DataVersion? dataset, int timeOut, LanguageType? lang, bool? splitHouseNumber, bool? includeTrimblePlaceIDs)
 The /locations GET request performs a geocode or reverse geocode by searching for locations with the supplied parameters. If coords are supplied, then a reverse geocode is performed. More...
 
List< GeocodeOutputLocationGeoBatch (GeocodeRequestBody request, ALK.PCM.Model.DataVersion? dataset)
 The /locations/address/batch POST request performs geocoding search on a batch of addresses. More...
 
GeocodeOutputLocation ReverseGeo (double[] lnglat, bool? matchNamedRoadsOnly, double? maxCleanupMiles, bool includePostedSpeedLimit, SpeedLimitType? speedLimitPref, double? heading, int? currSpeed, Model.VehicleType vehicle, bool urban, bool includeLinkInfo, string timestamp, CountryAbbreviationType? countryAbbrevType, DataRegion? region, ALK.PCM.Model.DataVersion? dataset, int timeOut, LanguageType? lang, VehicleDimUnits? units, bool? splitHouseNumber, bool? includeTrimblePlaceIDs, string assetID)
 The /locations/reverse GET request performs a "reverse geocode" by searching for locations by a single coordinate pair. More...
 
List< GeocodeOutputLocationReverseGeoBatch (ReverseGeocodeRequestBody request, ALK.PCM.Model.DataVersion? dataset)
 The /locations/reverse/batch POST request performs a reverse geocoding search on a batch of coordinates. More...
 
List< StateCountryStates (DataRegion? region, CountryCodeFormat? abbrFormat, bool? countryOnly)
 The /states GET request retrieves the states or countries for a region. More...
 

Detailed Description

This interface contains the requests for geocoding both by address and coordinates (reverse).

Member Function Documentation

◆ Locations()

List<GeocodeOutputLocation> Locations(string streetaddr,
string city,
string state,
string zip,
string country,
PostCodeTypepostcodeFilter,
GeocodeCitySearchFilter citySearchFilter,
string splc,
int list,
double[] lnglat,
string searchString,
bool? matchNamedRoadsOnly,
double? maxCleanupMiles,
CountryAbbreviationTypecountryAbbrevType,
DataRegionregion,
ALK.PCM.Model.DataVersiondataset,
int timeOut,
LanguageTypelang,
bool? splitHouseNumber,
bool? includeTrimblePlaceIDs 
)

The /locations GET request performs a geocode or reverse geocode by searching for locations with the supplied parameters. If coords are supplied, then a reverse geocode is performed.

REST METHOD: GET
REST URI:

/locations?street={streetaddr}&city={city}&state={state}&postcode={zip}&country={country}
               &postcodeFilter={postcodeFilter}&citySearchFilter={citySearchFilter}
               &splc={splc}&list={list}&coords={lnglat}&searchString={searchString}
               &matchNamedRoadsOnly={matchNamedRoadsOnly}&maxCleanupMiles={maxCleanupMiles}
               &countryAbbrevType={countryAbbrevType}&region={region}&dataset={dataset}
               &splitHouseNumber={splitHouseNumber}&includeTrimblePlaceIDs={includeTrimblePlaceIDs}
Parameters
streetaddrThis parameter contains the house number and street name in a single string.

Examples:

&street=1%20Independence%20Way
cityThis parameter contains the city name.

Examples:

&city=New%20York
&city=Princeton
stateThis parameter contains the state (or country) abbreviation according to defacto standards. Such as AZ for Arizona, NY for New York, NSW for New South Whales, etc.

Examples:

&state=NY
&state=NSW
zipThis parameter contains the ZIP or Postal Code.

Examples:

&city=08823
&city=3CV%206L4
countryThis parameter contains the country abbreviation. The abbreviation format standard is dictated by the countryAbbrevType param (FIPS [default], ISO2, ISO3, GENC2, GENC3). Note that this parameter is only supported in version 32 and later.

Examples:

&country=UK
&country=FR
postcodeFilterThis parameter contains the post code filter name. It is used to filter ZIP codes by country. Possible values are:

  1. us
    US ZIP codes
  2. em
    Mexico ZIP codes
  3. both
    Indicates both US and Mexico.

Default is us.

Examples:

&postcodeFilter=us
&postcodeFilter=both

See also
    ALK.Common.Model.PostCodeType

citySearchFilterThis parameter pertains to doing pure city searches. Possible values are:

  1. CitiesWithZips
    Return cities and corresponding ZIP codes.
  2. CityCentersOnly
    Return city centers only, no ZIP codes.

Default is 0

Examples:

&citySearchFilter=0
&citySearchFilter=CityCentersOnly
splcThis parameter contains the Standard Point Location code to use in place of street/city/state/zip.

Examples:

&splc=392832000        // IL,Montgomery,Ohlman,62076
&splc=188142000        // NY,Steuben,Bradford,14815
listIndicates the number of results to return if geocoding results in a less than perfect match.

Example:

&list=4
lnglatThis parameter contains geographic coordinates used in reverse geocoding. The coordinates are represented by a comma separated pair of floating point numbers representing longitude and latitude respectively in the Web Mercator ESPG:3857 projection.
There must be at least two numbers.

Example:

&coords=-76.12345,42.12345
searchStringThis parameter contains single string containing a full address to search. Supplying this parameter will render all other search relevant query parameters ineffective, e.g. city, state, streetAddress, etc. Example:

&searchString=1%20Independence%20Way,%20Princeton,%20NJ
matchNamedRoadsOnlyIndicates that when reverse geocoding, i.e. searching from coordinates, force to only match on named roads. Possible values are boolean:

  • true
  • false

Default is false.

Example:

&hosEnabled=true
maxCleanupMilesIndicates the maximum radius, in miles, in which to find the closest matching road. The format of this value is a floating point number.

Example:

&maxCleanupMiles=10.5
countryAbbrevTypeIndicates the abbreviation format for countries. Possible values are:

  1. FIPS
  2. ISO2
  3. ISO3
  4. GENC2
  5. GENC3

Default is FIPS.

Example:

&countryAbbrevType=ISO2
regionThe data region in which the route is located. Possible values are:

  1. Unknown - Africa
  2. AF - Africa
  3. AS - Asia
  4. EU - Europe
  5. NA - North America
  6. OC - Oceania; Australia
  7. SA - South America
  8. ME - Middle East

Default is NA (North America).

Example:

&region=EU

See also
    ALK.Common.Model.DataRegion

datasetThe data region in which the route is located. Possible values for the routePath request are:

  1. Current
  2. PCM_EU
  3. PCM_OC
  4. PCM_SA
  5. PCM_GT (GeoTrac)
  6. PCM_AF
  7. PCM_AS
  8. PCM_ME
  9. PCM_NA
  10. PCM_WW
  11. PCM_JP
  12. PCM_NASL
  13. PCM_MX

Default is Current. If an unlicensed dataset is specified, the request will result in a forbidden request, i.e. a 403 HTTP Response.

Example:

&dataset=PCM_ME

See also
    ALK.PCM.Model.RegionalDataSet

timeOut
lang
splitHouseNumber
includeTrimblePlaceIDs
Returns
A JSON formatted response.

Example of a result returned from ALK.PCM.IRestGeocodeService.Locations.

This result is an array of ALK.PCM.Model.BusinessModels.GeocodeOutputLocation.

[
    {
        "Address": {
            "StreetAddress": "",
            "City": "Princeton",
            "State": "NJ",
            "Zip": "08540",
            "County": "Mercer",
            "Country": "United States",
            "SPLC": null,
            "CountryPostalFilter": 0,
            "AbbreviationFormat": 0,
            "StateName": "New Jersey",
            "StateAbbreviation": "NJ",
            "CountryAbbreviation": "US"
        },
        "Coords": {
            "Lat": "40.354907",
            "Lon": "-74.645014"
        },
        "Region": 4,
        "Label": "",
        "PlaceName": "",
        "TimeZone": "EDT",
        "Errors": [],
        "SpeedLimitInfo": null,
        "ConfidenceLevel": "Exact",
        "DistanceFromRoad": null,
        "CrossStreet": null
    }
]

◆ GeoBatch()

The /locations/address/batch POST request performs geocoding search on a batch of addresses.

REST METHOD: POST
REST URI:

/locations/address/batch?dataset={dataset}
Parameters
requestContains a structure to batch Geocode search. This structure is contained in the body of the batch geocode request.
See ALK.PCM.Model.ServiceModels.GeocodeRequestBody.

Example:

{
	"Locations":[{
		"Address":{
			"StreetAddress":"1000 Herrontown Rd",
			"City":"Princeton",
			"State":"NJ",
			"Zip":"",
			"County":"",
			"Country":null,
			"SPLC":"",
			"CountryPostalFilter":0,
			"AbbreviationFormat":0
		},
		"Region":4,
		"GeoList":false,
		"MaxResults":null,
		"CitySearchFilter":0
	},
	{
		"Address":{
			"StreetAddress":"457 N Harrison St",
			"City":"",
			"State":"",
			"Zip":"08540",
			"County":"",
			"Country":null,
			"SPLC":"",
			"CountryPostalFilter":0,
			"AbbreviationFormat":0
		},
		"Region":4,
		"GeoList":false,
		"MaxResults":null,
		"CitySearchFilter":0
	},
	{
		"Address":{
			"StreetAddress":"1 Independence Way",
			"City":"Princeton",
			"State":"",
			"Zip":"08540",
			"County":"",
			"Country":null,
			"SPLC":"",
			"CountryPostalFilter":0,
			"AbbreviationFormat":0
		},
		"Region":4,
		"GeoList":false,
		"MaxResults":null,
		"CitySearchFilter":0
	}]
}
datasetThe data region in which the route is located. Possible values for the routePath request are:

  1. Current
  2. PCM_EU
  3. PCM_OC
  4. PCM_SA
  5. PCM_GT (GeoTrac)
  6. PCM_AF
  7. PCM_AS
  8. PCM_ME
  9. PCM_NA
  10. PCM_WW
  11. PCM_JP
  12. PCM_NASL
  13. PCM_MX

Default is Current. If an unlicensed dataset is specified, the request will result in a forbidden request, i.e. a 403 HTTP Response.

Example:

&dataset=PCM_ME

See also
    ALK.PCM.Model.RegionalDataSet

Returns
A JSON formatted response.

Example of a result returned from ALK.PCM.IRestGeocodeService.GeoBatch.

This result is an array of ALK.PCM.Model.BusinessModels.GeocodeOutputLocation.

[
    {
        "Address": {
            "StreetAddress": "",
            "City": "Princeton",
            "State": "NJ",
            "Zip": "08540",
            "County": "Mercer",
            "Country": "United States",
            "SPLC": null,
            "CountryPostalFilter": 0,
            "AbbreviationFormat": 0,
            "StateName": "New Jersey",
            "StateAbbreviation": "NJ",
            "CountryAbbreviation": "US"
        },
        "Coords": {
            "Lat": "40.354907",
            "Lon": "-74.645014"
        },
        "Region": 4,
        "Label": "",
        "PlaceName": "",
        "TimeZone": "EDT",
        "Errors": [],
        "SpeedLimitInfo": null,
        "ConfidenceLevel": "Exact",
        "DistanceFromRoad": null,
        "CrossStreet": null
    }
]

◆ ReverseGeo()

GeocodeOutputLocation ReverseGeo(double[] lnglat,
bool? matchNamedRoadsOnly,
double? maxCleanupMiles,
bool includePostedSpeedLimit,
SpeedLimitTypespeedLimitPref,
double? heading,
int? currSpeed,
Model.VehicleType vehicle,
bool urban,
bool includeLinkInfo,
string timestamp,
CountryAbbreviationTypecountryAbbrevType,
DataRegionregion,
ALK.PCM.Model.DataVersiondataset,
int timeOut,
LanguageTypelang,
VehicleDimUnitsunits,
bool? splitHouseNumber,
bool? includeTrimblePlaceIDs,
string assetID 
)

The /locations/reverse GET request performs a "reverse geocode" by searching for locations by a single coordinate pair.

REST METHOD: GET
REST URI:

/locations/reverse?coords={lnglat}&matchNamedRoadsOnly={matchNamedRoadsOnly}
                        &maxCleanupMiles={maxCleanupMiles}&heading={heading}&currentSpeed={currSpeed}
                        &includePostedSpeedLimit={includePostedSpeedLimit}&vehicleType={vehicle}
                        &urban={urban}&includeLinkInfo={includeLinkInfo}&timestamp={timestamp}
                        &countryAbbrevType={countryAbbrevType}&region={region}&dataset={dataset}
                        &splitHouseNumber={splitHouseNumber}&includeTrimblePlaceIDs={includeTrimblePlaceIDs}
Parameters
lnglatThis parameter contains geographic coordinates used in reverse geocoding. The coordinates are represented by a comma separated pair of floating point numbers representing longitude and latitude respectively in the Web Mercator ESPG:3857 projection.
There must be at least two numbers.

Example:

&coords=-76.12345,42.12345
matchNamedRoadsOnlyIndicates that when reverse geocoding, i.e. searching from coordinates, force to only match on named roads. Possible values are boolean:

  • true
  • false

Default is false.

Example:

&hosEnabled=true
maxCleanupMilesIndicates the maximum radius, in miles, in which to find the closest matching road. The format of this value is a floating point number.

Example:

&maxCleanupMiles=10.5
includePostedSpeedLimitIndicates whether or not to include the posted speed limits. Possible values are boolean:

  • true
  • false

Default is false.

Example:

&includePostedSpeedLimit=true
speedLimitPrefPreferred speed limit source SpeedLimitType
headingIndicates the current heading of the vehicle. Speed limit may differ based on direction. This parameter is used with the includePostedSpeedLimit query parameter to increase accuracy of getting the correct speed limit. The format of this value is a floating point number.

Heading angle East:0 North:90 West:180 South:270

Example:

&heading=45.323
currSpeedIndicates the current speed, miles per hour, of the vehicle. This parameter is used with the includePostedSpeedLimit query parameter to increase accuracy of getting the correct speed limit. The format of this value is an integer.

Example:

&currentSpeed=55
vehicleThe vehicle type to be used in finding speed limits. Speed limit may vary based on vehicle. This parameter is used with the includePostedSpeedLimit query parameter to increase accuracy of getting the correct speed limit. Possible values are:

  1. Truck
  2. LightTruck
  3. Auto

Default is Truck.

Example:

&vehicleType=LightTruck

See also
    ALK.PCM.Model.VehicleType

urbanIndicates whether geocoding in an urban location or not. Speed limit may differ based on residential areas. This parameter is used with the includePostedSpeedLimit query parameter to increase accuracy of getting the correct speed limit. Possible values are boolean:

  • true
  • false

Default is false.

Example:

&urban=true
includeLinkInfoIndicates whether or not to include link info. Possible values are boolean:

  • true
  • false

Default is false.

Example:

&includeLinkInfo=true
timestampIndicates the Date/Time string to be applied for the request. This parameter is used to determine the use of Daylight Savings Time at the location in its Time Zone. The format is standard a format:

mm/dd/yyyy hh:m</em

Default is none, if so will use current time.

Example:

&timestamp=08/23/2017%2013:43

countryAbbrevTypeIndicates the abbreviation format for countries. Possible values are:

  1. FIPS
  2. ISO2
  3. ISO3
  4. GENC2
  5. GENC3

Default is FIPS.

Example:

&countryAbbrevType=ISO2
regionThe data region in which the route is located. Possible values for the routePath, routeReports, or locations/reverse/batch requests are:

  1. EU
  2. NA
  3. OC
  4. SA

Default is NA.

Example:

&region=EU

See also
    ALK.Common.Model.DataRegion

datasetThe data region in which the route is located. Possible values for the routePath request are:

  1. Current
  2. PCM_EU
  3. PCM_OC
  4. PCM_SA
  5. PCM_GT (GeoTrac)
  6. PCM_AF
  7. PCM_AS
  8. PCM_ME
  9. PCM_NA
  10. PCM_WW
  11. PCM_JP
  12. PCM_NASL
  13. PCM_MX

Default is Current. If an unlicensed dataset is specified, the request will result in a forbidden request, i.e. a 403 HTTP Response.

Example:

&dataset=PCM_ME

See also
    ALK.PCM.Model.RegionalDataSet

timeOut
lang
assetID
Returns
Parameters
units
splitHouseNumber
includeTrimblePlaceIDs
A JSON formatted response.

Example of a result returned from ALK.PCM.IRestGeocodeService.ReverseGeo.

This result is an object of ALK.PCM.Model.BusinessModels.GeocodeOutputLocation.

{
    "Address": {
        "StreetAddress": "Vine Street West",
        "City": "Philadelphia",
        "State": "PA",
        "Zip": "19102",
        "County": "Philadelphia",
        "Country": "United States",
        "SPLC": null,
        "CountryPostalFilter": 0,
        "AbbreviationFormat": 0,
        "StateName": "Pennsylvania",
        "StateAbbreviation": "PA",
        "CountryAbbreviation": "US"
    },
    "Coords": {
        "Lat": "39.958188",
        "Lon": "-75.163244"
    },
    "Region": 4,
    "Label": "",
    "PlaceName": "",
    "TimeZone": "EST",
    "Errors": [],
    "SpeedLimitInfo": {
        "Speed": 35,
        "SpeedType": 2,
        "SpeedTypeString": "Premium",
        "LinkIds": null,
        "RoadClass": "Secondary",
        "Units": "MPH"
    },
    "ConfidenceLevel": "Exact",
    "DistanceFromRoad": 0,
    "CrossStreet": null
}

◆ ReverseGeoBatch()

The /locations/reverse/batch POST request performs a reverse geocoding search on a batch of coordinates.

REST METHOD: POST
REST URI:

/locations/reverse/batch?dataset={dataset}
Parameters
requestContains the input structure to batch Reverse Geocode. This structure is contained in the body of the batch reverse geocode request.
See ALK.PCM.Model.ServiceModels.ReverseGeocodeRequestBody.

Example:

{
   "request":{
      "Coords":[
         {
            "Lat":39.958188,
            "Lon":-75.163244,
            "Region":4,
            "SpeedLimitOption":{
               "CurrentSpeed":40,
               "Heading":180,
               "Urban":true,
               "Vehicle":0,
               "SpeedLimitPreference":0
            },
            "Timestamp": "2017-01-21 12:30 PM"
         },
         {
            "Lat":40.958188,
            "Lon":-75.163244,
            "Region":4,
            "Timestamp": "2017-06-21 3:30 PM"
         }
      ],
      "MatchNamedRoadsOnly":false,
      "MaxCleanupMiles":99999,
      "IncludePostedSpeedLimit":true
   }
}
datasetThe data region in which the route is located. Possible values for the routePath request are:

  1. Current
  2. PCM_EU
  3. PCM_OC
  4. PCM_SA
  5. PCM_GT (GeoTrac)
  6. PCM_AF
  7. PCM_AS
  8. PCM_ME
  9. PCM_NA
  10. PCM_WW
  11. PCM_JP
  12. PCM_NASL
  13. PCM_MX

Default is Current. If an unlicensed dataset is specified, the request will result in a forbidden request, i.e. a 403 HTTP Response.

Example:

&dataset=PCM_ME

See also
    ALK.PCM.Model.RegionalDataSet

Returns
A JSON formatted response.

Example of a result returned from ALK.PCM.IRestGeocodeService.ReverseGeoBatch.

This result is an array of ALK.PCM.Model.BusinessModels.GeocodeOutputLocation wrapped in a containing object named ReverseGeoBatchResult

{
  "ReverseGeoBatchResult": [
    {
      "Address": {
        "StreetAddress": "Vine Street West",
        "City": "Philadelphia",
        "State": "PA",
        "Zip": "19102",
        "County": "Philadelphia",
        "Country": "United States",
        "SPLC": null,
        "CountryPostalFilter": 0,
        "AbbreviationFormat": 0,
        "StateName": "Pennsylvania",
        "StateAbbreviation": "PA",
        "CountryAbbreviation": "US"
      },
      "Coords": {
        "Lat": "39.958188",
        "Lon": "-75.163244"
      },
      "Region": 4,
      "Label": "",
      "PlaceName": "",
      "TimeZone": "EST",
      "Errors": [],
      "SpeedLimitInfo": {
        "Speed": 35,
        "SpeedType": 2,
        "SpeedTypeString": "Premium",
        "LinkIds": null,
        "RoadClass": "Secondary",
        "Units": "KPH"
      },
      "ConfidenceLevel": "Exact",
      "DistanceFromRoad": 0.001,
      "CrossStreet": null
    },
    {
      "Address": {
        "StreetAddress": "Mountain Road",
        "City": "Stroudsburg",
        "State": "PA",
        "Zip": "18360",
        "County": "Monroe",
        "Country": "United States",
        "SPLC": null,
        "CountryPostalFilter": 0,
        "AbbreviationFormat": 0,
        "StateName": "Pennsylvania",
        "StateAbbreviation": "PA",
        "CountryAbbreviation": "US"
      },
      "Coords": {
        "Lat": "40.958188",
        "Lon": "-75.163244"
      },
      "Region": 4,
      "Label": "",
      "PlaceName": "",
      "TimeZone": "EDT",
      "Errors": [],
      "SpeedLimitInfo": {
        "Speed": 25,
        "SpeedType": 0,
        "SpeedTypeString": "Default",
        "LinkIds": null,
        "Units": "KPH"
      },
      "ConfidenceLevel": "Exact",
      "DistanceFromRoad": 0.027,
      "CrossStreet": null
    }
  ]
}

◆ States()

List<StateCountry> States(DataRegionregion,
CountryCodeFormatabbrFormat,
bool? countryOnly 
)

The /states GET request retrieves the states or countries for a region.

REST METHOD: GET
REST URI:

/states?region={region}&abbrFormat={abbrFormat}&countryOnly={countryOnly}
Parameters
countryOnlyIndicates whether the search is for country only or for both country and states. Possible values are boolean:

  • true
    Retrieve for countries only.
  • false
    Retrieve for both countries and states.

Default is false (both countries and states).

Example:

&countryOnly=true
abbrFormatIndicates the abbreviation format for countries. Possible values are:

  1. FIPS
  2. ISO2
  3. ISO3
  4. GENC2
  5. GENC3

Default is FIPS.

Example:

&abbrFormat=ISO3

See also
    ALK.PCM.Model.CountryCodeFormat

regionThe data region in which the route is located. Possible values are:

  1. Unknown - Africa
  2. AF - Africa
  3. AS - Asia
  4. EU - Europe
  5. NA - North America
  6. OC - Oceania; Australia
  7. SA - South America
  8. ME - Middle East

Default is NA (North America).

Example:

&region=EU

See also
    ALK.Common.Model.DataRegion

If no input is specified, then the default is to retrieve all countries and states in North America. If the region is NA (North America), the result contains the state abbreviation, the full state name, the country abbreviation, and the full country name.

Outside of NA, the result contains only the country abbreviation and the full country name.

Returns
A JSON formatted response containing the State & Country data.

Example of a result returned from ALK.PCM.IRestGeocodeService.States.

This result is an array of ALK.PCM.Model.BusinessModels.StateCountry.

[
    {
        "StateAbbr": "AL",
        "StateName": "Alabama",
        "CountryAbbr": "US",
        "CountryName": "United States"
    }
]