(not confirmed)
The last Zxid
The last response time stamp
Time delay information for the connection
such as
Detailed information is as follows:
/192.168.147.102:56168[1] (queued=0,recved=60,sent=60,sid=0x24b3673bb141d0e,lop=ping,est=1422614959584,to=40000 , lcxid=0x9,lzxid=0xffffffffffffffff,lresp=1422615627690,llat=1,minlat=0,avglat=0,maxlat=1)/ 192.168.162.16:43107[1] (queued=0,recved=619,sent=643,sid=0x24b3673bb1419fa,lop=ping,est=1422610618969,
= (m_originshift-my)/Res;TXY[0] = (int) (Math.ceil (px/(float) (256))-1);TXY[1] = (int) (Math.ceil (py/(float) (256))-1);}Calculate latitude and longitude output tile number and image pixel size to be tiledpublic int getgeodeticsize (double Minlon, double Maxlon, double Minlat, double maxlat, int zoom, int[] pixsize) {int[] Tminxy = new int[]{0,0};int[] Tmaxxy = new int[]{0,0};Lonlattotile (MINLON,MINLAT,ZOOM-1,TMINXY);Lonlattotile (MAXLON,
known the range of the screen height (Y), width (H), and geographical coordinate areas (maxlon, minlon, maxlat, minlat ).. here we know these known parameters...2. We can calculate the longitude and latitude represented by each pixel (this is called a proportional factor ):Formula: scalex = H/(maxlon-minlon) * 3600) ---------- longitude seconds represented by each pixel on the X axis;Formula: scaley = y/(maxlat
("Post.location")){ //latitude and longitude of user $location=Explode(",", I ("Post.location")); $userLon=$location[0]; $userLat=$location[1]; //latitude and Longitude filter $location= Getaround ($userLat,$userLon, 1000000); $wheres 1. = "and (((Px_lat >= {$location["Minlat"]}) and (Px_lat $location[' Maxlat ']}) and ((Px_lon >= {$location[' MINLNG ']}) and (Px_lon $location[' MAXLNG ']})) "; //latitude and longitud
coordinates learned in primary school. Left and down rules. Screen coordinates define rules: The x-axis increments to the right, and the y-axis increments downward. As you can see, the difference between geographic coordinates and screen coordinates is simply that the y-axis increments in the opposite direction (which is different). It is emphasized here that in order to guarantee the accuracy, the degree of geographical coordinates is *3600 converted into seconds, all the values are computed b
Before doing a similar application, today turned out to look at, feel that the writing is not very reasonable, and then re-considered after writing a query stored procedures.
Table is not described,
The process is as follows:
--------------------------------Procedure structure for DIS------------------------------DROP Procedure IF EXISTS ' DIS ';D elimiter;; CREATE definer= ' root ' @ ' localhost ' PROCEDURE ' DIS ' (in ' _lat ' varchar (one), in ' _lng ' varchar (one), in ' _ras ' int,inout '
= Json_decode ($data, true); $ret [' lat '] = $data [' result '] [' location '] [lat ']; $ret [' lng '] = $data [' result '] [' location '] [' LNG ']; echo Json_encode ($ret); }
2. If the store is within 1000 meters, we need to calculate the latitude and longitude range within 1000 meters.
/* * Calculate latitude and longitude range * $lat latitudes * $lon Longitude * $raidus radius (m) */function Getaround ($lat, $ Lon, $raidus) {$PI = 3.14159265; $EARTH
, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ ch, CURLOPT_NOSIGNAL, 1); $ data = curl_exec ($ ch); curl_close ($ ch ); $ data = json_decode ($ data, true); $ ret ['lat'] = $ data ['result'] ['location'] ['lat']; $ ret ['lng '] = $ data ['result'] ['location'] ['lng']; echo json_encode ($ ret );}
2. if the store is within 1000, we need to calculate the latitude and longitude range within 1000.
/** Calculate the latitude and longitude range * $ lat latitude * $ lon longitude * $ raidus radius (
PHP obtains the data calculation range of the range coordinate based on the longitude and latitude, and can search users.
// Computing range, which can be used for searching users
12345678910111213141516171819202122
Function GetRange ($ lat, $ lon, $ raidus) {// calculate the latitude $ degree = (24901 1609)/360.0; $ dpmLat = 1/$ degree; $ radiusLat = $ dpmLat $ raidus; $ minLat = $ lat $ radiusLat; // obtain the minimum latitude. $ maxLat
Thinkphp implements nearby queries, such as nearby people and nearby deals.First, you want to locate the latitude and longitude of the user. The client-side targeting method can be located using the Map API or with the HTML5 browser (less stable and less precise).Then, the current latitude and longitude, and the distance required to search, calculate a latitude and longitude range, this range is "nearby." An example of this "nearby" is calculated as follows:/** * * @param $latitude latitude * @p
(Math.sin (MDIFFERENCE/2), 2))); Distance= Distance *Earth_radius; Distance= Math.Round (Distance * 10000)/10000; String Distancestr= distance+ ""; Distancestr=Distancestr. SUBSTRING (0, Distancestr.indexof ("."))); returnDistancestr; } /*** Get the latitude and longitude values within a certain distance of the current user * unit meters return Minlat * min Longitude minlng * min latitude Maxlat * Maximum longitude maxlng * Maximum latitude
{Private static final Double PI = 3.14159265;Private static final Double Earth_radius = 6378137;Private static final Double RAD = math.pi/180.0;/*** @param raidus Unit Meter* Specify the location (latitude and longitude LNG lat) and search radius (r) to search for data in the specified range* If the accuracy requirement is not very high, you can calculate the latitude and longitude range according to the latitude and longitude and radius of the specified position, and then determine whether the
from 0 to 360Longpolling = 180 + longpolling;
// Find tile size from zoom levelDouble lattilesize = 180/(POW (2, (17-zoom )));Double longtilesize = 360/(POW (2, (17-zoom )));
// Find the tile coordinatesInt tilex = (INT) (longpolling/longtilesize );Int tiley = (INT) (latitude/lattilesize );
The preceding figure assumes that the projection is a plane.
In fact, GoogleMap and 51ditu use the mocato projection during display. Therefore, the above algorithm needs to be modified.In mocato proje
1. Calculate distance to maximum minimum latitude and longitude according to latitude and longitude C #
public class Latlonutil {private static double PI = 3.14159265;//pi private static double
_radius = 6378137;
private static Double RAD = math.pi/180.0;
@see//The circumference of the Earth is 24,901 miles. 24,901/360 = 69.17 miles/degree/** * @param raidus * unit: M return minlat,min
LNG,MAXLAT,MAXLN
Before doing a similar application, today turned out to look at, feel that the writing is not very reasonable, and then re-considered after writing a query stored procedures.Table is not described,The process is as follows:--------------------------------Procedure structure for DIS------------------------------DROP Procedure IF EXISTS ' DIS ';D elimiter;; CREATE definer= ' root ' @ ' localhost ' PROCEDURE ' DIS ' (in ' _lat ' varchar (one), in ' _lng ' varchar (one), in ' _ras ' int,inout ' _dat
this is calculated:/** * @param lat latitude lon longitude Raidus Unit m * Return MINLAT,MINLNG,MAXLAT,MAXLNG*/ Public functionGetaround ($lat,$lon,$raidus){$PI= 3.14159265;$latitude=$lat;$longitude=$lon;$degree= (24901*1609)/360.0;$raidusMile=$raidus;$dpmLat= 1/$degree;$radiusLat=$dpmLat*$raidusMile;$minLat=$latitude–$radiusLat;$maxLat=$latitude+$radiusLat;$mpdLng=$degree*Cos($latitude* ($PI/180));$dpmLng
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.