CN105005480A - Method for correcting software positioning deviation - Google Patents
Method for correcting software positioning deviation Download PDFInfo
- Publication number
- CN105005480A CN105005480A CN201510462343.4A CN201510462343A CN105005480A CN 105005480 A CN105005480 A CN 105005480A CN 201510462343 A CN201510462343 A CN 201510462343A CN 105005480 A CN105005480 A CN 105005480A
- Authority
- CN
- China
- Prior art keywords
- value
- math
- longitude
- latitude
- software
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Position Fixing By Use Of Radio Waves (AREA)
Abstract
The invention discloses a method for correcting a software positioning deviation. The method comprises the following steps: 1) utilizing Android Location Manager system service to obtain position information; 2) processing the position information obtained in the step 1); and 3) displaying a longitude value and a latitude value obtained in the step 2) on map/positioning software, wherein the step 2) comprises the following specific steps: 21) obtaining the longitude value and the latitude value in a location object; and 22) converting the longitude value and the latitude value, and eliminating errors through conversion. The method for correcting the software positioning deviation can effectively correct the position display deviation problem of traditional map/positioning software and other pieces of software which needs to be positioned, position display precision is effectively improved, and more accurate geographic information can be provided for production and life.
Description
Technical field
The present invention relates to geographic position and determine technical field, specifically a kind of method of correcting software deviations.
Background technology
The location-based service that Android makes application access be supported by equipment by the class during android.location wraps.The core component of position framework is LocationManager system service, it provides some application programming interface to determine position.The GCJ-02 that survey office of domestic use state formulates encrypts first to geographic position, and the coordinate of map software on this basis, has carried out the measure of BD-09 superencipher.The longitude and latitude that the GPS module of Android mobile device gets just uses the data after GCJ-02 encryption, needs the data display after converting BD-09 encryption to just can obtain geographic position accurately.Therefore, the display of latitude and longitude information on positioning software that the GPS module of Android mobile device gets has deviation.
Summary of the invention
The problem to be solved in the present invention is to provide a kind of method of correcting software deviations, the position shown by software such as the method map/location can eliminating Android mobile device and the deviation of raw position data.
The method of correction software deviations of the present invention comprises the following steps:
1) Android LocationManager system service is utilized to obtain positional information:
11) newly-built LocationManager object;
12) newly-built positional information monitors function;
13) positional information is obtained;
2) positional information that step 1) obtains is processed:
21) longitude in location object and latitude value is obtained;
22) longitude and latitude value are changed;
3) by step 2) longitude that obtains and latitude value show on map/positioning software.
Step 22) method changed is:
221) longitude to be converted and latitude value are done Math.sqrt (x * x+y * y)+0.00002 * Math.sin (y * pi) conversion process to obtain a double offset and be designated as z; Latitude and longitude value to be converted is done the value that Math.atan2 (y, x)+0.000003 * Math.cos (x * pi) process obtains a double type and be designated as theta;
222) by step 221) z and theta that obtain process z * Math.cos (theta)+0.0065 and obtain the longitude after changing, process z * Math.sin (theta)+0.006 and obtain the latitude value after changing.
X wherein in expression formula, y represents longitude to be converted and latitude value, the representative of Math.sqrt () method is to the data extraction of square root in bracket, the representative of Math.sin () method removes sine value to the numerical value in bracket, " * " is multiplication sign, "+" is plus sige, pi is the numerical value of circular constant, Math.atan2 () is for calculating the angle angle value of planimetric coordinates point and the x-axis represented in bracket, and Math.cos () method is for calculating the cosine value of numerical value in bracket.
The method of correction software deviations of the present invention effectively can correct current map/positioning software and other relate to the position display offset issue needing the software of locating, effective raising position display precision, for production and life provide geography information more accurately.
Embodiment
Below a kind of method of correcting software deviations that the present invention proposes is described in detail.
A kind of method of correcting software deviations of the present invention, comprises the following steps:
The first step: utilize Android LocationManager system service to obtain positional information:
11, newly-built LocationManager object;
12, newly-built positional information monitors function;
13, positional information is obtained.
Code is as follows:
LocationManager lManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener liLocationListener = new LocationListener()
{
@Override
public void onStatusChanged(String provider, int status,
Bundle extras)
{
}
@Override
public void onProviderEnabled(String provider)
{
}
@Override
public void onProviderDisabled(String provider)
{
}
@Override
public void onLocationChanged(Location location)
{
Next step needs to process this location object
}
};
lManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,
0,
0,
liLocationListener);
Second step: the positional information got in the process first step, i.e. location object:
21, the longitude in location object and latitude value is obtained;
22, the conversion of this technical method is utilized to longitude and latitude value.
Concrete conversion regime is:
221) longitude to be converted and latitude value are done Math.sqrt (x * x+y * y)+0.00002 * Math.sin (y * pi) conversion process to obtain a double offset and be designated as z.Latitude and longitude value to be converted is done the value that Math.atan2 (y, x)+0.000003 * Math.cos (x * pi) process obtains a double type and be designated as theta.
222) by step 221) z and theta that obtain process z * Math.cos (theta)+0.0065 and obtain the longitude after changing, process z * Math.sin (theta)+0.006 and obtain the latitude value after changing.
X wherein in expression formula, y represents longitude to be converted and latitude value, the representative of Math.sqrt () method is to the data extraction of square root in bracket, the representative of Math.sin () method removes sine value to the numerical value in bracket, " * " is multiplication sign, "+" is plus sige, pi is the numerical value of circular constant, Math.atan2 () is for calculating the angle angle value of planimetric coordinates point and the x-axis represented in bracket, and Math.cos () method is for calculating the cosine value of numerical value in bracket.
Code is as follows:
public static double pi = 3.1415926535897932384626;
double latitude = location.getLatitude();
double longitude = location.getLongitude();
double x = longitude, y = latitude ;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi);
double bd_lon = z * Math.cos(theta) + 0.0065;
double bd_lat = z * Math.sin(theta) + 0.006;
3rd step: the longitude that second step is obtained and latitude value, namely bd_lon and bd_lat value for showing in map software:
Such as, Baidu map api is utilized by bd_lon(longitude) and bd_lat(latitude) be set on map and show.
Above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., it all should be encompassed in the middle of right of the present invention.
Claims (3)
1. correct a method for software deviations, it is characterized in that, comprise the following steps:
1) Android LocationManager system service is utilized to obtain positional information;
2) positional information that step 1) obtains is processed:
21) longitude in location object and latitude value is obtained;
22) longitude and latitude value are changed;
3) by step 2) longitude that obtains and latitude value show on map/positioning software.
2. the method for correction software deviations according to claim 1, is characterized in that, described step 22) method changed is:
221) longitude to be converted and latitude value are done Math.sqrt (x * x+y * y)+0.00002 * Math.sin (y * pi) conversion process to obtain a double offset and be designated as z; Latitude and longitude value to be converted is done the value that Math.atan2 (y, x)+0.000003 * Math.cos (x * pi) process obtains a double type and be designated as theta;
222) by step 221) z and theta that obtain process z * Math.cos (theta)+0.0065 and obtain the longitude after changing, process z * Math.sin (theta)+0.006 and obtain the latitude value after changing;
X wherein in expression formula, y represents longitude to be converted and latitude value, the representative of Math.sqrt () method is to the data extraction of square root in bracket, the representative of Math.sin () method removes sine value to the numerical value in bracket, " * " is multiplication sign, "+" is plus sige, pi is the numerical value of circular constant, Math.atan2 () is for calculating the angle angle value of planimetric coordinates point and the x-axis represented in bracket, and Math.cos () method is for calculating the cosine value of numerical value in bracket.
3. the method for correction software deviations according to claim 1, is characterized in that, the process that described step 1) obtains positional information is:
11) newly-built LocationManager object;
12) newly-built positional information monitors function;
13) positional information is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510462343.4A CN105005480A (en) | 2015-07-31 | 2015-07-31 | Method for correcting software positioning deviation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510462343.4A CN105005480A (en) | 2015-07-31 | 2015-07-31 | Method for correcting software positioning deviation |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105005480A true CN105005480A (en) | 2015-10-28 |
Family
ID=54378161
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510462343.4A Pending CN105005480A (en) | 2015-07-31 | 2015-07-31 | Method for correcting software positioning deviation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105005480A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408041A (en) * | 2018-10-09 | 2019-03-01 | 深圳点猫科技有限公司 | A kind of the map coordinates system conversion method and electronic equipment of language based on programming |
CN111238507A (en) * | 2020-01-17 | 2020-06-05 | 青梧桐有限责任公司 | Method and system for determining geographic position of cell, electronic device and storage medium |
CN113157683A (en) * | 2021-05-12 | 2021-07-23 | 北京冠群信息技术股份有限公司 | Positioning and deviation rectifying method and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103245349A (en) * | 2013-05-13 | 2013-08-14 | 天津大学 | Route navigation method based on picture global positioning system (GPS) information and Google map |
CN104236579A (en) * | 2014-10-09 | 2014-12-24 | 武汉大学 | High-precision satellite navigation implementing method based on Android kernel layer |
-
2015
- 2015-07-31 CN CN201510462343.4A patent/CN105005480A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103245349A (en) * | 2013-05-13 | 2013-08-14 | 天津大学 | Route navigation method based on picture global positioning system (GPS) information and Google map |
CN104236579A (en) * | 2014-10-09 | 2014-12-24 | 武汉大学 | High-precision satellite navigation implementing method based on Android kernel layer |
Non-Patent Citations (2)
Title |
---|
QLL3609120: "关于GPS坐标与百度坐标相互转换的方法与问题", 《CSND》 * |
XIONG_IT: "Android开发:LocationManager获取经纬度及定位过程", 《CSDN》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408041A (en) * | 2018-10-09 | 2019-03-01 | 深圳点猫科技有限公司 | A kind of the map coordinates system conversion method and electronic equipment of language based on programming |
CN111238507A (en) * | 2020-01-17 | 2020-06-05 | 青梧桐有限责任公司 | Method and system for determining geographic position of cell, electronic device and storage medium |
CN113157683A (en) * | 2021-05-12 | 2021-07-23 | 北京冠群信息技术股份有限公司 | Positioning and deviation rectifying method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107820204B (en) | High-precision positioning method and system for protecting user position privacy | |
CN107426695B (en) | Broadcast-based gridding differential data broadcasting method, server and storage medium | |
US9134427B2 (en) | Determination of time zone and DST participation | |
CN102158801B (en) | Mobile terminal user-oriented accurate location based information service method and device | |
CN103714311A (en) | City navigation system construction method based on positioning two-dimensional codes and city navigation system based on positioning two-dimensional codes | |
CN104048659A (en) | Method and system for transforming map coordinate system | |
CN105005480A (en) | Method for correcting software positioning deviation | |
CN103364815A (en) | Moving station autonomous network RTK resolving system and resolving method thereof | |
CN102984654B (en) | Mobile terminal group tracking service method based on internet of things resource sharing platform | |
JPWO2017122253A1 (en) | GNSS correction data distribution apparatus, GNSS correction data distribution system, and GNSS correction data distribution method | |
CN103530382A (en) | Method for positioning railway space kilometer post | |
CN103913164A (en) | Mobile-terminal-based positioning method and system | |
CN102663558A (en) | Field multivariate data integrated acquisition method facing multi-type tasks | |
CN103888975A (en) | Base station latitude and longitude data verification method and system | |
CN102223709A (en) | Method for acquiring specific reference Gaussian plane rectangular coordinate based on continuous operational reference system (CORS) in real time | |
CN103605044A (en) | Coding engine realization method based on GIS electric power fault positioning | |
CN101458094A (en) | Navigation device capable of being corrected by map matched position and method thereof | |
CN103313191A (en) | Mutual positioning system between mobile terminals | |
US9712971B2 (en) | Automatic location address translation and less accurate location technology address to more accurate location technology address translation | |
CN102724632B (en) | Method for acquiring geographical location data | |
CN104596501A (en) | Dynamic map location correction method based on mobile geographic information platform | |
CN106526645A (en) | Positioning method and positioning device | |
CN113157683A (en) | Positioning and deviation rectifying method and system | |
CN102565829A (en) | External mobile tourist navigation and guide device and navigation and guide method thereof | |
CN104899271A (en) | Automatic search method of power distribution network functional position on the basis of mobile terminal GPS (Global Positioning System) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20151028 |
|
RJ01 | Rejection of invention patent application after publication |