Impact of "ResponseGeometry" / "geometryOptions" (bandwidth)

Deals with generic topics such as logging, framework and so on. If you are not sure where to place your topic just put it here.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2572
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Impact of "ResponseGeometry" / "geometryOptions" (bandwidth)

Post by Bernd Welter »

Cheers,

as you may know we offer to handle different geometry styles in the context of xServers:
- xServer1 : CallerContextProperty->ResponseGeometry
- xServer2 : RequestBase.geometryOptions

The style you use within a transaction may have a significant impact on the message size and therefore on the performance (depending on the available bandwidth).

Here's an example of a route (xServer2.xRoute) from Barcelona to Warszaw with a distance of more than 2300km:

Code: Select all

{
  "waypoints": [
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 2.1700100683,
          "y": 41.388038574
        }
      }
    },
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 21.010370204,
          "y": 52.235599501
        }
      }
    }
  ],
  "resultFields": {
    "polyline": true
  },
  "geometryOptions":
  {
    "responseGeometryTypes":["WKB","PLAIN","WKT","KML","GEOJSON"]
  }
}
So within this request I ask for the polygon line in 5 different styles. From a logical perspective the content of these 5 response elements is equal. There's no loss of quality!
Now here are the sizes of those elements:
StyleSizeRelative to PLAIN
PLAIN564'324100%
WKB336'42960%
WKT422'38275%
KML406'92172%
geoJson439'52078%
Obviously the PLAIN style is the most bandwith consuming one. Especially for long distance routes this makes a big difference.

The benefit of the PLAIN style is that you can easily access any element of such a geometry even without the need for a specific geometry library.
The other styles may save bandwith but you may need some additional geometry frameworks to have full access to all the elements of such a geometry.

Nowadays such libraries are quite common. Even the mapping frameworks you use support them.
So if you can request geometries in WKB and then transfer them on client side in memory you may gain performance.

Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply