abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
496 stars 118 forks source link

Store waypoints in GPX with <wpt /> #91

Open bagage opened 6 years ago

bagage commented 6 years ago

I am currently working on a drag&drop support feature for brouter-web. It'd like to be able to drop a gpx over brouter-web and that it computes the route between waypoints. It seems to me that the most logical/standard way of doing it would be by writing these waypoints as <wpt lon=.. lat=.. /> in the GPX file generated by brouter. Obviously some features like nogo areas won't be present in the GPX, but we can either they write then via some XML extension or ignore them since they won't be standard anyway.

nrenner commented 6 years ago

See also nrenner/brouter-web#16

I think this is what rte and rtept are for.

My idea at least for exporting/importing routes was to do this client-side only, using some library like togpx (with PR #11).

More on this tomorrow.

nrenner commented 6 years ago
Phyks commented 5 years ago

Hi,

I experienced a related issue lately. I used waypoints to define "stops" along a route and wanted to import the GPX track in OSMand, but actually the waypoints are only used internally in BRouter and never exposed in the GPX.

:+1: for this, I could write something to export waypoints in the GPX file. @nrenner and @bagage, you are probably more knowledgeable about GPX format than me, what would be the best way to handle this in your opinion?

Thanks!

nrenner commented 5 years ago

I used waypoints to define "stops" along a route and wanted to import the GPX track in OSMand

I think this is a separate issue.

For the original request

It'd like to be able to drop a gpx over brouter-web and that it computes the route between waypoints.

we would generate a GPX rte with rtepts.

As I understand, what you would probably want instead are wpt entries under the gpx element, and only for the "stops", not for all route/via points.

Before implementing, I would like to discuss whether we should rather add such additional GPX content in the client after the download (given that it's technically feasible).

Phyks commented 5 years ago

I would indeed want to have a list of points stored as <wpt> entries in the GPX file (as per the title of the issue :). These would show up as step points in Osmand for instance.

The question now is indeed about where this should happen. A simple solution which would work for me would be to have the BRouter server emit wpt objects for each and every lat/lon which has been passed to it (therefore for every enforced waypoint). This would be super simple to implement I think.

This being said, it might be worth having this added in the client interface (e.g. brouter-web) instead. This would have the major advantage of being able to mark waypoints as waypoint (just for the routing) or "steps" ("stops") and therefore be emitted in the GPX file. This would also help mark the waypoints with a proper name / label instead of just having a GPS coordinate.

I don't have any strong opinion on this. Having it built into brouter-server seems easier and would benefit any app built on top of BRouter. Having it in brouter-web would probably help make it more customizable.

nrenner commented 5 years ago

Still not sure myself about the client or server question, but I guess the most straightforward and consistent way would be to add it to the server. That it is available to other uses on the server is also a good argument.

Special, marked waypoints might also benefit nrenner/brouter-web#173. Simply having all route waypoints as wpt would be a good start.

But wouldn't want to add wpt waypoints by default, there should be an option in the export dialog in the client to enable it.

The overall goal would be to have several options for GPX at least:

Phyks commented 5 years ago

Special, marked waypoints might also benefit nrenner/brouter-web#173. Simply having all route waypoints as wpt would be a good start. But wouldn't want to add wpt waypoints by default, there should be an option in the export dialog in the client to enable it.

:+1: for this. A good start might be to have a exportWaypoint GET parameter in the server code which would export the wpt if passed.