Needs work
Project:
Geocoder
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Apr 2013 at 09:27 UTC
Updated:
17 Mar 2020 at 20:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
simon georges commentedThis could probably be adapted to work for Mapquest Nominatim service as well, if someone wants to take a look at it.
Comment #2
gaëlgThis one is for MapQuest Nominatim.
Comment #3
gaëlgOops, I forgot the
$params = $static_params;in the else case.Comment #4
gaëlgI made some improvements to this for better geocoding responses (google region parameter, no address parameter when components is used,...). Here's a patch containing all the improvements (including the previous patches), for Google and Mapquest Nominatim.
Comment #5
stockliasteroid commentedThanks for your work on this!
After reviewing and testing a bit, I think the approach needs to be modified... The Component Filtering in the Google Geocoding service aren't meant to be used instead of an address query, but in combination with one, at least if you want non-approximate results. Component filtering only supports a very small subset of address components, and as such won't return accurate results if it's used without an address query. See https://developers.google.com/maps/documentation/geocoding/#ComponentFil.... Specifically, it only supports the following components: administrative_area, route, postal_code, country, and locality. So, I modified the patch to only use administrative_area, country, and locality components, and then I pass the address query along with this data. This fixes the wrong country issue (I was getting Romanian addresses returned as if they were in Iowa), but still returns accurate rooftop-level results.
I also rolled the patch with relative paths, which should make it easier to apply.
Comment #6
gge commentedHello,
I just tested the above patch (#5) and everything seems to work as expected.
Thanks!
Comment #7
simon georges commentedOk, let met test that, and I'll commit it, thanks for all the work!).
Comment #8
sgdev commentedPatch #5 seems to help with the issues we started to see after moving from Geocoder 7.x-1.2 to 7.x-1.x-dev. The geocoding in 1.x-dev returns very unpredictable results, and if an address is not typed a very specific way, Geocoder will generate a point hundreds of kilometers away.
Only issue though is the patch does not apply cleanly to 7.x-1.x-dev. Was this written for 7.x-1.2, and will be moved to a -dev version?
Comment #9
sgdev commentedAttached is a re-roll of the patch against the current 7.x-1.x-dev and an interdiff.
The one area that seems confusing is the code added in
geocoder_google. There is already some new code in 7.x-1.x-dev listed under the comment of "Add any given biasing" which sets the value of$query['components'].Then immediately following that is the code included in this patch, which if
$componentsis notempty, the value of$query['components']is reset. Also right after this is more code that resets$query['region']if$geocoder_settings['geocoder_region_google']is set.Should these blocks of code be combined into one conditional?
Comment #10
sgdev commentedThe way the code is structured right now in
geocoder_google,$componentstakes precedence over$options. If that is the case, I'd think the code in that block should be as follows. Thoughts?Comment #11
sgdev commentedAfter using patch #9 for the past couple of weeks, it's clear the comments mentioned in #10 regarding the conditional need to be incorporated.
Attached is a new patch for review -- this seems to be working fairly well.
Comment #12
gaëlgThere's still a problem with the current Google handling. The doc says "Note: Each address component can only be specified either in the address parameter or as a component filter, but not both. Doing so may result in ZERO_RESULTS."
We have locality, (sub)administrative area and country both in address and components. This might be better:
PS: sorry to provide no patch, I'm in hurry and just hacked from the stable version's patch.
Comment #13
joelpittetMight as well fix these broken translations.
t('The text to a !link', array('!link'=> l(...)));Gives context to the translators and won't change the string every time the URL changes.
Comment #14
sgdev commentedThanks for the feedback. I've created a new patch including feedback from @GaëlG and @joelpittet. I also included the patch I posted here (https://www.drupal.org/node/2499771)... it's a simple mapquest typo that really should be fixed.
See attached and let me know if any other thoughts.
Comment #15
sgdev commented@joelpittet, thank you for taking care of the typo in #2499771. Even though a simple fix, I prefer not to mark my own patches as reviewed.
Attached is a new version of the patch for review that does not include the mapquest fix.
Comment #16
sgdev commentedGiven the recent release of 7.x-1.3 and focus on the 2.x branch, I'm not certain if anyone still wants this patch? I've created a new version and it is attached for review.
I also separated the broken URL translations referenced in #13 into its own issue: https://www.drupal.org/node/2664294
Comment #17
basvredeling#16 doesn't apply to 1.x-dev dd 5 June 2016
Comment #18
sgdev commentedI've been updating this patch for over a year with no feedback. It would be good to hear from the module maintainers if this is something they plan to review and consider to be committed.
Comment #19
basvredeling#1 I agree. I've tested this, albeit briefly. The functionality is needed but doesn't currently apply. I might not be a module maintainer but I'll gladly review your patch.
Comment #20
sgdev commentedFeel free to review what exists in #16. I haven't tried it out, but might be able to still apply the patch manually to test it.
Comment #21
sgdev commentedUpdated patch. The only difference is the
tryfunction was removed fromgeocoder_googlein 7.x-1.x-dev. Otherwise the patch is the same.Comment #22
basvredelingI've taken a quick look at the patch, generally it looks good. I've tested some basic google geocoding results. Geocoding works pretty well, but there's not a great difference between my previous geocoded results and my previous results. Couldn't test mapquest stuff. Component splitting is only specific to this service. And there is some further work to do in general.
So, probably not the review you were hoping for but at least this is moving again. I'll see if I can add a patch myself.
Comment #23
sgdev commented$componentsparameter can be removed. If you read comment #12 above, it should have been removed then.As for refactoring or adding more widgets, you can change whatever you like.
Comment #24
basvredelingOkay, I've got a new patch. Please review. For clarification:
Comment #25
wranvaud commentedMarking as related to #2859851 although I'm not sure it would solve this particular issue.
I like the approach of https://www.drupal.org/project/geocoder/issues/2859851 because it leverages the addressfield module to produce correctly formatted addresses.
Comment #26
polHello,
What is the status of this patch ?
Thanks!
Comment #27
sgdev commentedThe status? It needs review, and now because of the new release, it needs work. There needs to be someone other than me and anyone else contributing to the patch to actually try it and see if it works as expected.
Once again, another geocoder patch that sits idle for years, and ultimately a new release is made that doesn't include it. Extremely frustrating.
The patches in both #21 and #24 no longer apply cleanly to the most recent release, so someone is going to need to roll a new version for review.
Comment #28
spacemuon commentedPlease delete comment