NetTalk Central

Author Topic: NetMaps URl too large error  (Read 6277 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
NetMaps URl too large error
« on: August 03, 2020, 12:50:13 PM »
Hi, max number of Wps for Here and no traffic is 120, sending 94 wps I get this error, see pic.
How to solve this?
Thanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetMaps URl too large error
« Reply #1 on: August 04, 2020, 06:11:15 PM »
what's a wps?

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetMaps URl too large error
« Reply #2 on: August 05, 2020, 03:29:01 AM »
waypoints

! GET ROUTE -------------------------------------------------------------------------------------
! The maximum number of waypoints including the start point and end point is 120 without
! traffic and 50 with traffic. If the routing mode pedestrian is used, the distance
! between each two of the waypoints must not be greater than 5km.
« Last Edit: August 05, 2020, 03:33:58 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetMaps URl too large error
« Reply #3 on: August 05, 2020, 10:34:10 PM »
It would appear that Nginx has a limit to the overall length of the URL. That's the server on that side, so nothing we can do about that limit.

I guess the next best thing to do would be to see if the URL length can be reduced. In order to see that it might be helpful to see what your URL is currently set to...
(perhaps your waypoint ID's can be shorter or something like that.)

cheers
Bruce


Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetMaps URl too large error
« Reply #4 on: September 24, 2020, 04:55:57 AM »
Bruce, problem to get the URL shorten is that you use the Legend of the Waypoint and it is very usefull as Tiptool on the map.

In NetMapsHERE._MakeWaypointsForOptimize   Procedure()
you use the Waypoint.ID to send to HERE, ID is very short.

but in NetMapsHERE._MakeWaypointsForCalc       Procedure()
you use the Waypoint Label, Label may be an Address

any way to send the ID in GetRoute?

mhhhh problem is it is used to make the line Start at... when each instruction set begins...

Im using part of the address, so how much can I shorten it?

Ive send an email to Here, waitin for response.

« Last Edit: September 24, 2020, 12:52:59 PM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetMaps URl too large error
« Reply #5 on: September 29, 2020, 07:16:13 PM »
I've read this a number of times, but I'm still not sure I understand what you are asking.

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetMaps URl too large error
« Reply #6 on: September 30, 2020, 04:15:36 AM »
Sory, I will try to be more specific.

All this come from my first post: Error 414 URL too large from Here server.

You make the URL in two procs, Optimize() and GetRoute()

In NetMapsHERE._MakeWaypointsForOptimize   Procedure()
when making the URL series of waypoints you use the Waypoint.ID to send to HERE, the IDs are normally shorter than Label.
the optimize is only to get the best "order" or "sequence" of waypoints, then its ok to use the ID to identify them.

but in NetMapsHERE._MakeWaypointsForCalc       Procedure()
you use the Waypoint Label, in my case Im using the first part of the Address and you, in the demo, are using a name.

Why do we need to use Label instead of ID in Getroute?
Because when you GetRoute, Here response with the Instructions and Here uses the Descripcion of the waypoint to make it, and response like:
Begin at "Description of waypoint 1" and go forward to "Description of waypoint 2"

Using the Label you will get:
Begin at "Capesoft Headquaters" and go forward to "Hamiltom street Nr12 Department 5"

But Using the ID may be you will get:
Begin at "11" and go forward to "123"
what is not OK for the user.

As the waypoint ID is shorter than the Label, then the URL for Optimize is shorter than for Getroute, using the same quantity of waypoints.
Then, with the same quantity of waypoints, you can Optimize without error but cannot GetRoute.
And the user does not understand what the error is or came from


So we need to check the length of the URL before posting and if its longer than the max length use by Here show a message to the user to shorten the descriptions.
This may be a template value "HERE URL max length" that we can change, because its a value defined by the HERE server.
I think this check must be done in .APIOptimize() and .APIGetroute()
May be just cheking the length before doing the .get()

Hope it helps.
Regards





« Last Edit: September 30, 2020, 09:37:26 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetMaps URl too large error
« Reply #7 on: October 01, 2020, 04:07:58 AM »
Doesn't seem like there's much I can do, except set a property
(self.MaxUrlLength)
- if you try and do a GET longer than that then you'll get a call to ErrorTrap.

the value in the property defaults to the length of CommandQueue.URLParameters. (which I've made 8K long)

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetMaps URl too large error
« Reply #8 on: October 01, 2020, 11:22:14 AM »
Thanks a lot
-----------
Regards
Alberto