NetTalk Central

Author Topic: NetTalk NetMaps GetRoute Error  (Read 5387 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
NetTalk NetMaps GetRoute Error
« on: July 09, 2020, 07:15:37 AM »
Hi, now that Ive solved the map problem, Im having errors getting a route.
The error is Invalid parameter in request, see pic
Then I went to the getroute definition and add a message to see the waypoint list and I got:

&waypoint0=-34.3679147,-58.7279087;;Planta Fleet
&waypoint1=-34.6604147,-58.5114918;;136146-Bragado 7071, ADQ, Buenos Aires, Argentina
&waypoint2=-34.664091,-58.6497601;;131751-Diego Aráoz 2976, Castelar, Provincia de Buenos Aires, Argentina
&waypoint3=-34.6505327,-58.7932661;;131754-Savedra 72, Moreno, Provincia de Buenos Aires, Argentina
&waypoint4=-34.6076478,-58.7304847;;131752-Vicente Yanez Pinzón 2221, Trujui, Provincia de Buenos Aires, Argentina
&waypoint5=-34.49796,-58.5882045;;135885-Junín 2184, Boulogne, Provincia de Buenos Aires, Argentina
&waypoint6=-34.4638713,-58.6522623;;135886-Chile 1519, El Talar, Provincia de Buenos Aires, Argentina
&waypoint7=-34.4679147,-58.7279087;;Planta Fleet

see pic, I dont know what is wrong or what to check to solve this.

Ive done the same with the example and I got:

&waypoint0=-34.3679147,-58.7279087;;Steenberg Golf Club,
&waypoint1=-34.3469568,-58.7950846;;Mowbray Golf Club,
&waypoint2=-34.3139757,-58.7878688;;Royal Cape, Golf Club,
&waypoint3=-34.3573622,-58.7962443;;Rondebosch- Golf Club,
&waypoint4=-34.3830145,-58.7440154;;Westlake Golf Club,

Any idea?
« Last Edit: July 09, 2020, 07:24:08 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetTalk NetMaps GetRoute Error
« Reply #1 on: July 09, 2020, 07:04:51 PM »
I think you use of Commas in the ID field is going to be a problem.
Use an id without a comma as the waypoint id value.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetTalk NetMaps GetRoute Error
« Reply #2 on: July 10, 2020, 08:51:04 AM »
Ive manage to know the error:

In page received I ve added:

        SETCLIPBOARD(self.ThisPage.GetValue())
        message(self.ThisPage.GetValue())
    self._ThrowError()

The result is:

{"results":null,"errors":["
One of parameters destination../start/end has no value assigned.
Missing equality sign?

Error ID: 8f60aa0f-77c6-450f-ae17-45bc0c5e64d5"],"processingTimeDesc":null,"responseCode":"400","warnings":null,"requestId":null}


This is another example of the error description from Here:
{"results":null,"errors":["All given waypoints have got the same coordinate. No Sequence can be calculated. Error ID: e3a39a8d-fd9d-4e66-b1d6-f496803f6166"],"processingTimeDesc":null,"responseCode":"400","warnings":null,"requestId":null}

>>>May be its a good idea to add this error description to the ThrowError message.<<<


Besides, to see what NT were sending to the API Ive added:

  SETCLIPBOARD( clip(baseURL) & '/' & nhm:OptimizeRoutePath & '/' & clip(resource) & |
            self.auth() & |
            clip(self.CommandQueue.Waypoints) & |
            '&mode=' & clip(self.CommandQueue.Mode) & |
            clip(when.GetValue()) & |
            '&improveFor=time' & |
            '&' & clip(self.CommandQueue.URLParameters)  |
            )
       
Before:  self.get( clip(baseURL) & '/' & nhm:OptimizeRoutePath & '/' & clip(resource) & |...............

The result is:

https://wse.ls.hereapi.com/2/findsequence.json?apiKey=Uru1aFINkHfp1r1Kx7jOETRWHMnfkHYqGSObPDTydms
&start=SALIDA;-34.3679147,-58.7279087
&destination0=4476;-34.7913751,-58.3623777
&destination1=4477;-34.5336463,-58.4840534
........
&destination21=4499;-34.5142077,-58.5455855
&destination22=4500;-34.6502738,-58.8102467
&destination23
&mode=fastest;car;traffic:default&departure=now&improveFor=time&

As you can see the waypoint list is incomplete.

Looking at NetMaps.inc:
NetMapCommandQueueType     Queue,type
Counter                      Long
........
Waypoints                    String(1024)  ! getroute
........
                           End

1024 is too short, Here suports 120 without! traffic and 50 with traffic.

the lenght of
&destination120=4476;-34.7913751,-58.3623777
is 44

then the minimum of Waypoint must be 44*120=5280

plus the problem of the starts and end which is ofthe form:

&start=SALIDA;-34.3679147,-58.7279087

and SALIDA is the ID of the start point which can be as long as 255 (as for the NetMapWaypointsQueueType ID declaration)

Then Waypoints field must be something like 6144 (1024*6)

Ive modified the NetMaps.inc with whis value and all works ok.




« Last Edit: July 13, 2020, 01:45:37 PM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetTalk NetMaps GetRoute Error
« Reply #3 on: July 13, 2020, 09:07:32 PM »
Hi Alberto,

I'll update the equates for the next build.

Your use of Clipboard and Message for debugging is a _really_ bad idea, as both have side effects on the program.

Rather use the net.Trace method to send information to debugview.

To see what is being sent by the program set the
NetShowSend=>1
compile switch

To see what is being returned by the server set the
NetShowReceive=>1
compile switch.

all output to be viewed in Debugview++

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetTalk NetMaps GetRoute Error
« Reply #4 on: July 14, 2020, 04:17:55 AM »
Any way to show the descriptions of Errors ?
This are some examples that are not shown:
They are grouped in the case of error 400
400. Invalid Parameter in request

{"results":null,"errors":["
One of parameters destination../start/end has no value assigned.Missing equality sign?
Error ID: 8f60aa0f-77c6-450f-ae17-45bc0c5e64d5"],"processingTimeDesc":null,"responseCode":"400","warnings":null,"requestId":null}

{"results":null,"errors":["
All given waypoints have got the same coordinate. No Sequence can be calculated.
Error ID: e3a39a8d-fd9d-4e66-b1d6-f496803f6166"],"processingTimeDesc":null,"responseCode":"400","warnings":null,"requestId":null}

« Last Edit: July 14, 2020, 06:28:43 PM by Bruce »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetTalk NetMaps GetRoute Error
« Reply #5 on: July 14, 2020, 06:29:13 PM »
using NetShowReceive you can see the replies in Debugview until you get your code right.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetTalk NetMaps GetRoute Error
« Reply #6 on: July 15, 2020, 04:32:03 AM »
Ive seen that the Routes queue has many many more records than the Instruccion queue.
It is because even going on the same street it can slightly change its direccion, see pic
In my tests having 100 wps in four routes I have more than 6000 points
Then drawing the routes uses 6000 lines
When getting the routes the first time its not a big problem
But when you move the map, it takes time to redraw the routes.
My idea is to add a parameter to set which point of the route to draw.
For example, when using a zoom less than 10, draw only the points that correspond to each manouver (instruction).
Just a thought to make the map moving better.
Thanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetTalk NetMaps GetRoute Error
« Reply #7 on: July 15, 2020, 11:22:09 PM »
sure, give it a try and see how it goes...