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 )