Closed nakasix closed 5 years ago
Which one are you using? greatCircleLength() should return in meters if the coordinates are in lat/lon. Use haversineLength() if you have projected coordinates.
In fact, I do not use any of these functions. I use the distance function to know the distance between two points, but I would like to get it in meters.
My sample code is :
$obj_geophp_point = geoPHP::load("POINT($flt_longitude $flt_latitude)"); # My point
$str_kml = file_get_contents('map.kml'); # My KML
$obj_geophp_kml = geoPHP::load($str_kml,'kml'); # KML with one Polygon = My Polygon
$flt_result = $obj_geophp_kml->distance($obj_geophp_point); # Get distance between Polygon and distance
var_dump($flt_result);
Regards,
Oh, I'm sorry, selecting the proper length method is a frequently asked question, I associated that. As I know, geoPHP has no distance method like that. You can implement it based on the previously mentioned length methods.
Thank you, I will implement my own method.
Hello,
Is it possible to get the result of distance method in meters or how to convert this distance ?
Regards,