Php 使用HERE api获取两点之间的直线距离(半径)

Php 使用HERE api获取两点之间的直线距离(半径),php,api,curl,maps,Php,Api,Curl,Maps,我使用HERE api来计算带车路线上两点之间的距离。我检查我的代码,如果距离超过25公里,就会弹出一条错误消息。现在我需要修改我的代码,不检查汽车路线中的25公里距离,而是一条直线,因此从a点到B点的半径为25公里 使用HERE api可以实现这一点吗?我找不到关于它的任何文件。不幸的是,谷歌地图不是一个选项,因为它们现在是基于订阅的模式 目前,我使用以下代码获取路线之间的距离: $coordinatecustomerencoded = urlencode('geo!'.$latitudecu

我使用HERE api来计算带车路线上两点之间的距离。我检查我的代码,如果距离超过25公里,就会弹出一条错误消息。现在我需要修改我的代码,不检查汽车路线中的25公里距离,而是一条直线,因此从a点到B点的半径为25公里

使用HERE api可以实现这一点吗?我找不到关于它的任何文件。不幸的是,谷歌地图不是一个选项,因为它们现在是基于订阅的模式

目前,我使用以下代码获取路线之间的距离:

$coordinatecustomerencoded = urlencode('geo!'.$latitudecustomer.','.$longitudecustomer);
$conditionsencoded = urlencode('fastest;car;traffic:disabled');

// Put headers inside array
$distanceheaders = array();
// The URL where a curl request is made to
$distanceurl = 'https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!51.8284405,4.2560131&waypoint1='.$coordinatecustomerencoded.'&mode='.$conditionsencoded.'&app_id=myappid&app_code=myapicode';
$distancecurl = curl_init($distanceurl);
curl_setopt($distancecurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($distancecurl, CURLOPT_HTTPHEADER, $distanceheaders);

// The JSON response
$distanceresponse = curl_exec($distancecurl);