本文整理汇总了PHP中Converter::WGStoBaiDuPoint方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::WGStoBaiDuPoint方法的具体用法?PHP Converter::WGStoBaiDuPoint怎么用?PHP Converter::WGStoBaiDuPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter::WGStoBaiDuPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: microtime
$q = "delete from lastpacket where tm<=date_sub(now(),INTERVAL 10 day)";
$mysqli->query($q);
$endtm = microtime(true);
$spantm = $endtm - $starttm;
$startm = $endtm;
echo "//" . $spantm . "\n";
$q = "select lat,lon,`call`,unix_timestamp(tm),tm,concat(`table`,symbol),msg,datatype from aprspacket where tm>=FROM_UNIXTIME(?) and tm>=? and lat<>'' and not lat like '0000.00%'";
$stmt = $mysqli->prepare($q);
$stmt->bind_param("is", $tm, $startdatestr);
$stmt->execute();
$stmt->bind_result($glat, $glon, $dcall, $dtm, $dtmstr, $dts, $dmsg, $ddt);
while ($stmt->fetch()) {
$lat = strtolat($glat);
$lon = strtolon($glon);
if ($jiupian == 1) {
$p = $mp->WGStoBaiDuPoint($lon, $lat);
$lon = $p->getX();
$lat = $p->getY();
} else {
if ($jiupian == 2) {
$p = $mp->ChinatoBaiDuPoint($lon, $lat);
$lon = $p->getX();
$lat = $p->getY();
}
}
$icon = "/img/" . bin2hex($dts) . ".png";
$dmsg = urlmessage($dcall, $icon, $dtmstr, $dmsg, $ddt, $glon, $glat);
echo "setstation(" . $lon . "," . $lat . ",\"" . $dcall . "\"," . $dtm . ",\"" . $icon . "\",\n\"" . $dmsg . "\");\n";
}
$stmt->close();
$endtm = microtime(true);
示例2: explode
} else {
$latui = $lat[0] + $lat[1] / 60 + $lat[2] / 3600;
}
}
$lon = explode(".", $loni);
if (count($lon) <= 2) {
$lonui = $loni;
} else {
if (strlen($lon[2]) == 3) {
$lonui = $lon[0] + ($lon[1] + $lon[2] / 1000) / 60;
} else {
$lonui = $lon[0] + $lon[1] / 60 + $lon[2] / 3600;
}
}
echo "归一化后纬度/经度:{$latui}/{$lonui}<br>";
$p = $mp->WGStoBaiDuPoint($lonui, $latui);
$lon = $p->getX();
$lat = $p->getY();
echo "百度地图纬度/经度:{$lat}/{$lon}<p>";
}
echo "<form action=" . $_SERVER["PHP_SELF"] . " method=POST>";
echo "<input name=setup type=hidden>";
echo "请按照如下3种格式之一输入(判断依据是最后小数点后数字位数)<br>\n";
echo "ddd.ddddd,度.度的十进制小数部分(5位)例如:31.12035º<br>";
echo "ddd.mm.mmm,度.分.分的十进制小数部分(3位)例如 31º10.335'<br>";
echo "ddd.mm.ss, 度.分.秒 例如 31º12'42<p>";
echo "GPS纬度: <input name=lat value=\"" . $lati . "\">(正数是北纬)<br>";
echo "GPS经度: <input name=lon value=\"" . $loni . "\">(正数是东经)<br>";
echo "<input type=submit value=转换>\n";
echo "</form>";
exit(0);