Developer's Guide > API Documentation > API Documentation PTV xTerritory > Exceptions

Component xterritory

Diagrams

Exceptions

Service

Async

Request

Response

DistanceCalculation

Operations

planTerritories

Plan a fixed number of territories by clustering the given locations. Each location will be assigned to exactly one territory. This method can be used if reference points (for example sites) for each territory should be determined, or if only the clustering of locations is relevant but not the reference point a location is assigned to. The territories are refined depending on the following criteria: balance, connectivity, and compactness. Territories are balanced according to the accumulated activity of their locations. Each territory should be geometrically compact, meaning minimal driving times to each location. Depending on the road network, a circle may not always be the optimal shape considering equal driving times to each location. Furthermore, the boundaries of each territory should be as smooth and distinct as possible.

Parameter Name Type Description
locations Location[] Set of locations that is to be clustered into territories (required).
distanceCalculationOptions DistanceCalculationOptions Configures the way distances between locations and territory reference points are calculated or approximated (required).
planningOptions PlanningOptions Parameters for the planning algorithm (required).
planningProfile PlanningProfile Configures the planning algorithm (optional).
responseContents ResponseContents Configures the content of the response (optional).
Return Type Description
Territories Result of the territory planning.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.
XServiceException Thrown if a PTV xServer framework exception occurs.

startPlanTerritories

This is the asynchronous version of planTerritories. Calling this method will not block until the result has been calculated. Instead of a result object a Job object is returned which identifies the started calculation. To get status updates on a running job use the method watchJob and check the attribute status of type JobStatus. If it turns to SUCCEEDED, the calculation was successful and the result can be obtained using fetchTerritories. If the job ended with status FAILED, fetchTerritories throws the exception that occured during calculation.
Parameter Name Type Description
locations Location[] Set of locations that is to be clustered into territories (required).
distanceCalculationOptions DistanceCalculationOptions Configures the way distances between locations and territory reference points are calculated or approximated (required).
planningOptions PlanningOptions Parameters for the planning algorithm (required).
planningProfile PlanningProfile Configures the planning algorithm (optional).
responseContents ResponseContents Configures the content of the response (optional).
Return Type Description
Job The Job reference.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.
XServiceException Thrown if a PTV xServer framework exception occurs.

fetchTerritories

Fetches results of type Territories for the given job id. If the calculation ended with an exception fetchTerritories will rethrow it. If the id of the job is unknown a SystemException with message 'unknown id' is thrown.
Parameter Name Type Description
id String The id of the job.
Return Type Description
Territories Result of the territory planning.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.
XServiceException Thrown if a PTV xServer framework exception occurs.

distributeLocations

Distribute locations (for example customers) to given territory reference points (for example sites). Each location will be assigned to exactly one reference point. This method can be used if there are reference points that are fixed in their geographical position and each represents a territory. The territories are refined depending on the following criteria: balance, connectivity, and compactness. Territories are balanced according to the accumulated activity of their locations. Each territory should be geometrically compact, meaning minimal driving times to each location. Depending on the road network, a circle may not always be the optimal shape considering equal driving times to each location. Furthermore, the boundaries of each territory should be as smooth and distinct as possible.

Parameter Name Type Description
locations Location[] Set of locations which are to be distributed to the given reference points (required).
territories Territory[] Set of territories represented by their reference points to which the locations will be assigned (required).
distanceCalculationOptions DistanceCalculationOptions Configures the way distances between locations and territory reference points are calculated or approximated (required).
planningProfile PlanningProfile Configures the planning algorithm (optional).
responseContents ResponseContents Configures the content of the response (optional).
Return Type Description
Territories Result of the territory planning.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.
XServiceException Thrown if a PTV xServer framework exception occurs.

startDistributeLocations

This is the asynchronous version of distributeLocations. Calling this method will not block until the result has been calculated. Instead of a result object a Job object is returned which identifies the started calculation. To get status updates on a running job use the method watchJob and check the attribute status of type JobStatus. If it turns to SUCCEEDED, the calculation was successful and the result can be obtained using fetchTerritories. If the job ended with status FAILED, fetchTerritories throws the exception that occured during calculation.
Parameter Name Type Description
locations Location[] Set of locations which are to be distributed to the given reference points (required).
territories Territory[] Set of territories represented by their reference points to which the locations will be assigned (required).
distanceCalculationOptions DistanceCalculationOptions Configures the way distances between locations and territory reference points are calculated or approximated (required).
planningProfile PlanningProfile Configures the planning algorithm (optional).
responseContents ResponseContents Configures the content of the response (optional).
Return Type Description
Job The Job reference.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.
XServiceException Thrown if a PTV xServer framework exception occurs.

