Select to view content in your preferred language

I published a composite locator from ArcGIS Pro to ArcGIS Server. The geocode service is not functioning properly.

772
7
Jump to solution
08-23-2022 06:37 AM
FrankMatzen
New Contributor III

See this Geocode Service description:

Geocoder_AK (GeocodeServer)

Service Description:

Address Fields:

  • Address ( type: esriFieldTypeString, alias: Address or Place, required: false, length: 100 )
  • Address2 ( type: esriFieldTypeString, alias: Address2, required: false, length: 100 )
  • Address3 ( type: esriFieldTypeString, alias: Address3, required: false, length: 100 )
  • Neighborhood ( type: esriFieldTypeString, alias: Neighborhood, required: false, length: 50 )
  • City ( type: esriFieldTypeString, alias: City, required: false, length: 50 )
  • Subregion ( type: esriFieldTypeString, alias: County, required: false, length: 50 )
  • Region ( type: esriFieldTypeString, alias: State, required: false, length: 50 )
  • Postal ( type: esriFieldTypeString, alias: Postal_code, required: false, length: 20 )
  • PostalExt ( type: esriFieldTypeString, alias: ZIP4, required: false, length: 20 )
  • CountryCode ( type: esriFieldTypeString, alias: Country, required: false, length: 100 )

 

If I send this request (with the postal code in the Address):

{"records":[{"attributes":{"ObjectID":1,"Address":"5001 ZEAMER AVE 99506","Postal_Code":"99506","City":""}}]}

This (Status: M) reply is returned:

{

"spatialReference": {

  "wkid": 4326,

  "latestWkid": 4326

},

"locations": [

  {

   "address": "5001 ZEAMER AVE, 99506",

   "location": {

    "x": -149.7500813884659,

    "y": 61.232847472418655

   },

   "score": 100,

   "attributes": {

    "ResultID": 1,

    "Loc_name": "AKStreets",

    "Status": "M",

    "Score": 100,

    "Match_addr": "5001 ZEAMER AVE, 99506",

    "LongLabel": "5001 ZEAMER AVE, 99506",

    "ShortLabel": "5001 ZEAMER AVE",

    "Addr_type": "StreetAddress",

    "Type": "",

    "PlaceName": "",

    "Place_addr": "5001 ZEAMER AVE, 99506",

    "Phone": "",

    "URL": "",

    "Rank": 20,

    "AddBldg": "",

    "AddNum": "5001",

    "AddNumFrom": "4001",

    "AddNumTo": "5179",

    "AddRange": "4001-5179",

    "Side": "L",

    "StPreDir": "",

    "StPreType": "",

    "StName": "ZEAMER",

    "StType": "AVE",

    "StDir": "",

    "BldgType": "",

    "BldgName": "",

    "LevelType": "",

    "LevelName": "",

    "UnitType": "",

    "UnitName": "",

    "SubAddr": "",

    "StAddr": "5001 ZEAMER AVE",

    "Block": "",

    "Sector": "",

    "Nbrhd": "",

    "District": "",

    "City": "",

    "MetroArea": "",

    "Subregion": "",

    "Region": "",

    "RegionAbbr": "",

    "Territory": "",

    "Zone": "",

    "Postal": "99506",

    "PostalExt": "",

    "Country": "",

    "CntryName": "USA",

    "LangCode": "ENG",

    "Distance": 0,

    "X": -149.75008138846587,

    "Y": 61.232847472418555,

    "DisplayX": -149.75008138846587,

    "DisplayY": 61.232847472418555,

    "Xmin": -149.75108138846588,

    "Xmax": -149.74908138846587,

    "Ymin": 61.231847472418558,

    "Ymax": 61.233847472418553,

    "ExInfo": "",

    "Ref_ID": 831261764

   }

  }

]

}

 

If I send this request (without the postal code in the address):

{"records":[{"attributes":{"ObjectID":1,"Address":"5001 ZEAMER AVE","Postal_Code":"99506","City":""}}]}

 

This (Status: U) reply is returned:

