-
Notifications
You must be signed in to change notification settings - Fork 2
OS Places geocoder #7
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
Conversation
Adding the OS Places geocoder plugin and associated changes.
Unit test for our OS Places geocoder plugin.
Added checks to guard against the use of undefined variables.
|
The Geocoder plugin could be put somewhere on github - just as https://github.com/geocoder-php/bing-maps-provider for example, and could also make a PR on the geocoder-php project to include it - they do include several country specific plugin already. The linked plugin also gives an example of how they are testing them, by storing json responses and serving them as 'cached responses'. The Drupal Geocoder plugin could stand alone too - and go on drupal.org - or again be a merge request against that project. By making both of them separate it shouldn't slow things down waiting on PRs, but if they do get merged would be a bonus for everyone. Changes to the address class - support for additional fields for example - might make sense in LocalGov Geo so that people can use it for the Address Entity and its address autocomplete too? |
Sure. So this will have to be a totally new repo rather than just a pull request. Something like https://github.com/geocoder-php/os-places. Wondering how to request a repo.
+1 I will check.
Yeah, if Laravel can have its own repo within the geocoder-php project then no reason why Drupal can't. Although it's just one file so I am slightly hesitant even to ask for a new repo :(
I was thinking of keeping the LocalgovAddress class and the related LocalgovAdressInterface together with the OS Places Geocoder Provider plugin since the plugin relies on these. But it is possible you are referring to something different. Please let me know.
Okay, this one needs some thought. Does it mean we should:
Or did you mean something different? |
The integration test uses previously captured real query responses to run the tests.
I have added two test methods for the Ordnance survey geocoder that use this cached response-based approach. I have retained the previous pure Drupal test. Composer is having issues grabbing the geocoder-php/provider-integration-tests package, I will sort it out next week. |
Telling composer to install a *dev* dependency during test runs.
php-http/curl-client is a *dev* dependency of the previously added geocoder-php/provider-integration-tests package. This also needs to be explicitly installed. Note that dev dependencies are not fetched during 'composer require' operations. Hence the explicit instruction. As I realize now, this is also why the drupal/core-dev package exist. Perhaps we also need a localgovdrupal/localgov-dev package which will require all our dev dependencies!
|
Ready for testing. I had to explicitly instruct the test runner to grab dev dependencies. Do let me know if there is a better way of doing this. |
|
Had a Merge Monday chat with Ekes and Steve about the structure of the OS Places API related code. For now, we have decided to:
|
The Ordnance Survey geocoder has moved to its own package: localgovdrupal/localgov_os_places_geocoder_provider.
Replaced the LocalgovAddress Geocoder Model class with the new UprnAddress Model class. UprnAddress is provided by the new localgovdrupal/localgov_os_places_geocoder_provider package. UprnAddress is similar to the older LocalgovAddress class. Also updated some test data to reflect the real output from the OS Places geocoder.
- Dropping unneeded dev dependencies. - Adding new dependency.
|
Ready for review once again now that localgovdrupal/localgov_os_places_geocoder_provider is housing our Ordnance Survey Places Geocoder. @andybroomfield @ekes @finnlewis |
|
Makes sense, is just updating code to work with the new gecoder lookup. |
|
Thanks for the approval. Merging... |
Summary of code changes
PHP Geocoder plugin for the OS Places API. This is the plugin File.Drupal Geocoder plugin for the OS Places API. This one is a Drupal specific wrapper for the above plugin.Test steps
Notes
I will take steps to relocate the relevant files to those repos in consultation with Ekes.This is done now.@andybroomfield @andrew-wallis @ekes @finnlewis @MattOz-CDS @richardaclarke @tom-steel