Geocoder

626 views
Skip to first unread message

felixbrun

unread,
Apr 27, 2011, 5:29:43 PM4/27/11
to OpenTripPlanner Developers
I understand that their are plans to implement a geocoder into otp. I
was wondering if this has been implemented yet, and if so how to
initiate it?

Thanks,

Felix

David Turner

unread,
Apr 27, 2011, 5:48:33 PM4/27/11
to opentripp...@googlegroups.com

We haven't gotten started on our own geocoder. In the meantime, we
support pluggable geocoders -- see the opentripplanner-geocoder
directory.

Vivien Deparday

unread,
Apr 27, 2011, 6:18:45 PM4/27/11
to opentripp...@googlegroups.com
In case you plan to work on it, I will soon commit the code to support
the Nominatim geocoder that can be used with OSM on the contrary to the
two commercial geocoders that are restricted due to their licenses.
Cheers,
Viv

Josh

unread,
May 5, 2011, 3:13:02 PM5/5/11
to OpenTripPlanner Developers
Great, glad to hear you'll support Nominatim! Can you enable it to
support multiple instances, like MapQuest? They seem to update much
more frequently than the main OSM service.
-Josh

Wojciech Kulesza

unread,
May 6, 2011, 10:48:27 AM5/6/11
to OpenTripPlanner Developers
Great news Vivien!
Do you have plans to include Nominatim support also in the API ? So
that, the request could be send as a "streetname + house number" as
opposed to lat/lon coordinates ?
Wojciech

Vivien Deparday

unread,
May 9, 2011, 1:43:02 AM5/9/11
to opentripp...@googlegroups.com
I just committed the code. It is not much. I just followed the plugin
architecture and adapted the code to the different URL parameters that
are sent in the request and the different JSON answer.
Thanks to Gordon Marcy who sent me his code to support filtering the
results with a viewbox and a result limit.

Josh: you can modify the URL of the Nominatim server you want to use in
the application-context.xml file. By default it uses the Mapquest one.

Wojcieh: I am not sure what you mean. The request is always sent as an
address (streetname + house number or POI...) ?

Viv

Josh Doe

unread,
May 9, 2011, 1:24:54 PM5/9/11
to opentripp...@googlegroups.com
Great, I'll be sure to try it out once I get OTP setup.
Thanks!
-Josh

Wojciech Kulesza

unread,
May 11, 2011, 11:59:40 AM5/11/11
to opentripp...@googlegroups.com
Viv,
What I meant.relates to opentripplanner-api-webapp,which expects a request sent as a URL and provides a result as xml/json.
Currently the request accepts coordinates as departure and arrival for the trip and I was hoping it can include something that nominatim will "convert" to coordinates and will pass that to the otp api.
Does this make sense?
Wojciech

Vivien Deparday

unread,
May 12, 2011, 1:45:05 PM5/12/11
to opentripp...@googlegroups.com
Wojciech,

I think I understand what you mean now and it seems that it comes down
to user interaction and how the modules are plugged together.

As it works currently, the user types in a start address that is
requested to the geocoder module and then he gets a result/coordinates
(or not, in this case he can retype) and then he types the to address
that is requested to the geocoder module and gets a result/coordinates
(or not). Then, the user click on "Plan" and the start and end
coordinates are sent to the routing API.

If I understand correctly, you suggest that the user would type in the
two addresses then click on "plan" to send the request to the routing
API and then, the routing API would request the coordinate from the
geocoder module (nominatim or another plugin) and then it plans the
route directly if there are only one answer for each address or it would
request the user to choose from multiple option if there is an ambiguity
on the addresses? In terms of user interaction, I think it is actually
kind of like Google maps behaves except that there is auto-completion of
addresses that is not there yet in OTP (maybe once there is an
implementation with Apache SOLR).

I am not sure what the best, but since OTP was and is working like
option 1, I just followed that and I added a plugin to the geocoder
module to support Nominatim so the quick answer would be that no I had
not planned to support the option 2 as it involves a bit more changes to
the way OTP currently works and I am not sure how well it would work in
terms of user interaction without auto-completion since Nominatim tends
to often return several results for a request. It also true that there
are a few oddities in the way the input form interact with geocoding
right now but that could be fixed.

What do you think are the advantages of option 2? Had anyone planned to
implement geocoding this way?

On this topic, there are actually two params "from" and "to" that are
sent in the URL and contain the addresses (fromplace and toplace contain
the coordinates) but I am not sure how and when they are used by the API
module.

Viv

felixbrun

unread,
Jun 6, 2011, 10:20:50 AM6/6/11
to OpenTripPlanner Developers
Vivien, do you have any instructions and/or pointers on how to setup
the geocoder with otp?

On May 12, 11:45 am, Vivien Deparday <vivien.depar...@gmail.com>
wrote:

Vivien Deparday

unread,
Jun 6, 2011, 11:24:31 AM6/6/11
to opentripp...@googlegroups.com
Felix,

1. In the opentripplanner/opentripplanner-webapp/src/main/webapp/js/otp/config.js file, line 37, change the property of the geocoder enabled from false to true
2. Double check the url parameter (line 38) in config.js It should be set to "/opentripplanner-geocoder/geocode" if you are using the trunk version of the geocoder.
3. You have to comment the line 41 'fromToOverride...'  in config.js so that the text boxes to input the addresses appear in the form.
4. Add the module opentriplanner-geocoder to your tomcat instance
5. Optional: in /opentripplanner/opentripplanner-geocoder/src/main/resources/org/opentripplanner/geocoder/application-context.xml , you can change the geocoder that is used by changing the ref of the property(line 84) to geocoderUSCSV or geocoderGoogle or geocoderYahoo (the three other geocoders that are supported so far). By default it is using Nominatim. As mentioned in this previous thread [1], there are some restrictions to use the Google and Yahoo geocoders.

Let me know if that works for you and I guess it should be added somewhere in the wiki if it is not there yet.

Cheers,

Viv

[1] http://groups.google.com/group/opentripplanner-dev/browse_thread/thread/337a44ec7fb34d67

felixbrun

unread,
Jun 21, 2011, 12:49:07 PM6/21/11
to OpenTripPlanner Developers
Do you have a working version of the Nominatim geocoder? I've been
trying for weeks but I keep getting stuck when trying to install
osm2pgsql. Any suggestions would be greatly appreciated.

Felix

ecri...@rbsas.co

unread,
Sep 30, 2015, 4:43:27 PM9/30/15
to OpenTripPlanner Developers
Hi.

I installed OTP "OpenTripPlanner-master"

I configured it, but the geocoder not worked, when I run over the wireshark sniffer, I use the geocoder autocomplete and I not get data about the transaction http.

Thank you
Reply all
Reply to author
Forward
0 new messages