Access to National city and geographical coordinates, major coordinate system Beidou, Baidu, WGS-84 coordinate system conversion

Source: Internet
Author: User
Tags cos

1 The value to be taken from the top coordinate:

The coordinates that get to the section are as follows:

' Beijing ': [116.39564503788,39.92998577808], ' Tianjin ': [117.21081309155,39.14392990331], ' Shanghai City ': [121.48789948569,31.249161710015], ' Chongqing ': [106.53063501341,29.544606108886], ' Hefei ': [117.28269909168,31.866942260687], ' Wuhu ': [118.38410842323,31.366019787543], ' Bangbu ': [117.35707986588,32.929498906698], ' Huainan ': [117.01863886329,32.642811823748], ' Maanshan ': [118.51588184662,31.68852815888], ' Huaibei ': [116.79144742863,33.960023305364], ' Tongling ': [117.81942872881,30.940929694666], ' Anqing ': [117.05873877211,30.537897817381], ' Huangshan ': [118.293569632,29.734434856163], ' Chuzhou ': [118.32457035098,32.317350595384], ' Fuyang ': [115.82093225905,32.90121133057], ' Suzhou ': [116.98869241183,33.636772385781], ' Liu'an ': [116.50525268298,31.755558355198], ' Bozhou ': [115.78792824512,33.871210565302], ' Chizhou ': [117.49447677159,30.660019248161], ' Xuancheng ': [118.75209631098,30.951642354296], ' Fuzhou ': [119.33022110713,26.047125496573], ' Xiamen City ': [118.10388604566,24.489230612469], ' Putian ': [119.07773096396,25.448450136734], ' Sanming ': [117.64219393404,26.270835279362], ' Quanzhou ': [118.60036234323,24.901652383991], ' Zhangzhou ': [117.67620467895,24.517064779808], ' Nanping ': [118.18188294866,26.643626474198], ' Longyan ': [117.01799673877,25.078685433515], ' Ningde ': [119.54208214972,26.656527419159], ' Guangzhou ': [113.30764967515,23.120049102076], ' Shaoguan ': [113.59446110744,24.802960311892], ' Shenzhen ': [114.02597365732,22.546053546205], ' Zhuhai ': [113.56244702619,22.256914646126], ' Shantou ': [116.72865028834,23.383908453269], ' Foshan ': [113.13402563539,23.035094840514], ' Jiangmen ': [113.07812534115,22.575116783451], ' Zhanjiang ': [110.36506726285,21.257463103764], ' Maoming ': [110.93124533068,21.668225718822], ' Zhaoqing ': [112.47965336992,23.078663282929], ' Huizhou ': [114.41065807997,23.113539852408], ' Meizhou ': [116.12640309837,24.304570606031], ' Shanwei ': [115.3729242894,22.778730500164], ' Heyuan ': [114.71372147587,23.757250850469], ' Yangjiang ': [111.97700975587,21.871517304519], ' Qingyuan ': [113.04077334891,23.698468550422], ' Chaozhou ': [116.63007599086,23.661811676517], ' Jieyang ': [116.37950085538,23.547999466926], ' Yunfu ': [112.05094595865,22.937975685537], ' Anshun ': [105.92826996576,26.228594577737], ' Guizhou Southwest Buyi and Miao Autonomous Prefecture ': [104.90055779825,25.095148055927], ' Haikou ': [110.33080184834,20.022071276952 

4 municipalities are manually added.

2 coordinate system

coordinate system related knowledge; The above obtained is the Baidu coordinate system needs to convert the following method: Network address: Http://pan.baidu.com/s/1huRBw Interested can click the link to download!

State regulations, military, state-related data ... You cannot use the WGS84 coordinate system, please note that you are developing projects.

The conversion of the coordinate between the comparative professional is as follows:

