The reason for GPS correction in China is the combination of technology (different databases) and political / economic interests.
Due to security concerns, China uses a different coordinate system from the rest of the world - GCJ-02 instead of WGS-84 , used by GPS satellites and the vast majority of maps. All maps of China must be approved by the State Council in order to mark the position of China on various politically disputed possessions (Tibet, Taiwan, etc.). Approval also requires cards to use the GCJ-02. This causes WGS-84 locations, such as GPS tracks from a genuine GPS receiver, to be displayed “off” when building on Chinese street maps.

Another coordinate system is usually not a problem, but China decided to encrypt the GCJ-02, so there is no direct conversion. The first conversion attempt used a coordinate database obtained from Google China Maps (ditu.google.com), when earlier it could calculate the deviation in 2010. It was an interpolation method and somewhat inaccurate. The data sets went on sale using offsets calculated for thousands of Chinese cities .
Meanwhile, the GCJ-02 algorithm has leaked and is a “public secret” (searching for “GCJ-02 conversion” finds many results). The eviltransform project is known to offer the conversion APIs for C, C #, Go, Java, JavaScript, and PHP. The geoChina library handles the conversion between GJC-02, WGS-084 and Baidu BD-09 using R.
The code is non-trivial and also performs a very crude check box to determine if it is in China:
function outOfChina(lat, lng) { if ((lng < 72.004) || (lng > 137.8347)) { return true; } if ((lat < 0.8293) || (lat > 55.8271)) { return true; } return false; }
This includes most of India, all of South and North Korea, the Philippines, Vietnam, Mongolia, Thailand and several other countries:

An improvement would be to use a polygon border like china.kml .