hsarkanen / JollaOpas

Jolla Opas
GNU General Public License v3.0
4 stars 4 forks source link

Has the API changed? #15

Closed mjtorn closed 6 years ago

mjtorn commented 6 years ago

Moro!

Noticed I'm not getting results for routes, or even resolving addresses. The addresses in this example are from my history. I uncommented some debuggy lines to get the output.

I got nothing on this. Is there something to be done?

[nemo@Sailfish ~]$ /usr/bin/harbour-jollaopas
[D] unknown:0 - Using Wayland-EGL
[D] unknown:0 - Defaulting to webview scaling factor of 1.0
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
library "/vendor/lib/egl/libGLESv2S3D_adreno.so" not found
[D] :187 - http://api.reittiopas.fi/hsl/prod/?from_name=Forum&from=24.938418172011,60.168849012993&to_name=Rautatientori&to=24.943748513641,60.171925860463&jstime=Fri May 25 22:35:48 2018 GMT+0300&timetype=departure&walk_speed=70&optimize=fastest&change_margin=3&date=20180525&time=2235&format=json&request=route&show=5&lang=fi&detail=full&user=JollaOpas&pass=J_0P4s&epsg_in=wgs84&epsg_out=wgs84
[D] :320 - HTTP error 500
[W] unknown:321 - file:///usr/share/harbour-jollaopas/qml/js/reittiopas.js:321: TypeError: Type error
[D] unknown:0 - "Unexpected reply signature: got \"\", expected \"a{sv}\""
DagNygren commented 6 years ago

Seems like the old API is closed since last tuesday. Any plans of changing the API to the new supported GraphQL version? (https://www.facebook.com/HSLdevcom)

bitbooster commented 6 years ago

As I read from the answer to your question on FB, updating to the new API doesn't seem to be a straightforward task, unfortunately. EDIT: however, in Github there are examples of Kalkati-to-GTFS converters, if that's what is needed

DagNygren commented 6 years ago

I might take a shot at this if help is welcome. No promises though :-)

mjtorn commented 6 years ago

Urgh, I didn't even notice it was a Facebook link I opened and all I saw was login nags :D

Anyway, I hope the new API gets in; if there's a site to escrow bounties or something, I'd pitch in some cash to get this done.

Took two seconds looking looking at the dev resources like https://github.com/HSLdevcom?utf8=%E2%9C%93&q=digitransit&type=&language= and https://digitransit.fi/en/developers/ but the closest to a reference implementation I could find is the actual site. It would be more helpful of HSL if they provided libraries for their APIs.

Does anyone know if there are libraries out there I couldn't find in the two seconds?

ExTechOp commented 6 years ago

I believe @hsarkanen is working on this issue, he has updated the digitransit_api branch only three days ago?

ExTechOp commented 6 years ago

It seems @otsaloma has been able to solve this API issue in helsinki-transit-live with fairly small changes. Let's hope it isn't too complicated here, could issue #13 also be repaired simultaneously?

Sefriol commented 6 years ago

helsinki-transit-live issue referenced here is related to vehicle positioning, which is quite simple change, but it's not related to route API which uses GraphQL. This could be solved by integrating the c++ library into the project or just mocking GraphQL by just parsing some JSON. Or integrating the nodejs library somehow.

Either way this would require some work and quite a lot of testing. I think queries are pretty much the same, but responses require so much more work.

I already tried to work on more sophisticated approach for the live positioning (essentially ditching polling and using mqtt, making it truely realtime). But data parsing would need some extra implementation and I would need to make some design choices (like do I read the whole Helsinki Live transit or just specified lines).

In the end, I didn't have the time to see it through.

ExTechOp commented 6 years ago

The new version works again, thank you! Now if #13 could also be resolved...