changeTerritories

Changes a given location territory assignment. This method can be used for adding new territories, removing existing ones or finding a better assignment for given and new locations. It complements planTerritories() and distributeLocations for more complex usecases.

Parameter Name Type Description
locations Location[]

Set of locations that is to be clustered into territories (required). The locations may be new or already assigned to territories.

territories Territory[] Set of given territories represented by their reference points. (required).
distanceCalculationOptions DistanceCalculationOptions

Configures the way distances between locations and territory reference points are calculated or approximated (required).

planningOptions PlanningOptions

Parameters for the planning algorithm (required).

planningProfile PlanningProfile

Configures the planning algorithm (optional).

responseContents ResponseContents Configures the content of the response (optional).
Return Type Description
Territories Result of the territory planning.
XServiceException Thrown if a PTV xServer framework exception occurs.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.

startChangeTerritories

This is the asynchronous version of changeTerritories. Calling this method will not block until the result has been calculated. Instead of a result object a Job object is returned which identifies the started calculation. To get status updates on a running job use the method watchJob and check the attribute status of type JobStatus. If it turns to SUCCEEDED, the calculation was successful and the result can be obtained using fetchTerritories. If the job ended with status FAILED, fetchTerritories throws the exception that occured during calculation.
Parameter Name Type Description
locations Location[]

Set of locations that is to be clustered into territories (required). The locations may be new or already assigned to territories.

territories Territory[] Set of given territories represented by their reference points. (required).
distanceCalculationOptions DistanceCalculationOptions

Configures the way distances between locations and territory reference points are calculated or approximated (required).

planningOptions PlanningOptions

Parameters for the planning algorithm (required).

planningProfile PlanningProfile

Configures the planning algorithm (optional).

responseContents ResponseContents Configures the content of the response (optional).
Return Type Description
Job The Job reference.
XServiceException Thrown if a PTV xServer framework exception occurs.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.

deleteDistanceMatrix

Delete a previously calculated distance matrix.

Parameter Name Type Description
id String The id of the distance matrix to be deleted (required).
Return Type Description
DeleteDistanceMatrixResponse Return an empty response if the deletion was successful.
XTerritoryException Thrown if an xTerritory server exception such as an invalid request parameter occurs.
XServiceException Thrown if a PTV xServer framework exception occurs.

watchJob

Returns status information on jobs.
Parameter Name Type Description
id String The id of the job.
watchOptions WatchOptions The options to control job status and progress updates.
Return Type Description
Job The job reference.
SystemException Thrown if job management is not available, for example if it is misconfigured.

stopJob

Attempts to stop a running job. If the status of the job turns to SUCCEEDED, preliminary results can be fetched, if available.
Parameter Name Type Description
id String The id of the job to be stopped.
Return Type Description
Job The job reference.
SystemException Thrown if a preliminary result cannot be provided or job management in general is not available, for example if it is misconfigured.

deleteJob

Attempts to delete a running job. If successful the returned job will have state DELETED.
Parameter Name Type Description
id String The id of the job to be deleteed.
Return Type Description
Job The job reference.
SystemException Thrown if job management is not available, for example if it is misconfigured.

Classes

AbsoluteActivity

Extends Activity

Represents an absolute value of constant activity. Activity values of all locations in a territory are accumulated to the totalActivity of the territory. Arbitrary numerical values can be used as activity measure. Typical examples are sales figures, enterprise sizes, or population figures.
Attribute Name Type Description
value double

The amount of activity measure which is projected to the corresponding location (required).

AbsoluteActivityLimit

Extends Limit

Represents the total of allowed activity within the assigned territory. It is the direct counterpart to AbsoluteActivity and can only be used in conjunction with it.
Attribute Name Type Description
maximumValue double

Represents a concrete limit for the total amount of activity within the assigned territory. The value of an AbsoluteActivityLimit must be greater 0.

Activity

Represents the abstract base for all kinds of activities assigned to a location.
No attributes defined.

ApproximateByDirectDistance

Extends DistanceCalculationOptions

Represents the distance approximation based on direct distances. The speed which is used for distance approximation can be configured with the parameter 'Routing/Vehicle/Speed/@speedForAirLineDistance' in the XML profile.
No attributes defined.

ApproximateByReferenceMatrix

Extends DistanceCalculationOptions

