Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place name searches in the geocoder. #82

Open
NicoledeGreef opened this issue Mar 5, 2020 · 14 comments
Open

Place name searches in the geocoder. #82

NicoledeGreef opened this issue Mar 5, 2020 · 14 comments
Projects

Comments

@NicoledeGreef
Copy link
Contributor

NicoledeGreef commented Mar 5, 2020

@mraross created an application ticket: MAP-971

"Currently, to enter a named place like Vanterm as a start or endpoint, you have to type in the first few characters of the name followed by the front-gate delimiter ("--") as in:

Vanterm--

The geocoder will then return a list of the top N best named place matches

Without the front-gate delimiter, the geocoder looks for matches in its list of civic addresses instead.

He proposes a change request in the calls that the map is making in order to handle this scenario.

@NicoledeGreef NicoledeGreef created this issue from a note in TRP Beta (For Discussion ) Mar 5, 2020
@NicoledeGreef
Copy link
Contributor Author

Suggests the following change to the behavior of the route waypoint text box:

  1. If a front-gate delimiter is present anywhere in the text, make a single request to the geocoder and present the results to the user for selection.

  2. If there is no front-gate delimiter present, make two requests to the geocoder as follows:
    a. One request using the text as entered by the user
    b. One request with a front-gate delimiter added to the end of the text as entered by the user

Present the results of both requests to the user for selection

Why does the geocoder need a front-gate delimiter?
In short, to reduce the possibility of meaningless matches. For example, If there is a Kootenay Warehouse in Vancouver and you start typing in Kootenay, you will get a bunch of matches to Kootenay Ave, Kootenay, BC, etc. When you enter the front-gate delimiter, you are telling the geocoder what you typed in is the start of a named place, not a partial civic address. Another use of the front-gate is when you want to find a commonly named place in a given area (e.g., Starbucks in Vernon). By being able to type Starbucks--Vernon, you can limit the search to Vernon.

@NicoledeGreef
Copy link
Contributor Author

@qqnluaq - can you please estimate for this proposed item?

@qqnluaq
Copy link
Collaborator

qqnluaq commented Mar 5, 2020

currently SMK uses the /addresses endpoint with the geocoder. Is this the right endpoint for this kind of search?

If SMK makes 2 requests to the geocoder, would the results have to be merged together (ie duplicates removed, and results somehow sorted in ranking order)?

Would the limit of max 5 results still apply?

@NicoledeGreef
Copy link
Contributor Author

@mraross - what's your suggestion?

@mraross
Copy link

mraross commented Mar 5, 2020

currently SMK uses the /addresses endpoint with the geocoder. Is this the right endpoint for this kind of search? Yes. The second request would have the front gate delimiter ("--") tacked on to the addressString if the user didn't enter one already

If SMK makes 2 requests to the geocoder, would the results have to be merged together (ie duplicates removed, and results somehow sorted in ranking order)? Merged yes; sorted maybe (you might try just putting named sites after civic addresses); duplicates removed no because the second search for named sites would only be looking for addresses with site names. For example, if the user typed in "Delta", a search for "Delta--" would not return Delta, BC, only Delta Port Entrance and Delta Port Exit.

Remember to honour the case where the user has included a front gate delimiter in their input address.

Would the limit of max 5 results still apply? No. Increase to at least 8 to allow for up to three site name matches. Feel free to tune to taste.

@qqnluaq
Copy link
Collaborator

qqnluaq commented Mar 5, 2020

@mraross so for the /addresses endpoin i would expect that I can give a search parameter of 'vanterm--' to get a result, but I only get one (all of BC, which is ignored):

 curl 'https://apps.gov.bc.ca/pub/geocoder/addresses.geojsonp?callback=jQuery33106523753314349983_1583432051286&ver=1.2&maxResults=20&outputSRS=4326&addressString=Vanterm--&autoComplete=true&locationDescriptor=accessPoint&_=1583432051299' -H 'Accept: */*' -v
