AnsweredAssumed Answered

Geocoder suggest endpoint not respecting category parameter

Question asked by CloudNiner on Jun 8, 2015

Hi,

 

Attempting to use the GeocodeServer find and suggest endpoints filtered by category. I would like to only show results that are Street Addresses, but the user is able to type in anything, including requests that are not street addresses, but would typically return non-street address results (they are POI's or Street Names or Intersections, etc), as in the workflow below.

 

So a web application makes the following request:

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=pjson&searchExtent=-75.291411,39.869314,-74.945342,40.148059&category=Street%20Address&text=ritten

Where category=Street Address and text=ritten and get this response:

{

  • suggestions:
    [
    • {
      • text: "W Rittenhouse St, Philadelphia, Pennsylvania, USA",
      • magicKey: "GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUns8t7hc0YQWMYcyGnh5LZcp0DFFF",
      • isCollection: false
      },
    • {
      • text: "Rittenhouse Sq, Philadelphia, Pennsylvania, USA",
      • magicKey: "GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnsNt7hc0YQWMYcyGnh5LZcp0DFFF",
      • isCollection: false
      },
    • {
      • text: "W Rittenhouse Sq, Philadelphia, Pennsylvania, USA",
      • magicKey: "GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnsbt7hc0YQWMYcyGnh5LZcp0DFFF",
      • isCollection: false
      },
    • {
      • text: "E Rittenhouse St, Philadelphia, Pennsylvania, USA",
      • magicKey: "GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnskt7hc0YQWMYcyGnh5LZcp0DFFF",
      • isCollection: false
      }
    ]

     

}

 

None of these results are street addresses, and I would expect this response to contain zero results based on my category filter. Instead they appear to be within the Street Name or POI category. I verified this by making requests to the find service by omitting the category=Street Address parameter:

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?magicKey=GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUns8t7hc0YQWMYcyGnh5LZcp0DFFF&f=pjson&searchExtent=-75.291411,39.869314,-74.945342,40.148059&text=W%20Rittenhouse%20St,%20Philadelphia,%20Pennsylvania,%20USA

 

This particular example, for the first result in the above suggest request, returns type StreetName.

 

If I readd the category=Street Address parameter in the previous find request, I get no results as expected, since this particular item is a Street Name.

 

Is this expected behavior? If so, how do I properly get these two services to filter properly on only street addresses?

Outcomes