Represents the distance approximation based on a pre-calculated reference distance matrix. Distances between unknown locations are approximated using the nearest matrix elements of both endpoints as reference points. The matrix entry for those reference points is used to calculate a specific detour factor representing the difference between direct distance and the actual road distance. This detour factor is multiplied with the direct distance between the unknown locations to approximate their road distance. The distance matrix is read-only and will not be changed during the process.
Attribute Name Type Description
id String

The unique identifier of the reference matrix (required).

referencePointSelectionMethod ReferencePointSelectionMethod

Represents the method that is used to select the nearest reference point in the matrix.

Default value: DIRECT_DISTANCE.

DeleteDistanceMatrixResponse

Represents the response of a distance matrix deletion request and has no further content.
No attributes defined.

DistanceCalculationOptions

Represents an abstract base for the distance calculation configuration.
No attributes defined.

DistanceMatrixSummary

Represents the meta information on a distance matrix.
Attribute Name Type Description
id String

The id of the distance matrix. Use this id to reference the matrix for further use.

routingType RoutingType

Indicates what route calculation algorithm was used for the distances matrix calculation. If a high performance routing network is configured but there is no matching high performance graph for the called profile the routing mode will fall back to conventional routing.

percentageOfDirectDistances int

Percentage of used distances calculated by direct distance approximation. Each access to the distance matrix by the algorithm is counted.

ExistingDistanceMatrixByRoad

Extends DistanceCalculationOptions

Represents the distance calculation based on an existing distance matrix, for example from a previous request. Unknown distances are calculated on the fly, using the road network, and are then added to the matrix.
Attribute Name Type Description
id String

The unique identifier of the existing distance matrix (required).

Limit

Represents an abstract base class for territory limits. It cannot be instantiated directly.
Attribute Name Type Description
territoryAssignment String

Represents an ID that assigns a Limit to a specified territory. This limit then limits the total amount of activity of the assigned territory. The planTerritories method does not support limits with territory assignments. The changeTerritories method does not support limits that reference candidate territories. However, it is supported that limits carry territory assignments to fixed territories or even carry empty territory assignments.  

Location

Represents a location already assigned or to be assigned to a territory.
Attribute Name Type Description
id String

The unique identifier of this location (required).

coordinate Point

The geographical position of this location (required).

activity Activity

The activity of this location (required).

properties LocationProperties

A set of properties which restrict the assignment to certain territories.

territoryId String

The id of the territory this location is assigned to. This parameter can also be used to provide territories as input, but will be ignored for planTerritories.

fixedToTerritory Boolean

Indicates if this location is fixed to the territory represented by the territoryId. Fixed locations may not be moved to other territories in further plannings. Response locations are not fixed by default. This parameter will be ignored for planTerritories.

LocationProperties

Properties which restrict the assignment of a location to certain territories.
Attribute Name Type Description
group String

Unique identifier of a group of locations this location belongs to. Locations that are in the same group will be assigned to the same territory.

incompatibleTerrritoryIds String[]

A list of territories that are not assignable to this location, represented by their id. PlanTerritories does not support this attribute.

NewDistanceMatrixByRoad

Extends DistanceCalculationOptions

Represents the calculation of a new distance matrix using distances of the road network according to the routing profile provided in the request's CallerContext. All necessary distances are added to the distance matrix. The id of the distance matrix is returned in the DistanceMatrixSummary element if the matrix was not deleted after usage.

If there are distances that could not be calculated because no route was found they can be approximated by direct distances. This fallback can be configured using the distanceCalculation.directDistanceFallback entries in the server configuration.

Please use this configuration carefully and if only a small percentage of distances is affected.

Attribute Name Type Description
deleteAfterUsage boolean

If true, the distance matrix will be deleted after the request has finished. If false, a unique identifier for this matrix will be returned in the DistanceMatrixSummary element. A previously calculated matrix can also be deleted using the method DeleteDistanceMatrix.

Default value: true.

referenceTime Calendar

The reference time which is needed for the use of time-dependent feature layers. The time must be specified as a string using the xsd:datetime syntax, for example 2014-08-08T09:10:00+02:00. If this parameter is not set, it is assumed as now, meaning the local time of the PTV xTerritory Server.

PlanningOptions

Input parameters for the planning algorithm.
Attribute Name Type Description
exactNumberOfTerritories int

The exact number of territories that should be returned by the planning algorithm (required).

PlanningProfile

Parameters to configure the planning algorithm.
Attribute Name Type Description
solutionQuality SolutionQuality

Represents the thoroughness of the planning algorithm. A more thorough solution probably requires a larger amount of time. The particular parametrization for each solution quality is located in the TerritoryPlanning profile.

