Position matching tries to find the best matching road segment in the map for a given position. Therefor all segments within a radius around the position are taken into account. For the calculation mode QUALITY the radius is larger than for PERFORMANCE. If no other information is given then the nearest segment within this radius is taken as result. If additionally also the heading of the position is given, then the difference between the heading and the angle of the road segment is taken in account, too.
Input
The input of the position matching entry point are latitude and longitude (WGS84) of the query point which are given as path parameters. This endpoint also considers a heading for the position and the calculation mode as query parameter. The heading is the direction in which the vehicle (resp. the device from which the position is delivered) is traveling. It is measured clockwise in degrees from north.
The last parameter is the results parameter. Five values are supported:
- If the value GEOMETRY is set the polygon line of the matched road segment is provided in the response.
- If the value SEGMENT_LOCATION_DESCRIPTORS is set the address of the match position is provided in the response. Getting the address for a position causes additional runtime costs which leads to reduced performance. Thus it is recommended to query this result only if it is really needed.
- If the value SEGMENT_ATTRIBUTES is set additional segment attributes are added to the response.
- If the value LOW_EMISSION_ZONES is set low emission zones are added to the response. The list is only filled if any low emission zone is entered.
- If the value TOLL is set, toll information is added to the response if the matched road segment has toll restrictions.
Output
If the request succeeds, the response consists of details about the match:
- Latitude and longitude (WGS84) of the match position. The match position is the closest point on the matched road segment.
- The polygon line of the matched road segment as GeoJSON. This response attribute is only provided if the results parameter of the request contains the GEOMETRY value.
- The distance between the input position and the match position in meters.
- If a heading was given, the angle difference to the matched road segment in degrees.
- The address of the match position. This response attribute is only provided if the results parameter of the request contains the SEGMENT_LOCATION_DESCRIPTORS value.
- Additional information of the matched segment. This response attribute is only provided if the results parameter of the request contains the SEGMENT_ATTRIBUTES value.
- Low emission zones at the matched segment. This response attribute is only provided if the results parameter of the request contains the LOW_EMISSION_ZONES value.
- Toll data at the matched segment. This response attribute is only provided if the results parameter of the request contains the TOLL value and the road segment has a toll restriction.
A response might look like this:
{
"latitude": 48.86927401397978,
"longitude": 9.070254512814795,
"segmentGeometry": "{\"type\":\"LineString\",\"coordinates\":[[9.06984,48.86888],[9.07004,48.86904],[9.07026,48.86928]]}",
"matchDistance": 46,
"angleDifference": 69.57,
"segmentLocationDescriptors": {
"countryName": "Deutschland",
"city": "Schwieberdingen",
"postalCode": "71701",
"street": "Beethovenstraße"
},
"segmentAttributes": {
"bridge": false,
"tunnel": false,
"ramp": false,
"frontage": false,
"paved": true,
"requiresFourWheelDrive": false,
"privatelyManaged": false,
"publicAccess": true,
"parkingLot": false,
"priorityRoad": false,
"builtUpArea": true,
"speedLimit": 30
},
"lowEmissionZones": [
{
"name": "Schwieberdingen Umweltzone",
"approvals": [
"DE_GREEN"
],
"vehicleCategories": [
"DELIVERY_TRUCK",
"TRUCK"
],
"fuelTypes": [
"COMPRESSED_NATURAL_GAS",
"DIESEL",
"GASOLINE",
"LIQUEFIED_NATURAL_GAS",
"LIQUEFIED_PETROLEUM_GAS",
"NONE"
],
"vehicles": [
{
"timeRestrictions": [ "Valid every day from 00:00 to 06:00" ],
"vehicleCategory": "DELIVERY_TRUCK",
"fuelTypes": [
"COMPRESSED_NATURAL_GAS",
"DIESEL",
"GASOLINE",
"LIQUEFIED_NATURAL_GAS",
"LIQUEFIED_PETROLEUM_GAS",
"NONE"
],
"emissionStandards": [
"EURO_1",
"EURO_2",
"EURO_3",
"EURO_4",
"EURO_5",
"EURO_6"
],
"vehicleAttributes": {
"minTotalWeight": "7500"
}
},
{
"timeRestrictions": [ "Valid every day from 00:00 to 06:00" ],
"vehicleCategory": "TRUCK",
"fuelTypes": [
"COMPRESSED_NATURAL_GAS",
"DIESEL",
"GASOLINE",
"LIQUEFIED_NATURAL_GAS",
"LIQUEFIED_PETROLEUM_GAS",
"NONE"
],
"emissionStandards": [
"EURO_1",
"EURO_2",
"EURO_3",
"EURO_4",
"EURO_5",
"EURO_6"
],
"vehicleAttributes": {
"minTotalWeight": "7500"
}
}
]
},
"toll": {
"vehicleCategories": [
"BUS",
"CAR",
"EMERGENCY_VEHICLE",
"DELIVERY_TRUCK",
"TAXI",
"THROUGH_TRAFFIC",
"TRUCK"
]
}
}
The following picture illustrates an example response:
As you can see in the picture above the distance between the input position and the left road is nearly the same as the distance to the matched segment on the right road. In this case the heading and the segment angle of the right road are almost identical (the angle difference is only about 32°). This leads to the match on the right. Thus giving a heading for the input increases the match quality significantly.