1. Map Matching
GraphHopper Directions API
  • Routing
    • Calculate a route
      GET
    • Calculate a route
      POST
  • Isochrones
    • Compute an isochrone
      GET
  • Matrices
    • Compute a matrix
      POST
    • Compute a matrix
      GET
    • Submit a matrix computation job
      POST
    • Retrieve result of a matrix computation job
      GET
  • Map Matching
    • Map-match a GPX file
      POST
  • Geocoding
    • Geocoding Endpoint
      GET
  • Route Optimization
    • Solve a route optimization problem
      POST
    • Submit a route optimization job
      POST
    • Retrieve solution of a route optimization job
      GET
  • Clustering
    • Solve a clustering problem
      POST
    • Submit a clustering job
      POST
    • Retrieve solution of a clustering job
      GET
  • Custom Profiles
    • Create a custom routing profile
      POST
    • List your custom routing profiles
      GET
    • Submit a profile creation job
      POST
    • Retrieve result of a profile creation job
      GET
    • Delete a custom routing profile
      DELETE
  • 数据模型
    • Schemas
      • ClusterResponse
      • Cluster
      • ClusterRequest
      • ClusterConfiguration
      • Clusters
      • ClusterCustomer
      • ClusterCustomerAddress
      • ClusterConfigurationRouting
      • ClusterConfigurationClustering
      • GeocodingResponse
      • GeocodingLocation
      • GeocodingPoint
      • MatrixRequest
      • SymmetricalMatrixRequest
      • MatrixResponse
      • RouteRequest
      • CustomModel
      • CustomModelForProfile
      • ProfileRequest
      • ProfileResponse
      • ProfileGetResponse
      • RouteResponse
      • EncodedLineString
      • BBox
      • FeatureCollection
      • RouteResponsePath
      • ResponseInfo
      • IsochroneResponse
      • IsochroneResponsePolygon
      • LineString
      • Polygon
      • GHError
      • JobId
      • BadRequest
      • ErrorMessage
      • InternalErrorMessage
      • Request
      • Vehicle
      • VehicleProfileId
      • Shift
      • Algorithm
      • Address
      • ResponseAddress
      • SnappedWaypoint
      • DriveTimeBreak
      • TimeWindowBreak
      • VehicleType
      • Service
      • Shipment
      • Pickup
      • Stop
      • TimeWindow
      • PreferredVehicle
      • Configuration
      • Optimization
      • Routing
      • Objective
      • CostMatrix
      • GroupRelation
      • JobRelation
      • Response
      • Solution
      • Detail
      • Route
      • RoutePoint
      • Activity
  1. Map Matching

Map-match a GPX file

POST
/match
To get a match response you send a GPX file in the body of an HTTP POST request and specify request parameters like the key and profile in the URL.
See below for more supported parameters.

请求参数

Authorization
API Key
在 query 添加参数
key
示例:
key: ********************
or
Query 参数

Body 参数application/gpx+xml必填

示例
<gpx>
  <trk>
    <trkseg>
      <trkpt lat="51.343657" lon="12.360708"></trkpt>
      <trkpt lat="51.343796" lon="12.361337"></trkpt>
      <trkpt lat="51.342784" lon="12.361882"></trkpt>
    </trkseg>
  </trk>
</gpx>

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/match?gps_accuracy=undefined&profile=undefined&locale=undefined&elevation=undefined&details=undefined&instructions=undefined&calc_points=undefined&points_encoded=undefined&key=%3Capi-key%3E' \
--header 'Content-Type: application/gpx+xml' \
--data '<gpx>
  <trk>
    <trkseg>
      <trkpt lat="51.343657" lon="12.360708"></trkpt>
      <trkpt lat="51.343796" lon="12.361337"></trkpt>
      <trkpt lat="51.342784" lon="12.361882"></trkpt>
    </trkseg>
  </trk>
</gpx>'

返回响应

🟢200成功
application/json
Map matching result
Headers

Bodyapplication/json

示例
{
    "paths": [
        {
            "distance": 0,
            "time": 0,
            "ascend": 0,
            "descend": 0,
            "points": "string",
            "snapped_waypoints": "string",
            "points_encoded": true,
            "bbox": [
                0
            ],
            "instructions": [
                {
                    "text": "string",
                    "street_name": "string",
                    "distance": 0,
                    "time": 0,
                    "interval": [
                        0
                    ],
                    "sign": 0,
                    "exit_number": 0,
                    "turn_angle": 0
                }
            ],
            "details": {},
            "points_order": [
                0
            ]
        }
    ],
    "info": {
        "copyrights": [
            "string"
        ],
        "took": 0
    }
}
修改于 2025-11-25 06:18:54
上一页
Retrieve result of a matrix computation job
下一页
Geocoding Endpoint
Built with