Default value: BASIC.

createBalancedTerritories boolean

If true, the imbalanceTolerance parameter will be considered by the planning algorithm. If false, the imbalanceTolerance will be ignored and a probably imbalanced solution is returned.

Default value: true.

imbalanceTolerance double

Represents the maximum deviation in percent from the average total activity per territory which is tolerated for each territory. The imbalanceTolerance is used as exit criterion for the algorithm: as soon as all territories are sufficiently balanced, the algorithm stops. For BASIC SolutionQuality this value is more a guidance level than a maximal value. Locations may be assigned to a territory after the algorithm stops. Therefore it cannot be quaranteed that the actual imbalance lies within the value set as imbalanceTolerance.

Default value: 10.0.

avoidOverlappingTerritories boolean

Territories are always optimized towards compactness and towards minimal driving times from the reference point to each location. Depending on the routing profile used for driving time calculation, territories may be stretched along major roads and it is possible that two territories visually overlap. If avoidOverlappingTerritories is set to true, visually overlapping territories are explicitly avoided by the algorithm, that means the territories are optimized towards round shape. If there is no valid solution that avoids overlapping territory, a valid solution with overlapping territories is returned. Territories are considered as overlapping if there exist intersecting direct links between locations from two different territories and their corresponding reference points. Setting this parameter to true may increase the algorithm runtime because additional steps have to be executed. Furthermore, the overall driving time per territory may increase because the territory is optimized towards round shape and not towards minimal driving time.

Default value: false.

limits Limit[]

Limits the amount of activities that are assignable for a territory. If set, the number of limits has to correspond with exactNumberOfTerritories in the "planning territories" and "change territories" use case or with the number of territories in the use cases "location assignment".

ResponseContents

Represents the configuration of the response content.
Attribute Name Type Description
locations boolean

Return a list of locations, each including the territory it is assigned to.

Default value: false.

territories boolean

Return a list of territories, each including the list of locations assigned to it.

Default value: true.

ServicePeriodActivity

Extends Activity

Represents a single service period in seconds at a location, which is used as activity measure. ServicePeriodActivities can only be used if estimated tour durations should be balanced. The resulting tour duration of a territory consists of the sum of given service periods and estimated driving periods.
Attribute Name Type Description
period int

The service period (in seconds) for this location.

Territories

Represents the result of a territory planning. Its contents are configured in the ResponseContents.
Attribute Name Type Description
locations Location[]

List of locations, each including the territory it is assigned to, if requested in the result set.

territories Territory[]

List of territories, each including the list of locations assigned to it, if requested in the result set.

distanceMatrixSummary DistanceMatrixSummary

Summary of the distance matrix calculation or extension. A summary will only be returned if a distance matrix was calculated and not deleted after its usage, or if a pre-calculated distance matrix was extended.

Territory

Represents the territory defined by its reference point and its assigned locations.
Attribute Name Type Description
id String

The unique identifier of this territory (required).

referencePoint Point

The geographical position of the reference point of the territory (required).

locationIds String[]

A list of locations assigned to this territory, represented by their id. The location elements can be found in the request or in the list of locations in the TerritoryResponse. As request input location ids are ignored.

summary TerritorySummary

A planning summary for this territory.

candidate Boolean Indicates that the territory is only a candidate for a solution. By default the value is not set. The distributeLocations method does not allow to set candidate territories.

TerritorySummary

Represents the summary of a territory which was planned.
Attribute Name Type Description
totalActivity double

The total amount of activity of the locations assigned to this territory.

numberOfLocations int

The total number of locations assigned to this territory.

estimatedTravelPeriodToTerritory Integer

Represents the estimated travel time (in seconds) from the territory center to the territory. It is calculated by averaging the distance from the territory center to its 5 nearest neighbors (locations). This value can be obtained in every use case except in the use case "planning territories" where there is no territory to drive to yet.

TourPeriodLimit

Extends Limit

Represents the total duration of an estimated tour within a territory. The total duration is determined based on duration values given in each location's ServicePeriodActivity. It constraints the estimated tour within a territory in time. Note, that the tour to be constrained in time is a mere estimation of driving times between the locations plus their individual service periods at each location within the assigned territory. It is not a precisely planned tour as resulted by the PTV xTour server. A TourDurationLimit can only be used in conjunction with a ServicePeriodActivity.
Attribute Name Type Description
maximumPeriod int

Represents a concrete limit for the total tour period (in seconds) within the assigned territory. The value of a TourPeriodLimit must be greater 0.

