3 ms·
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 t
by Animats 11y ago
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's slightly elliptical shape, and get out latitude, longitude, and elevation relative to a defined sea level.
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.
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's profile better in Russia. The Chinese "encrypted" geoid is WGS-84 with some junk offsets added for coordinates within China's area of interest.[1] There's an actual "out of China" test:
outofChina <- function(lat, lon){
if(lon < 72.004 | lon > 137.8347) return(TRUE)
if(lat < 0.8293 | lat > 55.8271) return(TRUE)
return(FALSE)
}
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.
[1] https://github.com/caijun/geoChina/blob/master/R/cst.R https://github.com/caijun/geoChina/blob/master/R/cst.R
- userbinator 11y agoThe "encryption" looks like it's just a polynomial function, which would certainly be very easy to "reverse engineer" using the usual mathematical regression techniques. The Baidu one which is also mentioned in your link looks even simpler.
- ChrisFoster 11y agoThere's some interesting complications to the idea of an underlying Cartesian ECEF coordinate system as physical reality. For one thing, gravitational distortion (Earth tide) changes the shape of the solid part of the Earth by ~50cm twice a day. This would be a huge unwanted effect when doing high precision surveys, but it's removed when producing coordinates in the international terrestrial reference frame. If you have a nearby reference station which shares the common periodic motion this is relatively easy. If not, the software needs to be aware of the periodic motion and remove it explicitly. I'm constantly amazed that the whole system can be made to work at such high precision - sub 10cm from a moving aerial survey platform with decent gear. There's rather a lot of correction factors to get just right when pinning a consistent coordinate system on a squishy rotating blob like the Earth.