GEO my WP Support

Use this forum for technical support and general questions related to GEO my WP plugin and its core add-ons only. For technical support and general questions related to any of the premium extensions please open a new premium support ticket.

[Not resolved]geolocation accuracy

Forums Support geolocation accuracy

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54664
    emilien
    Member

    Hey Eyal,
    I hope you’re fine, thank you for your work on GMW (still a great plugin, going better and better with every update). I’m contacting you today to suggest something I guess could be important to many users (depending on how they use your plugin).

    I personally need my users to be able to geolocate themselves and find locations around them in a short radius. Also, those locations aren’t always in town, where geolocation and reversed geocoding are quite accurate.

    My problem comes precisely from the geocoding process, which is done when my users hits the locator button inside the search form: as I understand it, but I’m more a curious than a real developer, this action retrieves the coordinates of the user, then “reverse geocodes” it and returns an address to the field. At the same time, it sends a request based on this same geocoded address.

    Problem is if you’re in the middle of nowhere, the geocoding process will return the closest address it can (at best), and it will be an estimate. While testing my webapp, in some cases, I got geolocated hundreds of meters off my actual position. So if I triggered a search around me in a radius of 100m, I was being returned no results actually around me, and many results quite far from me. I read about the enableHighAccuracy parameter and added this to the following piece of code:

    navigator.geolocation.getCurrentPosition(showPosition, showError, {enableHighAccuracy: true, timeout: 10000});

    It got me some better results (it seems) but it is as far as I could get.

    Would it be possible to enhance this function, so that if our user hits the locator button while being way out the reversed geocoding grid, the plugin keeps his coordinates and uses those to (1) locate the user with a great high accuracy, (2) return results that are actually around him…

    I guess there would be a condition to add somewhere. Kind of like:

    “if the distance between user’s latlong and the closest geocoded address is less than 10m, use reversed geocoding, use the returned address as a base for our request, and display it in the address field”

    otherwise

    “if the distance is over 10m, use the original coordinates in order to be the most accurate as possible and return the to the address field”

    Do you get what I mean? What do you think?
    Would you please be ok to communicate a code snippet about how to achieve this in gmw.js?

    thank you so much in advance for your help,
    have a great day,

    Emilien

    #54860
    emilien
    Member

    anything plz?

    #54863

    Hello Emilien,
    Apologies for missing out your post.

    The information you posted above is true regarding how the Geocoder API works and using the enableHighAccuracy for better accuracy ( I will most likely add the option to set it to true in the next release of the plugin ).

    However, the plugin does use the original coordinates to search for locations nearby.

    When hitting the locator button, the browser retrieves the user’s coordinates, the most accurate possible. Using Google API, GEO my WP will reverse geocode the coordinates to an address and place the address in the address field. However, GEO my WP will still use the original coordinates to search for locations in database.

    I am afraid that there is not much that can be done on my side regarding the accuracy of the coordinates.

    #54864
    emilien
    Member

    Hi Eyal and thank you very much for your answer (no problem regarding the little delay, I guess you are quite busy ;).

    Thank you also for the clarification, I didn’t test it enough and hadn’t seen the results would be based on the actual coordinates (sorry for that, I’ll test it more in the next few days).

    Regarding the coordinates, you’re right then, there’s nothing more to change, as the enableHighAccuracy parameter makes the Google Maps API accurate enough, even in the use case I described before.

    My humble opinion would be about some changes that could be done regarding UX: I guess it may be quite disturbing to see our location returned quite far from where we actually are sometimes (by hundreds of meters if you are hiking a mountain for example) even if results are returned based on the “true” location.

    Would the following scenario be relevant for you?
    In the GMW search form, there are notably two inputs: the address field and the locate me button. What I’d suggest regarding reversed geocoding would be:

    1 – If users enter anything inside the address field, then geocode and always return the Google API result (known address nearest to the entered elements).

    2 – If users hit the locate me button, then compare locations (actual coordinates vs geocoded address ones) and then if there is too big a gap (let’s assume this gap would be 50 meters for example), show user’s location at the real coordinates otherwise return an address as usual…

    This would prevent having cases where users are displayed far from there actual location on the results map.

    I hope you get what I mean (sorry for my english…), Thank you again and have a great day,

    Emilien

    #54968

    Hello Emilien,

    If users hit the locate me button, then compare locations (actual coordinates vs geocoded address ones) and then if there is too big a gap (let’s assume this gap would be 50 meters for example), show user’s location at the real coordinates otherwise return an address as usual…

    When using the locator button, the plugin retrieves the nearest coordinates of the user and converts it to an address. It does not retrieve the address which is then converted into coordinates. So when using the locator button, the plugin searches for locations and displays the user’s marker on the map based on the nearest coordinates which returned from the locator button.

    #55123
    emilien
    Member

    Hey Eyal, thank you for your message and sorry this took so long for me to answer, I was abroad for some time and needed a vacation 😉

    From what you say here, I guess the “comparison stuff” I talked about before isn’t useful at all. Still, it would be important for outdoor users browsing the website on their mobile while hiking a mountain, not to see themselves on the closest road, which can be quite some kilometers away…

    the plugin searches for locations and displays the user’s marker on the map based on the nearest coordinates which returned from the locator button

    Is there any way to display the map marker at the actual location of the user?

    or

    Is there any way to disable the geocoding process ? (I think I could manage this from a UI point of view)

    I’m sorry to bother you with this but it is quite disturbing for some users to see this gap between their actual location and the map marker …

    Thank you again and have a great day,

    Emilien

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.