There are many online correction databases with a latitude and longitude precision of 0.1. The size of the database is about 3 m, and the number of data sources is less than 0.1 million. If it is used in RIA, Android or iPhone is good, but the data accuracy is relatively low. After correction, the deviation is about 0.0001 orders of magnitude. The deviation is calculated based on an actual distance of 111km. The deviation is about 0.0001*111000 = 11.1m.
In addition, there are many correction databases with a longitude and latitude of 0.01 on the Internet. If they include all over the country, their size will be nearly 480 MB (less than this number is definitely part of the national data ), there are about 9 million data sources. Although the correction effect is indeed good (the deviation is about 0.00003*111000 = 3.33m), it is not advisable to apply it to a memory-based platform.
I have written a class library that converts two types of coordinates to each other, compress the data source, and write it into the DAT file in the form of a binary byte stream.
The size of the database with 0.1 deviations is 2.65 MB, and the size of the database with 0.01 deviations is 74.8 mb. Furthermore, the data structure is optimized to improve the query efficiency with excellent algorithms. It is better than querying the correction database.
In addition, the Mars coordinates are converted back to the WGS84 longitude and latitude coordinates. The correction data source is also a dat file, which is about 4.67 MB in size.
[Insert an advertisement: If need http://item.taobao.com/item.htm? SPM = 686.1000925.1000774.6.kpwbnf & id = 16891721656]
Instance:
Double X = 0.0;
Double Y = 0.0;
Double xx= 0.0;
Double YY = 0.0;
Console. writeline (string. Format ("Conversion: {0}, {1}", 121.529511809335, 31.3040797824361 ));
Console. writeline (string. Format ("-> expected results: {0}, {1}", 121.533851623535, 31.3020216901361); // correct corrected value
Wgs2marshigh. parse (121.529511809335, 31.3040797824361, ref X, ref y );
Console. writeline (string. Format ("-> 0.01 Accuracy correction Conversion Result: {0 },{ 1}", x, y ));
Wgs2mars. parse (121.529511809335, 31.3040797824361, ref X, ref y );
Console. writeline (string. Format ("-> 0.1 accuracy correction Conversion Result: {0 },{ 1}", x, y ));
Console. writeline ("");
Console. writeline (string. Format ("Conversion: {0}, {1}", 121.514754295361, 31.3016871248306 ));
Console. writeline (string. Format ("-> expected results: {0}, {1}", 121.5191316604612, 31.29965653523061); // correct corrected value
Wgs2marshigh. parse (121.514754295361, 31.3016871248306, ref X, ref y );
Console. writeline (string. Format ("-> 0.01 Accuracy correction Conversion Result: {0 },{ 1}", x, y ));
// Transfer the Mars coordinates to the WGS-84 coordinates
Mars2wgs. parse (X, Y, ref XX, ref YY );
Console. writeline (string. Format ("-> 0.01 precision inverse correction Conversion Result: {0 },{ 1}", XX, YY ));
Wgs2mars. parse (121.514754295361, 31.3016871248306, ref X, ref y );
Console. writeline (string. Format ("-> 0.1 accuracy correction Conversion Result: {0 },{ 1}", x, y ));
// Transfer the Mars coordinates to the WGS-84 coordinates
Mars2wgs. parse (X, Y, ref XX, ref YY );
Console. writeline (string. Format ("-> 0.1 precision inverse correction Conversion Result: {0 },{ 1}", XX, YY ));
Console. readkey ();