Enumerations

ErrorCode

Enumerator Name Value Description
LICENSE_ERROR 10000

License is not valid or expired.

REQUIREDPARAMETER_ERROR 10001

Missing a required input parameter.

MODULE_ERROR 10002

General error code of the xterritory module.

ENGINE_ERROR 10003

Engine call returned an error.

INVALIDPARAMETER_ERROR 10004

A parameter was set to an invalid value.

INVALIDPROFILE_ERROR 10005

Invalid profile settings.

ReferencePointSelectionMethod

Describes the method the nearest reference point is selected for a location.
Enumerator Name Value Description
DIRECT_DISTANCE 0

Select the reference point with the shortest direct distance from the unknown location.

ROUTING 1

Select the reference point with the shortest route from the unknown location. Only the n reference points with the shortest direct distance to the location are taken into account as candidates. This method may take a longer time but may lead to better results, especially when locations are situated on both sides of natural obstacles such as rivers.

RoutingType

Represents the type of the route calculation algorithm.

Enumerator Name Value Description
CONVENTIONAL 0

Indicates that the conventional routing algorithm was used for distance matrix calculation.

HIGH_PERFORMANCE_ROUTING_NETWORK 1

Indicates that high performance routing network was used for distance matrix calculation.

SolutionQuality

Represents the thoroughness of the planning algorithm. A more thorough solution probably requires a larger amount of time. The particular parametrization for each solution quality is located in the TerritoryPlanning profile.
Enumerator Name Value Description
BASIC 0

The algorithm uses certain approximations to solve the problem in reasonable amount of time.

HIGH 1

The algorithm uses a more detailed model of the problem which may lead to increasing calculation time.

Exceptions

XTerritoryException

Thrown if an xTerritory server exception such as an invalid request parameter occurs.

Component common

Diagrams

basetypes

opengis-geometry

Exceptions

Asynchronous Requests

Classes

BoundingBox

A bounding box, definded by its left top corner point and right bottom corner point.
Attribute Name Type Description
leftTop Point

The left top corner point.

rightBottom Point

The right bottom corner point.

BulkProgress

Extends JobProgress

Default implementation for bulk jobs.
Attribute Name Type Description
remaining int

Specifies how many requests have still to be calculated.

successful int

The number of successful calculations so far.

failed int

The number of failed computations so far.

ClusterProgress

Extends JobProgress

Implementation of JobProgress for cluster planning.
Attribute Name Type Description
action String

The current action being executed. For more information on progress see About Asynchronous Protocol.

distanceMatrixProgress DistanceMatrixProgress

The progress of the distance matrix calculation, available only if action equals "DistanceMatrix.Calculation".

optimizationProgress OptimizationProgress

The progress of the optimization, available only if action starts with "Optimization.".

DistanceMatrixCalculationProgress

Progress information of the currently active distance matrix calculation
Attribute Name Type Description
dimaId int

The unique key to identify the distance matrix currently being calculated.

currentDimaIndex int

The 1-based index of the distance matrix currently being calculated. Depending on the number of different vehicles in the request the number of distance matrices to be calculated can be greater than

lastDimaIndex int

The index of the last distance matrix to be calculated, that is the total number of distance matrices.

currentDistanceMatrixProgress DistanceMatrixProgress

The progress of the distance matrix currently being processed, available only if action equals "DistanceMatrix.Calculation".

DistanceMatrixProgress

Extends JobProgress

Default implementation for distance matrix calculation jobs.
Attribute Name Type Description
currentRowIndex int

The 1-based index of the current row of the current distance matrix being calculated.

lastRowIndex int

The index of the last row of the current distance matrix to be calculated.

EncodedGeometry

Extends EncodedGeometryBase

The abstract base class for geometry objects used in a geographical PTV xServer. Contains the attributes to represent openGIS conform encodings with a specific coordinate format. The actual representation is defined by the CallerContext ResponseGeometry property (GeometryEncoding) and the CallerContext CoordFormat property (CoordFormat).

Attribute Name Type Description
wkb byte[]

If not null, this attribute contains the well-known binary encoded form of the geometry

wkt String

If not null, this attribute contains the well-known text encoded form of the geometry

kml KML

If not null, this attribute contains the well-known text encoded form of the geometry

EncodedGeometryBase

The abstract base class for geometry objects.
No attributes defined.

GeometryCollection

Extends EncodedGeometry

A geometry collection as specified by the openGIS standard.
Attribute Name Type Description
geometryCollection PlainGeometryCollection

