Google and Baidu use different latitude and longitude projection methods.
Therefore, it is very troublesome to use Google Maps to query standard longitude and latitude and then convert them to a hundred degrees.
However, Baidu has launched a small tool to easily obtain the latitude and longitude of a Baidu map at a certain point on the map.
That is, Baidu map
Scalar functions:
View code
Create Function DBO. fn_getdistance (@ lngbegin real, @ latbegin real, @ lngend real, @ latend real) returns float as begin declare @ distance real declare @ earth_radius real set @ earth_radius = 6378.137 -- The earth's radius is already divided by 1000, so the following calculated values are kilometers and kilometers declare @ radlatbegin real, @ radlatend real, @ radlatdiff real, @ radlngdiff real set @ radlatbegin. = @ Latbegin * Pi ()/ 180.0 Set @ radlate
Recent projects need to use the positioning function, and to obtain the latitude and longitude of the current location, consult the data to organize the following code:
function Locationposition () {var geolocation = new Bmap.geolocation ();Geolocation.getcurrentposition (function (r) {var city_lat = r.latitude;var city_lng = r.longitude;Cookies.set ("Save_city_latitude", City_lat);Cookies.set ("Save_city_longitude", CITY_LNG);Console.log (City_lat);
For example: Longitude: 10.123456 Latitude: 20.654321Get to the actual location according to the above coordinates (do not use Baidu map or the API of the map of Gao de)The code is as follows:Put it in latitude and longitude. Publicstringgetaddress (doublelatitude,doublelongitude) { geocodergeocoder=newgeocoder (this, Locale.getdefault ());try{ ListThis article is from the "Mobile Platform Development" blog
1.geopy Package Download location https://pypi.python.org/pypi/geopy2. Installation StepsRun cmd, switch to d:/python/geopy-1.11.0/directory (modified according to your own extracted directory and download version number), CD d:/python//geopy-1.11.0 Run command: setup.py build SE tup.py Installthen in the geopy-1.11.0 directory there is a geopy folder to copy this folder to the D:/python directory3. Method 1addresses=open (' C:\Users\Yilin.Wei\Documents\HR\cities6.txt ') from geopy.geocoders Imp
Because the Baidu map api,2.0+ and 3.0+ changes relatively big, API basically was completely changed, some students may 2.0+ API use is very familiar with, but update to 3.0+, but will encounter some small trouble (because the API has changed, you need to re-learn its API, the code will be re-written , which is more painful than egg). So here are some small examples, I hope to upgrade to the 3.0+ of the students have some help.1. How does the Baidu map API map move to the specified
This example describes how PHP calculates the distance between two coordinates (longitude, latitude). Share to everyone for your reference. Specific as follows:Here we use PHP to calculate the distance between two coordinates (longitude, latitude) and return the result to meters or kilometers.function distance($lat1, $lng1, $lat2, $lng2, $miles = true){$pi80 = M_PI / 180;$lat1 *= $pi80;$lng1 *= $pi80;$lat2
At a very young age, the teacher told us that any place on earth could be determined by latitude and longitude. The warp and weft are also marked on the paper map. When you use the Baidu map, you will see the warp and weft? Will you pay attention to the coordinates of a place, latitude and longitude? This article tells you how to display a place on the Baidu map of lati
Tags: long search limit Data sel technology share structure latitude and longitude return
database table Structure
2. The key is this SQLSELECT Address_, Longitude_, Latitude_, ROUND (6378.138 * 2 * ASIN (SQRT (POW () (? * PI ()/180-latitude_ * PI ()/180)/ 2), 2) + cos (? * PI ()/+) * cos (latitude_ * PI ()/+) * POW (SIN ((? * PI ()/180-longitude_ * PI ()/180)/2), 2)) ) * +) as Distance_um from xf_lfhz_health_roll_addires where business_id =?
In Android, GPS cannot be used to obtain longitude and latitude. solution:
Summary:
1. According to the Internet, two ways can be used to send latitude and longitude information to the simulator to simulate the satellite's receipt of latitude and longitude information:(1) In ddms, by setting the latitude and longit
Use navigator of H5. the geolocation interface obtains the longitude and latitude of the user. However, a confirmation message indicating whether to agree is displayed every time the user enters the page, resulting in unfriendly user experience. Are there other ways to obtain the user's latitude and longitude? The requirement is to obtain the user's latitude and
Android gets mobile phone longitude and latitude (GPS, NetWork), androidgps
It is a simple encapsulation to get simple. Check the Code:
Import android. content. context; import android. location. location; import android. location. locationListener; import android. location. locationManager; import android. OS. bundle;/*** Utils of Location Information ** @ author zsl **/public class LocationUtils {// latitud
Android development: LocationManager's process of obtaining longitude and latitude and positioning (with demo)Location functions are often used in Android development, especially those that depend on the location function. Many people prefer Baidu map and AMAP sdks and open APIs, however, if you only need information such as longitude and latitude, city, street address, and other information, you do not nee
1.PHP realization of distance by latitude calculationUnits of kmfunction Getdistance ($lng 1, $lat 1, $lng 2, $lat 2)//distance based on latitude and longitude{Turn angle into Fox degree$radLat 1=deg2rad ($lat 1);$radLat 2=deg2rad ($lat 2);$radLng 1=deg2rad ($lng 1);$radLng 2=deg2rad ($lng 2);$a = $radLat 1-$radLat 2;//Two latitude difference,
MySQL Performance tuning – use faster algorithms for distanceRecently encountered a problem, through a constant attempt to finally put a sentence originally occupied nearly 1 seconds of the query optimized to 0.01 seconds, efficiency increased 100 times times.The problem is that there is a MySQL data table that holds the latitude and longitude information for the user's place of residence, and the table structure can be simplified to: id (int), longit
. Net calculates the distance between 2 points, or calculates the distance between 2 coordinates and 2 latitude and longitude.The code is as follows:1 /// 2 ///calculates the distance between the Geographics locations3 /// 4 Public Static classgeodistance5 {6 Public Static DoubleBetween (DoubleLatitude1,DoubleLongitude1,DoubleLatitude2,DoubleLongitude2,7Distanceunits units =distanceunits.kilometers)8 {9 Do
SQL SERVER calculates the distance according to the latitude and longitude of the map.Copy codeThe Code is as follows:Go-- Create a latitude and longitude distance calculation functionCREATEFUNCTION [dbo]. [fnGetDistance]-- LatBegin start longitude-- LngBegin start dimension(@ LatBegin REAL, @ LngBegin REAL, @ LatEnd REAL, @ LngEnd REAL)RETURNSFLOATASBEGIN-- Distance (km)DECLARE @ Distance REALDECLARE @ EAR
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.