Giter Club home page Giter Club logo

Comments (6)

Janekdererste avatar Janekdererste commented on August 16, 2024 1

Closing this evn though @karussell could now :-)

from graphhopper-maps.

karussell avatar karussell commented on August 16, 2024

When markers are set on the map an adress close by needs to be searched and displayed in the search box

It might be a nice feature. You can use "reverse" geocoding, e.g. see this example request:

https://graphhopper.com/api/1/geocode?reverse=true&point=49.932707,11.588051&key=<yourkey>

Still personally I'm not a big fan of this user experience. You can go to https://www.openstreetmap.org/directions where this is done. Paste e.g. 49.167339,9.624023 in the start location and if you tab or click into the destination input it will replace the numbers with a text. Now the problem on osm.org is that the operation is not always an identity, so if you have:

text = reverse_geocode(coordinates)
new_coordinates = geocode(text)

then new_coordinates is not always equal to coordinates. Which makes problems if you use the "text" to share the URL and you expect the identical route, but you'll get the route with new_coordinates instead.
I think google maps is also doing this but they use text only as some UX representation and internally (as well as in the URL) uses the coordinates and so a shared URL will always look the same (as it uses the coordinates). But it might be tricky to get it right :)

When an adress is entered into the serach box an according coordiante needs to be resolved

Here the "normal" geocoding can be used:
https://graphhopper.com/api/1/geocode?q=dresden&key=<yourkey>

Please note that our API supports different geocoding providers and the best provider is IMO provider=nominatim as it covers many use cases and countries. Please note that it does not support auto completion, but when this is needed we could switch and use provider=default? (This is the way we do it for GraphHopper Maps)

from graphhopper-maps.

Janekdererste avatar Janekdererste commented on August 16, 2024

Implemented foreward geocoding in cbcb8d3

from graphhopper-maps.

karussell avatar karussell commented on August 16, 2024

👍

I'm not sure if reverse geocoding is required or should be high priority for now as there is a certain complexity involved and the current GH maps does not have it. The problem is that even if we reverse geocode lat+lon and use the prettier location name for the search boxes, we still need to store the lat+lon pairs in the UI state (and URL) to avoid imprecision due to lat+lon->name->different lat+lon.

from graphhopper-maps.

karussell avatar karussell commented on August 16, 2024

Closing for now

from graphhopper-maps.

karussell avatar karussell commented on August 16, 2024

Ups -> I cannot close it :D

@Janekdererste Would you mind to move the repo into the graphhopper org?

from graphhopper-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.