If not null, this attribute contains the explicit form of the geometry

ImprovementProgress

Progress information of the currently active improvement step of the optimization.
Attribute Name Type Description
availableMachineTime int

The available machine time stated in the request in [s]. This value is 0 if available machine time is not set in the request.

usedMachineTime int

The machine time already used in [s].

iterationIndex int

The index of this iteration. Index 0 denotes the initial plan directly after construction or the input plan.

numberOfImprovements int

The number of improvements the algorithm has already achieved. In other words, this is the number of tour plans with a smaller value of costOfObjectiveFunction than the best one at that time.

currentPlan KeyFigures

The key figures characterizing the current tour plan.

bestPlan KeyFigures

The key figures characterizing the currently best tour plan.

initialPlan KeyFigures

The key figures characterizing the initial tour plan. The initial tour plan is the input plan, if available, or the first tour plan after the construction step.

Job

Reference to jobs running in the background.
Attribute Name Type Description
id String

This id references the background job on the server.

status JobStatus

The current status of the job.

progress JobProgress

The current progress of the job. Can be null at the very beginning or very end of the request execution.

elapsedTime int

Elapsed time since this job has been queued.

JobProgress

Abstract base class for progresses. An individual PTV xServer might define its own implementations.
No attributes defined.

KML

Represents a KML geometry.
Attribute Name Type Description
kml String

The KML string itself.

placemarks String[]

The placemarks of the KML. If empty, all placemarks will be used. This will result in a GeometryCollection, if more than one exists.

KeyFigures

These key figures characterize a tour plan.
Attribute Name Type Description
costOfObjectiveFunction int

The optimization aims at minimizing the objective function. This value contains its arithmetical cost.

The significance of this value is not the value itself, but rather if and how fast it decreases during the calculation. The faster the value decreases the better the tour plans become according to the GoalImportance which defines what "better" means, at all.

numberOfScheduledOrders int

The number of orders already being scheduled.

numberOfUnscheduledOrders int

The number of orders not being scheduled, yet. These orders are feasible and can be scheduled during further improvement iterations.

numberOfInfeasibleOrders int

The number of orders not being scheduled. These orders are infeasible and will not be scheduled during further improvement iterations.

numberOfScheduledVehicles int

The number of vehicles being scheduled.

totalTourCount int

The number of all planned tours.

totalTourPeriod int

The sum of the tour periods for all planned tours ([sec]).

totalTourDrivingPeriod int

The sum of the tour driving periods for all planned tours ([sec]).

totalTourWaitingPeriod int

The sum of the tour waiting periods for all planned tours ([sec]).

totalTourDistance int

The sum of the tour distances for all planned tours ([m]).

totalTourCost int

The sum of the tour costs for all planned tours ([MU]). The costs per chain will not be included, see attribute totalChainCosts.

totalChainCost int

The sum of the costs per chain of all planned chains ([MU]). See VehicleCosts.

totalChainPeriod int

The sum of the chain periods of all planned chains ([sec]). The chain period is defined as the period between the start of the first tour and the end of the last tour. This period is greater than the sum of the periods of all tours if two subsequent tours do not start right after the other.

LineString

Extends EncodedGeometry

A line string as specified by the openGIS standard.

See EncodedGeometry for possible representations.

Attribute Name Type Description
lineString PlainLineString

If not null, this attribute contains the explicit form of the geometry.

ATTENTION: Filled with requested EncodedGeometry representation (not necessarily a plain geometry).

LinearRing

Extends EncodedGeometry

A linear ring as specified by the openGIS standard.

See EncodedGeometry for possible representations.

Attribute Name Type Description
linearRing PlainLinearRing

If not null, this attribute contains the explicit form of the geometry.

ATTENTION: Filled with requested EncodedGeometry representation (not necessarily a plain geometry).

MultiLineString

Extends EncodedGeometry

A multi line string as specified by the openGIS standard.

See EncodedGeometry for possible representations.

Attribute Name Type Description
multiLineString PlainMultiLineString

If not null, this attribute contains the explicit form of the geometry.

ATTENTION: Filled with requested EncodedGeometry representation (not necessarily a plain geometry).

MultiPoint

Extends EncodedGeometry

A multi point as specified by the openGIS standard.

See EncodedGeometry for possible representations.

Attribute Name Type Description
multiPoint PlainMultiPoint

If not null, this attribute contains the explicit form of the geometry.

ATTENTION: Filled with requested EncodedGeometry representation (not necessarily a plain geometry).

MultiPolygon

