[marble] [Bug 374446] New: Improvements to CycleStreets API calls

2017-01-01 Thread CycleStreets
https://bugs.kde.org/show_bug.cgi?id=374446

Bug ID: 374446
   Summary: Improvements to CycleStreets API calls
   Product: marble
   Version: unspecified
  Platform: Other
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: NOR
 Component: data
  Assignee: marble-b...@kde.org
  Reporter: kdeb...@cyclestreets.net
  Target Milestone: ---

Hi,

I'm writing from CycleStreets, whose API you have kindly integrated for bicycle
routing:
http://commits.kde.org/marble/af22018eb38e7ff48b10ab0a131809a342db8a1c

We get plenty of requests from Marble users, which is great. Here are a few
enhancements you could make:

Currently Marble makes requests like this:
/api/journey.xml?itinerarypoints=11.431882,44.465502%7C11.437141,44.519076=cdccf13997d59e70=balanced=20=1
(prefixed with http://www.cyclestreets.net )

1) The site is now available as HTTPS. For user privacy, please do change
http://www.cyclestreets.net to https://www.cyclestreets.net . This is naturally
a simple change.

2) plan=shortest is an option currently, but in future we are likely to
deprecate this, as in practice it does not give useful routes. For instance, it
will take someone directly over the top of a very steep hill if that is the
shortest route when a more sensible alternative exists.

3) If you wish, you can send waypoints, i.e. A-B-C-... routing, rather than
just be limited to A-B.

4) JSON output is available, which means simpler parsing and the ability to
obtain an error status. XML will continue to be available, but JSON presumably
would enable the code to be simplified. Just change .xml to .json and remove
=1.

5) To enable error status (when using JSON), add =1 to the URL.

Overall, therefore, the request would now be:

/api/journey.json?itinerarypoints=11.431882,44.465502%7C11.437141,44.519076=cdccf13997d59e70=balanced=20=1
(prefixed with https://www.cyclestreets.net )

If an error occurs, the output would be in this format:

{"error":"The plan parameter must be specified in the v1 API"}

where the value on the right side is a human-readable error.

-- 
You are receiving this mail because:
You are watching all bug changes.

[marble] [Bug 374445] New: Calls to CycleStreets API are sometimes incomplete

2017-01-01 Thread CycleStreets
https://bugs.kde.org/show_bug.cgi?id=374445

Bug ID: 374445
   Summary: Calls to CycleStreets API are sometimes incomplete
   Product: marble
   Version: unspecified
  Platform: Other
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: NOR
 Component: data
  Assignee: marble-b...@kde.org
  Reporter: kdeb...@cyclestreets.net
  Target Milestone: ---

Hi,

I'm writing from CycleStreets, whose API you have kindly integrated for bicycle
routing:
http://commits.kde.org/marble/af22018eb38e7ff48b10ab0a131809a342db8a1c

We get plenty of requests from Marble users, which is great, but amongst a
small percentage of these, we noticed that some fail due to incomplete
parameters.

For instance, we sometimes receive an API request like this:

/api/journey.xml?itinerarypoints=11.431882,44.465502%7C11.437141,44.519076=cdccf13997d59e70=1

(prefix this with http://www.cyclestreets.net )

As you can see, the plan and speed parameters are missing. The correct version
of this request would be:

/api/journey.xml?itinerarypoints=11.431882,44.465502%7C11.437141,44.519076=cdccf13997d59e70=balanced=20=1

Sensible defaults would be plan=balanced and speed=20, which are what the API
will default to if no parameter is specified. But above the request specifies
each parameter but with an empty value, hence the failure.

I myself can't see in the code what is causing the missing parameters:
https://github.com/KDE/marble/search?q=cyclestreets

(P.S. I will file a separate issue report on a couple of potential improvements
you could make for the API calls.)

-- 
You are receiving this mail because:
You are watching all bug changes.