*   Trying 142.34.241.96...
* TCP_NODELAY set
* Connected to apps.gov.bc.ca (142.34.241.96) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=CA; ST=British Columbia; L=Victoria; O=Government of the Province of British Columbia; CN=*.apps.gov.bc.ca
*  start date: Sep 10 15:46:36 2019 GMT
*  expire date: Oct  8 16:16:34 2020 GMT
*  subjectAltName: host "apps.gov.bc.ca" matched cert's "apps.gov.bc.ca"
*  issuer: C=US; O=Entrust, Inc.; OU=See www.entrust.net/legal-terms; OU=(c) 2012 Entrust, Inc. - for authorized use only; CN=Entrust Certification Authority - L1K
*  SSL certificate verify ok.
> GET /pub/geocoder/addresses.geojsonp?callback=jQuery33106523753314349983_1583432051286&ver=1.2&maxResults=20&outputSRS=4326&addressString=Vanterm--&autoComplete=true&locationDescriptor=accessPoint&_=1583432051299 HTTP/1.1
> Host: apps.gov.bc.ca
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 05 Mar 2020 19:24:29 GMT
< Server: Apache-Coyote/1.1
< Content-Type: application/javascript;charset=UTF-8
< X-RateLimit-Limit-hour: 60000
< X-RateLimit-Remaining-hour: 59985
< X-RateLimit-Limit-minute: 1000
< X-RateLimit-Remaining-minute: 998
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-Frame-Options: DENY
< Content-Security-Policy: script-src 'self' https://code.jquery.com https://unipear.api.gov.bc.ca 'unsafe-inline' 'unsafe-eval'
< Transfer-Encoding: chunked
<
* Connection #0 to host apps.gov.bc.ca left intact
jQuery33106523753314349983_1583432051286({"type":"FeatureCollection","queryAddress":"Vanterm--","searchTimestamp":"2020-03-05 11:24:29","executionTime":0.139,"version":"3.4.2","baseDataDate":"2019-05-10","crs":{"type":"EPSG","properties":{"code":4326}},"interpolation":"adaptive","echo":"true","locationDescriptor":"accessPoint","setBack":0,"minScore":0,"maxResults":20,"disclaimer":"http:\/\/www2.gov.bc.ca\/gov\/admin\/disclaimer.page","privacyStatement":"http:\/\/www2.gov.bc.ca\/gov\/admin\/privacy.page","copyrightNotice":"Copyright \u00A9 2018, Province of British Columbia - Open Government License","copyrightLicense":"http:\/\/www2.gov.bc.ca\/gov\/content\/governments\/about-the-bc-government\/databc\/open-data\/open-government-license-bc","features":[{"type":"Feature","geometry":{"type":"Point","crs":{"type":"EPSG","properties":{"code":4326}},"coordinates":[-122.7452849,53.913051]},"properties":{"fullAddress":"BC","score":1,"matchPrecision":"PROVINCE","precisionPoints":1,"faults":[],"siteName":"","unitDesignator":"","unitNumber":"","unitNumberSuffix":"","civicNumber":"","civicNumberSuffix":"","streetName":"","streetType":"","isStreetTypePrefix":"","streetDirection":"","isStreetDirectionPrefix":"","streetQualifier":"","localityName":"","localityType":"","electoralArea":"","provinceCode":"BC","locationPositionalAccuracy":"coarse","locationDescriptor":"provincePoint","siteID":"","blockID":"","fullSiteDescriptor":"","accessNotes":"","siteStatus":"","siteRetireDate":"","changeDate":"","isOfficial":"true"}}]});

Is this to be expected?

@mraross
Copy link

mraross commented Mar 5, 2020

Yes because you're hitting geocoder in prod which doesn't have the named sites loaded into it. For various reasons, our dlv and tst geocoders are down. Will let you know when they come back up so you can test.

@mraross
Copy link

mraross commented Mar 5, 2020

You might be able to use score to sort. I suspect site-name matches might score better than civic addresses. If not, we might be able to make it so through our geocoder config app.

@qqnluaq
Copy link
Collaborator

qqnluaq commented Mar 5, 2020

Estimate:
4 hrs

@mraross
Copy link

mraross commented Mar 5, 2020

Try sorting by score; it might just work.

@NicoledeGreef
Copy link
Contributor Author

@gk-tl - this was a late breaking suggestion from @mraross . basically allows for placename searches as well as address searches in the waypoint text boxes without any special action on the part of the end user.

can you please review and let me know if this is something you would like us to pursue ahead of March 31?

@mraross
Copy link

mraross commented Mar 5, 2020

In other words, you won't need to enter the frontgate delimeter ("--") that we discussed this morning.

@gk-tl
Copy link
Collaborator

gk-tl commented Mar 5, 2020

@al-tabb and I agree this is something that would be helpful to incorporate before March 31, but it also depends on level of effort/work load. The user does have the option to drop the pin//drag and drop etc, so this could equally well wait as an enhancement until after Mar 31 if need be.

@NicoledeGreef
Copy link
Contributor Author

thank you for the notes. given the date let's bundle this post March 31 if that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
TRP Beta
  
Icebox
Development

No branches or pull requests

4 participants