Extends EncodedGeometry

A multi polygon as specified by the openGIS standard.

See EncodedGeometry for possible representations.

Attribute Name Type Description
multiPolygon PlainMultiPolygon

If not null, this attribute contains the explicit form of the geometry.

ATTENTION: Filled with requested EncodedGeometry representation (not necessarily a plain geometry).

OptimizationProgress

The progress information of the currently active step of the optimization.
Attribute Name Type Description
currentLoopIndex int

The index of the current loop being calculated.

lastLoopIndex int

The index of the last loop being calculated. The calculation will automatically be finished by the algorithm before reaching this index when no improvement could be reached, anymore. The total number of loops can be set for the improvement step, only (see Params).

progress int

The progress in % of the current loop being calculated.

PlainGeometryBase

The abstract base class for the structured representation of geometry objects.
No attributes defined.

PlainGeometryCollection

Extends PlainGeometryBase

A plain structured polygon consisting of a set geometries.
Attribute Name Type Description
geometries PlainGeometryBase[]

The set of geometries making up the geometry collection.

PlainLineString

Extends PlainGeometryBase

A plain structured line string consisting of a set of points.

Attribute Name Type Description
points PlainPoint[]

The set of points defining the line string.

PlainLinearRing

Extends PlainGeometryBase

A plain structured linear ring consisting of a set of points

Attribute Name Type Description
points PlainPoint[]

The set of points defining the linear ring.

PlainMultiLineString

Extends PlainGeometryBase

A plain structured polygon consisting of a set of line strings.
Attribute Name Type Description
lineStrings PlainLineString[]

The set of line strings making up the multi line string.

PlainMultiPoint

Extends PlainGeometryBase

A plain structured polygon consisting of a set of points.
Attribute Name Type Description
points PlainPoint[]

The set of points making up the multi point.

PlainMultiPolygon

Extends PlainGeometryBase

A plain structured polygon consisting of a set of polygons.
Attribute Name Type Description
polygons PlainPolygon[]

The set of polygons making up the multi polygon.

PlainPoint

Extends PlainGeometryBase

A plain structured point consisting of two floating point attributes for the coordinates. In contrast to Point it is never transformed.

Attribute Name Type Description
x double

The x coordinate

y double

The y coordinate

z Double

The z coordinate (optional, only if requested)

PlainPolygon

Extends PlainGeometryBase

A plain structured polygon consisting of a set of linear rings.

Attribute Name Type Description
linearRings PlainLinearRing[]

The set of linear rings making up the polygon.

PlanProgress

Extends JobProgress

Implementation of JobProgress for tour planning.
Attribute Name Type Description
action String

The current action being executed. For more information on progress information see About Asynchronous Protocol.

distanceMatrixCalculationProgress DistanceMatrixCalculationProgress

The progress of the distance matrix calculation, available only if action starts with "DistanceMatrix.".

improvementProgress ImprovementProgress

The progress of the improvement step during the tour plan optimization, available only if action equals "Optimization.Improvement".

Point

Extends EncodedGeometry

Represents a single coordinate (point). Do not use this type for other points (e.g. pixel in an image), the coordinates are automatically transformed. Instead use PlainPoint.

See EncodedGeometry for possible representations.

Attribute Name Type Description
point PlainPoint

If not null, this attribute contains the explicit form of the geometry.

ATTENTION: Filled with requested EncodedGeometry representation (not necessarily a plain geometry).

Polygon

Extends EncodedGeometry

A polygon as specified by the openGIS standard.

See EncodedGeometry for possible representations.

Attribute Name Type Description
polygon PlainPolygon

If not null, this attribute contains the explicit form of the geometry.

ATTENTION: Filled with requested EncodedGeometry representation (not necessarily a plain geometry).

RequestOptions

General options for requests

Attribute Name Type Description
coordFormat CoordFormat

The coordinate format used in the request/response.

responseGeometry GeometryEncoding[]

The geometry encoding for the response.

profile String

The name of the parameter profile to be used.

profileXMLSnippet String

For internal use only.

srId String

If the coordFormat equals to 'OG_SRID', this attribute contains the Spatial Reference Identifier as specified by the Open Geospatial Consortium (OGC), otherwise it is null. All codes of the EPSG Geodetic Parameter Dataset V7.9 maintained by the EPSG.

TerritoryProgress

Extends JobProgress

Implementation of JobProgress for territory planning.

Attribute Name Type Description
action String

The current action being executed. For more information on progress with territory planning see the use case documentation.

distanceMatrixProgress DistanceMatrixProgress

