bcgov / api-specs

[OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md) Repository
https://catalogue.data.gov.bc.ca/group/bc-government-api-registry
Other
26 stars 19 forks source link

Only result is province of BC in many cases #346

Closed OKNoah closed 5 years ago

OKNoah commented 6 years ago

When the search string is just a number, and the matchPrecisionNot is set to PROVINCE, the only result I get is the province of BC itself.

curl "https://geocoder.api.gov.bc.ca/addresses.json?autoComplete=true&addressString=5068&matchPrecisionNot=PROVINCE,LOCALITY"
OKNoah commented 6 years ago

Using the Swagger UI, the default example for /occupants/addresses.{outputFormat} also just returns BC.

cmhodgson commented 6 years ago

You will not get any matches for a query of 5068, even with autocomplete on - you must have at least 3 characters, and the trailing word must be the start of a street or locality name. Searching for addresses by unit number or civic number alone is not supported.

The default behaviour of the geocoder is to return a "BC" match when no match is found. Presently some of the query filter options (such as matchPrecisisonNot) are not applied to this default match. After a short discussion we have decided that all such filters should be applied.

The occupant example query (and some of the details of the occupant query) in the API console is out of date. These will be updated.

mraross commented 6 years ago

Thanks for the bug report OKNoah. We have updated the example in the Swagger UI and will get the bug fixed in the next release sometime in the fall. Note in the previous API version, a front gate ("--") was required to tell the geocoder that addressString contains an occupant name and not an address. In the current API version, no delimiter is required to indicate an occupant name. For example:
sir james douglas elementary

If you want to include a partial or complete address in addressString, you now just add an occupant separator ("") followed by a partial or complete address as in:
`sir james douglas elementary
Victoria`

mraross commented 5 years ago

Verified