/** Project Name:hecha * File Name:CommonCooder.java * Package Name:com.example.hecha * date:2014-12-5 pm 2:39:09 * Copyri  Ght (c), [email protected] Chen Fei rights Reserved. **/PackageCom.example.hecha;/** Classname:commoncooder * Function:add Function. * Reason:add Reason. * date:2014-12-5 pm 2:39:09 * @author CF * @version * @since JDK 1.6*/PublicClassCommoncooder {StaticDouble pi = 3.14159265358979324;StaticDouble A = 6378245.0;StaticDouble EE = 0.00669342162296594323;StaticDouble X_PI = 3.14159265358979324 * 3000.0/180.0;//WGS84 coordinate system turn into BD09PublicStatic String wgs84tobd09 (Double Gg_lat,DoubleGg_lon) {string[] redbstring = transform (Gg_lat, Gg_lon). Split (",");//WGS84 ===>gcj_02Gg_lon = double.parsedouble (redbstring[0]); Gg_lat = double.parsedouble (redbstring[1]);//Gcj-02 to Bd09DoubleBd_lat;DoubleBd_lon;Double x = gg_lon, y =Gg_lat;Double z = math.sqrt (x * x + y * y) + 0.00002 * Math.sin (Y *X_PI);Double theta = math.atan2 (y, x) + 0.000003 * MATH.COS (x *X_PI); Bd_lon = Z * Math.Cos (theta) + 0.0065; Bd_lat = Z * Math.sin (theta) + 0.006; System.out.println ("BD:" + Bd_lat + "," +Bd_lon);return Bd_lon + "," +Bd_lat; }//WGS84 ======> gcj_02PrivateStatic String transform (Double Wglat,DoubleWglon) {DoubleMglat;DoubleMglon; String resultstring =Null;If(Outofchina (Wglat, Wglon)) {resultstring = Wglon + "," +Wglat; Mglat =Wglat; Mglon =Wglon;Returnresultstring; }Double Dlat = Transformlat (wgLon-105.0, wgLat-35.0);Double Dlon = Transformlon (wgLon-105.0, wgLat-35.0);Double Radlat = wglat/180.0 *PiDouble Magic =Math.sin (Radlat); Magic = 1-ee * Magic *MagicDouble sqrtmagic =Math.sqrt (Magic); Dlat = (Dlat * 180.0)/((A * (1-ee))/(Magic * sqrtmagic) *PI); Dlon = (Dlon * 180.0)/(A/sqrtmagic * MATH.COS (Radlat) *PI); Mglat = Wglat +Dlat; Mglon = Wglon +Dlon;return Mglon + "," +Mglat; }PrivateStaticBoolean Outofchina (Double lat,DoubleLon) {if (Lon < 72.004 | | Lon > 137.8347)ReturnTrue;if (Lat < 0.8293 | | | lat > 55.8271)ReturnTrue;ReturnFalse; }PrivateStaticDouble Transformlat (Double X,DoubleY) {DOUBLE ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y+ 0.2 *Math.sqrt (Math.Abs (x)); RET + = (20.0 * Math.sin (6.0 * x * pi) + 20.0 * Math.sin (2.0 * x * pi)) * 2.0/3.0; RET + = (20.0 * Math.sin (y * pi) + 40.0 * Math.sin (y/3.0 * pi)) * 2.0/3.0; RET + = (160.0 * Math.sin (y/12.0 * pi) + * * Math.sin (Y * pi/30.0)) * 2.0/3.0;return ret;} private static double Transformlon (double x, double  y) {double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1* Math.sqrt (Math.Abs (x)); ret + = (20.0 * Math.sin (6.0 * x * pi) + 20.0 * Math.sin ( 2.0 * x * pi) * 2.0/3.0; return ret;}}       

3 ways to get coordinate values

http://api.map.baidu.com/geocoder/v2/?ak= you apply for the key&output=json&address= city name in Baidu &city=xx province "Baidu's acquisition Address"

The previous article mentioned how to obtain the country's provinces and cities County town Village ..... If you want to know, please click "http://www.cnblogs.com/chinhi/p/jsoupgetdata.html" Sorry ... Connected to the wrong but can also click

[Light Your Eyes]

The data is as follows:

Then the database queries: "Select name from the tab where name is NOT NULL and name! = '"

Read to the list collection and then the For loop executes the Baidu coordinates ......... .....

Then go to the top of the geographic data, you can be wretched to

Ha ha!

In addition, the conversion of Beidou coordinate system is attached ..... Http://pan.baidu.com/s/1dDdkW7J

Finally, look at my platform.

I can provide the source code, please email in the inside to get ...

Above!

Access to National city and geographical coordinates, major coordinate system Beidou, Baidu, WGS-84 coordinate system conversion

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.