The progress of the distance matrix calculation, available only if action equals "DistanceMatrix.Calculation".

optimizationProgress int

The progress of the optimization, available only if action starts with "TerritoryOptimization.".

WatchOptions

This class includes options to control job status and progress updates. All parameters are optional.
Attribute Name Type Description
progressUpdatePeriod Integer

If defined this optional parameter enables additional progress updates with the specified interval. If no new progress update arrives during the specified period, watchJob will wait for and return with the next available progress update. Important updates such as terminal states will always return immediately. The minimum period must be at least 250ms. If no progress waiting period is defined, progress will only be sent as part of status updates.

maximumPollingPeriod Integer

Specifies the timeout after which watchJob will report the last status even if no further updates are available.If not specified a configured default is used.

ZoneLoadingProgress

Extends JobProgress

Attribute Name Type Description
action String

The current action being executed.

optimizationProgress int

The progress of the optimization, available only if action starts with "LoadingSpaceOptimization.".

Enumerations

CoordFormat

The CoordFormat enumeration contains all coordinate types supported by the PTV xServer. All examples represent the same geographic location.

Enumerator Name Value Description
OG_GEODECIMAL None

OpenGIS representation of WGS 84 coordinates. Example x=8.2505556, y=48.7627778.

PTV_MERCATOR None Mercator projection. Example x=917420, y=6227729.
PTV_GEOMINSEC None

PTV representation of coordinates by degree, minute, and second. Example x=815020, y=4845460.

PTV_GEODECIMAL None

PTV representation of WGS 84 coordinates. Example x=825056, y=4876278.

PTV_CONFORM None

PTV representation of conform coordinates. Example x=1672358, y=1620743.

PTV_SUPERCONFORM None

PTV representation of super-conform coordinates. Example x=5072358, y=3320743.

PTV_SMARTUNITS None

PTV internal coordinate format. Example x=4352286, y=5456405.

OG_SRID None

This format is set implicitly, if a Spatial Reference Identifier as specified by the Open Geospatial Consortium (OGC) is set in the CallerContext. All codes of the EPSG Geodetic Parameter Dataset V7.9 maintained by the EPSG..
Note: The coordinate format 'OG_GEODECIMAL' and the SRID code 'EPSG:4326' are equivalent.

ErrorCode

Enumerator Name Value Description
REQUEST_INVALID_WKT 10

The specified WKT in the request is invalid. It should a well-known text representation of a geometry from a string (see the OpenGIS simple features specification).

REQUEST_INVALID_WKB 11

The specified WKB in the request is invalid. It should be a geometry from a byte stream in well-known binary format.

REQUEST_INVALID_KML 12

The specified KML in the request is invalid.

KML_PLACEMARK_NOT_FOUND 13

Thrown, if requested placemark name is not found in the KML

CONVERT_GEOMETRY_OBJECT 20

One or more geometry objects in the request are invalid. There are problems to convert a geometry object to a plain geometry object. Also used for retrieving the plain geometry object from a geometry object.

CONVERT_COORDINATE_FORMAT 21

There are problems to convert a CoordFormat of the request to a coordinate type.

GEOMETRY_ENCODING 22

Geometry objects cannot be encoded.

GeometryEncoding

Defines encoding options for geometry parameters and results.

Plain indicates that geometry objects should be transmitted in plain object form, WKB indicates that openGIS well-known binary format should be used, WKT represents the openGIS well-known text format. KML represents the Keyhole Markup Language.

Enumerator Name Value Description
PLAIN None

Plain geometry encoding using structured objects and according network presentation.

WKB None

Geometry should be represented by well-known binaries.

WKT None

Use well-known texts to encode geometry objects.

KML None

Use Keyhole Markup Language to encode geometry objects.

JobStatus

Specifies different job status values.
Enumerator Name Value Description
QUEUING None

Job has been enqueued.

RUNNING None

Job is currently running.

STOPPING None

Stop has been requested, the job will terminate its calculation as soon as possible.

SUCCEEDED None

Job has completed successfully.

FAILED None

Job has failed with an exception.

DELETED None

The job was deleted by the user.

UNKNOWN None

The job is in an unknown state. For example a given id is unknown or the job has already been fetched and has thus been deleted from the underlying persistent store.

Exceptions

XServiceException

XServiceException is used for all exceptions which can occur in the PTV xServer framework.

SystemException (from package com.ptvag.jabba.core.exception)

This is the base class for all system relevant exceptions. It is thrown for example if a request has timed out or if a request has been rejected.