What you really get from GPS is a vector in earth-centered, earth fixed (ECEF) coordinates.  The origin is the rotational center of the earth, the XY plane is the equator, and the XZ plane goes through the prime meridian at Greenwich. You run this through a simple standard formula which models the Earth&#x27;s slightly elliptical shape, and get out latitude, longitude, and elevation relative to a defined sea level.<p>ECEF is based on physical reality.  The choice of prime meridian is arbitrary, but everything else has a physical basis. GPS, GLONASS, and Galileo all generate (almost) the same ECEF coordinates. (GLONASS has a position for the center of the earth about 3mm from GPS.  Galileo is also about 3mm different.) This reflects when measurements were made.<p>Latitude and longitude are computed by putting ECEF coordinates into a geoid model. All such formulas are approximations. WGS-84 is used by most of the world.  GLONASS uses PZ-90, which is slightly different from WGS-84 and fits the earth&#x27;s profile better in Russia. The Chinese &quot;encrypted&quot; geoid is WGS-84 with some junk offsets added for coordinates within China&#x27;s area of interest.[1] There&#x27;s an actual &quot;out of China&quot; test:<p><pre><code>    outofChina &lt;- function(lat, lon){
      if(lon &lt; 72.004 | lon &gt; 137.8347) return(TRUE)
      if(lat &lt; 0.8293 | lat &gt; 55.8271) return(TRUE)
      return(FALSE)
    }
</code></pre>
This is a rather expansive view of China; this goes almost to the equator, including all of the South China Sea and the Spratly Islands.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;caijun&#x2F;geoChina&#x2F;blob&#x2F;master&#x2F;R&#x2F;cst.R" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;caijun&#x2F;geoChina&#x2F;blob&#x2F;master&#x2F;R&#x2F;cst.R</a>