{ "spatialReference": {  "wkid": 4326,  "latestWkid": 4326 }, "locations": [  {   "address": "",   "score": 0,   "attributes": {    "ResultID": 1,    "Loc_name": "",    "Status": "U",    "Score": 0,    "Match_addr": "",    "LongLabel": "",    "ShortLabel": "",    "Addr_type": "",    "Type": "",    "PlaceName": "",    "Place_addr": "",    "Phone": "",    "URL": "",    "Rank": 0,    "AddBldg": "",    "AddNum": "",    "AddNumFrom": "",    "AddNumTo": "",    "AddRange": "",    "Side": "",    "StPreDir": "",    "StPreType": "",    "StName": "",    "StType": "",    "StDir": "",    "BldgType": "",    "BldgName": "",    "LevelType": "",    "LevelName": "",    "UnitType": "",    "UnitName": "",    "SubAddr": "",    "StAddr": "",    "Block": "",    "Sector": "",    "Nbrhd": "",    "District": "",    "City": "",    "MetroArea": "",    "Subregion": "",    "Region": "",    "RegionAbbr": "",    "Territory": "",    "Zone": "",    "Postal": "",    "PostalExt": "",    "Country": "",    "CntryName": "",    "LangCode": "",    "Distance": 0,    "X": 0,    "Y": 0,    "DisplayX": 0,    "DisplayY": 0,    "Xmin": 0,    "Xmax": 0,    "Ymin": 0,    "Ymax": 0,    "ExInfo": "",    "Ref_ID": 0   }  } ]} I don’t want to put the postal code in the address. How can I fix this? If I send this request (with Postal, instead of Postal_code):{"records":[{"attributes":{"ObjectID":1,"Address":"5001 ZEAMER AVE","Postal":"99506","City":""}}]}

This (Status: M) reply is returned:

{ "spatialReference": {  "wkid": 4326,  "latestWkid": 4326 }, "locations": [  {   "address": "5001 ZEAMER AVE, 99506",   "location": {    "x": -149.7500813884659,    "y": 61.232847472418655   },   "score": 100,   "attributes": {    "ResultID": 1,    "Loc_name": "AKStreets",    "Status": "M",    "Score": 100,    "Match_addr": "5001 ZEAMER AVE, 99506",    "LongLabel": "5001 ZEAMER AVE, 99506",    "ShortLabel": "5001 ZEAMER AVE",    "Addr_type": "StreetAddress",    "Type": "",    "PlaceName": "",    "Place_addr": "5001 ZEAMER AVE, 99506",    "Phone": "",    "URL": "",    "Rank": 20,    "AddBldg": "",    "AddNum": "5001",    "AddNumFrom": "4001",    "AddNumTo": "5179",    "AddRange": "4001-5179",    "Side": "L",    "StPreDir": "",    "StPreType": "",    "StName": "ZEAMER",    "StType": "AVE",    "StDir": "",    "BldgType": "",    "BldgName": "",    "LevelType": "",    "LevelName": "",    "UnitType": "",    "UnitName": "",    "SubAddr": "",    "StAddr": "5001 ZEAMER AVE",    "Block": "",    "Sector": "",    "Nbrhd": "",    "District": "",    "City": "",    "MetroArea": "",    "Subregion": "",    "Region": "",    "RegionAbbr": "",    "Territory": "",    "Zone": "",    "Postal": "99506",    "PostalExt": "",    "Country": "",    "CntryName": "USA",    "LangCode": "ENG",    "Distance": 0,    "X": -149.75008138846587,    "Y": 61.232847472418555,    "DisplayX": -149.75008138846587,    "DisplayY": 61.232847472418555,    "Xmin": -149.75108138846588,    "Xmax": -149.74908138846587,    "Ymin": 61.231847472418558,    "Ymax": 61.233847472418553,    "ExInfo": "",    "Ref_ID": 831261764   }  } ]}

 

Why does it only work when I pass in a Postal attribute. It doesn’t work for Postal_code?

The service shows the name is Postal, and the alias is Postal_code. Why doesn’t the alias work the same as the name?

  • Postal ( type: esriFieldTypeString, alias: Postal_code, required: false, length: 20 )
0 Kudos
1 Solution

Accepted Solutions
ShanaBritt
Esri Regular Contributor

@FrankMatzen The input fields from the locator in the service description are considered parameters and in REST requests the field alias is not supported and is ignored. The actual field name from the service description must be used in REST requests. However, the field aliases can be used for display in client applications or Python, but you cannot write a client app that passes REST and pass aliases there either.

View solution in original post

0 Kudos
7 Replies
ShanaBritt
Esri Regular Contributor

What version of ArcGIS Server was the locator published to? Does the same behavior occur if "5001 ZEAMER AVE, 99506" is passed as the value in the 'Address' field?

Does the same behavior occur when using the local version of the composite in the Locate pane of ArcGIS Pro?

0 Kudos
FrankMatzen
New Contributor III
10.9.1
0 Kudos
FrankMatzen
New Contributor III

I have not tried using the local version of the composite in the Locate pane of ArcGIS Pro.

 

0 Kudos
ShanaBritt
Esri Regular Contributor

Just to clarify, you want to use the field alias for the Postal input field in your REST request or you don't want to include postal code as part of the input address?

0 Kudos
FrankMatzen
New Contributor III
yes
0 Kudos
ShanaBritt
Esri Regular Contributor

@FrankMatzen The input fields from the locator in the service description are considered parameters and in REST requests the field alias is not supported and is ignored. The actual field name from the service description must be used in REST requests. However, the field aliases can be used for display in client applications or Python, but you cannot write a client app that passes REST and pass aliases there either.

0 Kudos
FrankMatzen
New Contributor III
Thanks!
0 Kudos