UnknownError returned from RouteModel



  • Hey everyone,

    I am developing a project for my term project and in one of the modules it gets two coordinates from me, finds the shortest path and shows the route. But for about a week now, the plugin doesn't seem to draw any route. I tried running a routing query on OSM website which worked just fine. Thing is when I use GeocodeModel it works just fine but when it comes to RouteModel, it does not draw the path between coordinates also sets the "status" in routeModel to 3 -which is RouteModel.Error-, "error" to 5 -which is RouteModel.UnknownError- and "errorString" to "Found route between points".
    I tried tracing packets using WireShark -as Mr.Aaron McCarthy from QtLocation asked- and there is no json file directed to my IP from server.

    Any ideas on how can I overcome this issue ?
    Many thanks in advance.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Without any code it's pretty difficult, can you provide a small compilable example that shows that behavior ?



  • Thanks. I didn't add the code because it's the code Laszlo Agocs implemented in this video . I assumed the error QT-related. Anyway here's the code :

    Item {
        property variant fromCoordinate : QtPositioning.coordinate(-27.579336,153.100333);
        property variant toCoordinate : QtPositioning.coordinate(-37.759136, 145.156359);
        PositionSource{
            active:true
            onPositionChanged: { console.log(position.coordinate);}
        }
        Map{
            id:map
            plugin: Plugin{
                name: "osm"
                }
           center {
                latitude: -27.5796
                longitude: 153.1003
            }
            zoomLevel: 15
            gesture.enabled: true
            anchors.fill:parent
            MapQuickItem{
                id:marker
                opacity: 0.6
                coordinate:QtPositioning.coordinate(-27.579622,153.10032);
                sourceItem: Image {
                    id:image
                    source: "qrc:/resources/arrow.png"
                }
                anchorPoint.x: 0
                anchorPoint.y: image.height/2
            }
            MapItemView{
                model: routeModel
                delegate: Component {
                    MapRoute{
                        route:routeData
                        line.color:"blue"
                        line.width: 4
                    }
                }
            }
        }    
        RouteModel
       {
           id:routeModel
           plugin: map.plugin
           query:RouteQuery{
               id:routeQuery }
           autoUpdate: true
           Component.onCompleted: {
               routeQuery.addWaypoint(fromCoordinate);
               routeQuery.addWaypoint(toCoordinate);
               update();           
           }      
       }
    }
    

    Sorry it's a bit long. Thanks for your interest.

    Edit: The lines I logged error values I mentioned above aren't included for the sake of clarity.



    • Update -
      So, an interesting thing happened. I was tracing the packets in and out on my network, I filtered the ones whose ip:"141.3.85.1" -which i think is the routing server- the packets sent to me from this source includes a application.json file. Inside the file is the route between my coordinates.
      tags included in the file is here


  • Up!
    So anyone catches sight of the topic.


  • Lifetime Qt Champion

    I've tested your code but I can't reproduce your error, so it might indeed but something in your current network setup.



  • Hi, any progress in the last months? I have the same problem with example code from http://doc.qt.io/qt-5/qgeoroutingmanager.html#details



  • ah it's fixed in 5.6.0 RC: https://bugreports.qt.io/browse/QTBUG-50240


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.